From mboxrd@z Thu Jan 1 00:00:00 1970 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 52CD0C5479D for ; Sun, 1 Jan 2023 19:41:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231593AbjAATkw (ORCPT ); Sun, 1 Jan 2023 14:40:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231180AbjAATkr (ORCPT ); Sun, 1 Jan 2023 14:40:47 -0500 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B66A5113F for ; Sun, 1 Jan 2023 11:40:43 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id bf43so38893268lfb.6 for ; Sun, 01 Jan 2023 11:40:43 -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=TYtjUT+M3oFXnz1+3np95t8dAyx1+tQdeRBBKgtx5CE=; b=Kti1yrq+olHVUl6JGRc1rYAr16VmgXp7FSvQGYr95i6+xR8KnAyfu3Hb3GAZ4QXfDw 5jLyPZUTgA0LGLjVWiXhHyHWWGbM+drWQeLSW7pXZu6KmjI1/63ApBKj3Ak/ev6ODHxE 73a4SG2I0KX5wxcDezhMPTCPvy8frXhsS8RQzSs7EPt6/ZFbRCEef4NavsjeIA6b/27Q WqPev2F5rMQ5rWTJYeypRB/oQrBxAj+7b44TzmUIDOuvALbEmghY1CNWOAPlvL6BGQbq 3mK1FQMuZnOE+LfqctaYZ50Ar15uPY6ymJhu3dROT4lU36tqlDAL6/28u6urPz77ZWGR StOQ== 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=TYtjUT+M3oFXnz1+3np95t8dAyx1+tQdeRBBKgtx5CE=; b=SpkTMU75VRdAnBxZW5laQx3AKHgRKOIhOvxFNB6QTE/IPIV3kmqw75HFuPqfu35oQ3 d4Qg6ljj0cTs2JikHUL1kps1eqIDr7waG0UwrvZNG9LJmGYaqJto6dRDkTW+q54BGQfs 6nDkaJfwsm3LmhTaJsgTkr9ApLZHLMvT8pFiD+z53U14lPdFFQa0Qd2U6u+NiwoWpuBb Y5/Zxpmngjk+D7n8IZmKevP1oHQKlYSKKRXfSqmjxaI6yxmfkIQsO3Rs6BhWQp+H0AFL vsJb4WpsO74rov3fiARFV5DvtKshYZkYB57od/ntfa0AbV9MlMyvp12z8NfMjyZTYZG2 FbEA== X-Gm-Message-State: AFqh2kqabqxRCJQGdGesnNTMmStLMfuzRZ07R4KCFXISlwhEoTClQj/O E+o/xmoZ8+uPjgj/Wa3P9A7zLg== X-Google-Smtp-Source: AMrXdXtkAXmzQsv07h+RmqwL324C5Kqi+yf938qTe2chKqXr8N9z/naMpc2TDfHukzu3A9x0LDxJ3A== X-Received: by 2002:ac2:5088:0:b0:4a4:7be4:9baf with SMTP id f8-20020ac25088000000b004a47be49bafmr11753590lfm.59.1672602042089; Sun, 01 Jan 2023 11:40:42 -0800 (PST) Received: from eriador.lan (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id w11-20020a056512098b00b004a100c21eaesm4228013lft.97.2023.01.01.11.40.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jan 2023 11:40:41 -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" , Shawn Guo , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v6 07/20] thermal/drivers/tsens: fix slope values for msm8939 Date: Sun, 1 Jan 2023 21:40:21 +0200 Message-Id: <20230101194034.831222-8-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230101194034.831222-1-dmitry.baryshkov@linaro.org> References: <20230101194034.831222-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 Cc: Shawn Guo Reviewed-by: Konrad Dybcio Acked-by: Shawn Guo Signed-off-by: Dmitry Baryshkov --- drivers/thermal/qcom/tsens-v0_1.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/qcom/tsens-v0_1.c b/drivers/thermal/qcom/tsens-v0_1.c index 0bc4e5cec184..6645c98ff56c 100644 --- a/drivers/thermal/qcom/tsens-v0_1.c +++ b/drivers/thermal/qcom/tsens-v0_1.c @@ -534,6 +534,21 @@ 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; + priv->sensor[9].slope = 2852; + + return init_common(priv); +} + /* v0.1: 8916, 8939, 8974, 9607 */ static struct tsens_features tsens_v0_1_feat = { @@ -599,7 +614,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, }; -- 2.39.0