From patchwork Wed Dec 21 02:05:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 635811 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 531D4C3DA79 for ; Wed, 21 Dec 2022 02:05:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229889AbiLUCFf (ORCPT ); Tue, 20 Dec 2022 21:05:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234326AbiLUCF3 (ORCPT ); Tue, 20 Dec 2022 21:05:29 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 815801FCEA for ; Tue, 20 Dec 2022 18:05:28 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id bp15so21328698lfb.13 for ; Tue, 20 Dec 2022 18:05:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x8V/Buc6oo2svqQs4bKfvvLZCMHlCzEmULQ8sDxAW8g=; b=WBrsrnQGNMU70Bch/jsQeIvUfBeODew72Zw+gWa5YHlNg86oslkeBj2FOGFSmvo7Yj Rkb86rD+qWIU1gOSQzE93nihA6kF/RLW3l+rbV9zNPbm58j6/md+3i99fOeVscVLaBNY m+3slxRk8yQKpl5T7OeQ0dFOyQDuB4UsyTpY45amHkNNBeZdNdWtR2yf5r7RnNLrEiCt Wb2RWJ+LgYFYBtQ4TS3LaMfQXMv5WbqwB81Ngi98AmZNGhXZFjSLj9PtKk4BFJ7G/Q3p QDIdeqxF0IMos8HhF1NjGmP2oskcgZWQfVKlYV4qUUl3pD+IpZ1akBwBKZOuNGxgUAd0 Tm9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x8V/Buc6oo2svqQs4bKfvvLZCMHlCzEmULQ8sDxAW8g=; b=CZcXCfLYW6k0yDO7h8oqPPBbvRMaEeezus7RjWNygR7cFA03Kf13XphGc1AXVJiHOV cb+AhCk7gdYoktDKpv7HczN0/7GbtvS/8lZTZfVOTu7ntH5DpROG07ZaBeyVN0p/qDkQ nN1ZXcFaBdV0EwR8VeA0CxaDAa9PMQsLrq20KBNRxrANFdfjjJqEsOz91aj4urYa7yVQ IbcRZw8bcI5gYdrF/JjM0UxGUJPmkrt4eRK+YemUB0srJLbdsvbJPwDZTVPJwSZ1dNJq +0WnA0AgAKSU0usIyq4KoFneT9l8/EJEevvK761IqrtKfV40B40gpcJbHhTaWWrVYsg9 xjjw== X-Gm-Message-State: AFqh2krQyeieVml8Jihfm/BfRTOrWyq8d8tQ7ez8o1j0XZPIuA9LOIte DMPFveIaavDxm4ZzSKBD8qeNjg== X-Google-Smtp-Source: AMrXdXvEUY39j5qaHX11vhY3UPeRstTWDj7AelJ2YuHu1KWVWuWHIs+HF9FQyfrSNTFCDAFjowgxlw== X-Received: by 2002:ac2:4c8e:0:b0:4b6:ee97:36d2 with SMTP id d14-20020ac24c8e000000b004b6ee9736d2mr1138468lfl.40.1671588328108; Tue, 20 Dec 2022 18:05:28 -0800 (PST) Received: from eriador.lan (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id q18-20020a056512211200b004b257fef958sm1673048lfr.94.2022.12.20.18.05.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 18:05:27 -0800 (PST) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Amit Kucheria , Thara Gopinath , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui Cc: "Bryan O'Donoghue" , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v4 08/20] thermal/drivers/tsens: fix slope values for msm8939 Date: Wed, 21 Dec 2022 04:05:08 +0200 Message-Id: <20221221020520.1326964-9-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221221020520.1326964-1-dmitry.baryshkov@linaro.org> References: <20221221020520.1326964-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org According to the vendor kernels (msm-3.10, 3.14 and 3.18), msm8939 uses non-standard slope values for calibrating the sensors. Fill them accordingly. Fixes: 332bc8ebab2c ("thermal: qcom: tsens-v0_1: Add support for MSM8939") Cc: Bryan O'Donoghue Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio --- drivers/thermal/qcom/tsens-v0_1.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/qcom/tsens-v0_1.c b/drivers/thermal/qcom/tsens-v0_1.c index 57ac23f9d9b7..be173220a939 100644 --- a/drivers/thermal/qcom/tsens-v0_1.c +++ b/drivers/thermal/qcom/tsens-v0_1.c @@ -534,6 +534,20 @@ static int calibrate_9607(struct tsens_priv *priv) return 0; } +static int __init init_8939(struct tsens_priv *priv) { + priv->sensor[0].slope = 2911; + priv->sensor[1].slope = 2789; + priv->sensor[2].slope = 2906; + priv->sensor[3].slope = 2763; + priv->sensor[4].slope = 2922; + priv->sensor[5].slope = 2867; + priv->sensor[6].slope = 2833; + priv->sensor[7].slope = 2838; + priv->sensor[8].slope = 2840; + + return init_common(priv); +} + /* v0.1: 8916, 8939, 8974, 9607 */ static struct tsens_features tsens_v0_1_feat = { @@ -599,7 +613,7 @@ struct tsens_plat_data data_8916 = { }; static const struct tsens_ops ops_8939 = { - .init = init_common, + .init = init_8939, .calibrate = calibrate_8939, .get_temp = get_temp_common, };