From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79B968F70 for ; Sun, 16 Jul 2023 19:56:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97340C433C7; Sun, 16 Jul 2023 19:56:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689537387; bh=H3UaHPdNJLh8FwYGDCbau5lFyoS1bRGp40pmJMWDXtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sP0pYxlXotKKknGy+wr0MFpmmTYs9+/Xd4mY/xbywJIUAgQ7KsTpxUtTmhMCcvCmv 9ENjVHMZlb+cthEzLnPE2c6GePbOgfE+usjirfEcy/eewooVVOb1ksPOTQFZv4o6GD AJGkcKNS/A7gV5WY4hSb2dEIF3/EmSlAWdzSRYEc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Konrad Dybcio , Dmitry Baryshkov , Stephan Gerhold , Daniel Lezcano , Sasha Levin Subject: [PATCH 6.4 077/800] thermal/drivers/qcom/tsens-v0_1: Fix mdm9607 slope values Date: Sun, 16 Jul 2023 21:38:50 +0200 Message-ID: <20230716194950.893857541@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230716194949.099592437@linuxfoundation.org> References: <20230716194949.099592437@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Stephan Gerhold [ Upstream commit 6812d1dfbca99cd5032683354bf50e0002b2aa02 ] According to the msm-3.18 vendor kernel from Qualcomm [1], mdm9607 uses a non-standard slope value of 3000 (instead of 3200) for all sensors. Fill it properly similar to the 8939 code added recently. [1]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/blob/LE.UM.4.3.2.r1-04200-9x07/arch/arm/boot/dts/qcom/mdm9607.dtsi#L875 Fixes: a2149ab815fc ("thermal/drivers/qcom/tsens-v0_1: Add support for MDM9607") Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Signed-off-by: Stephan Gerhold Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230508-msm8909-tsens-v5-2-5eb632235ba7@kernkonzept.com Signed-off-by: Sasha Levin --- drivers/thermal/qcom/tsens-v0_1.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/qcom/tsens-v0_1.c b/drivers/thermal/qcom/tsens-v0_1.c index ad57ab94546b0..e89a0da4b4e14 100644 --- a/drivers/thermal/qcom/tsens-v0_1.c +++ b/drivers/thermal/qcom/tsens-v0_1.c @@ -270,6 +270,16 @@ static int __init init_8939(struct tsens_priv *priv) { return init_common(priv); } +static int __init init_9607(struct tsens_priv *priv) +{ + int i; + + for (i = 0; i < priv->num_sensors; ++i) + priv->sensor[i].slope = 3000; + + return init_common(priv); +} + /* v0.1: 8226, 8916, 8939, 8974, 9607 */ static struct tsens_features tsens_v0_1_feat = { @@ -381,9 +391,15 @@ struct tsens_plat_data data_8974 = { .fields = tsens_v0_1_regfields, }; +static const struct tsens_ops ops_9607 = { + .init = init_9607, + .calibrate = tsens_calibrate_common, + .get_temp = get_temp_common, +}; + struct tsens_plat_data data_9607 = { .num_sensors = 5, - .ops = &ops_v0_1, + .ops = &ops_9607, .feat = &tsens_v0_1_feat, .fields = tsens_v0_1_regfields, }; -- 2.39.2