Message ID | 20230101194034.831222-8-dmitry.baryshkov@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Daniel Lezcano |
Headers | show |
Series | thermal/drivers/tsens: specify nvmem cells in DT rather than parsing them manually | expand |
On 01/01/2023 19:40, Dmitry Baryshkov wrote: > +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; How are you coming up with the last value here ? https://github.com/android-linux-stable/msm-3.18/blob/60a8d8af3751b9dc22894fe68b3964ea94ae7888/arch/arm/boot/dts/qcom/msm8939-common.dtsi#L525 --- bod
On 01/01/2023 22:24, Bryan O'Donoghue wrote: > On 01/01/2023 19:40, Dmitry Baryshkov wrote: >> +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; > > How are you coming up with the last value here ? > > https://github.com/android-linux-stable/msm-3.18/blob/60a8d8af3751b9dc22894fe68b3964ea94ae7888/arch/arm/boot/dts/qcom/msm8939-common.dtsi#L525 From this DTSi. There was a separate configuration for 8939 v3. And I don't know why Qualcomm completely ignored it for later releases (3.14, 3.18). https://git.codelinaro.org/clo/la/kernel/msm-3.10/-/blob/LA.BR.1.3.7.c26-03900-8976.0/arch/arm/boot/dts/qcom/msm8939-v3.0.dtsi#L613
On 01/01/2023 21:30, Dmitry Baryshkov wrote: > On 01/01/2023 22:24, Bryan O'Donoghue wrote: >> On 01/01/2023 19:40, Dmitry Baryshkov wrote: >>> +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; >> >> How are you coming up with the last value here ? >> >> https://github.com/android-linux-stable/msm-3.18/blob/60a8d8af3751b9dc22894fe68b3964ea94ae7888/arch/arm/boot/dts/qcom/msm8939-common.dtsi#L525 > > From this DTSi. There was a separate configuration for 8939 v3. And I > don't know why Qualcomm completely ignored it for later releases (3.14, > 3.18). > > https://git.codelinaro.org/clo/la/kernel/msm-3.10/-/blob/LA.BR.1.3.7.c26-03900-8976.0/arch/arm/boot/dts/qcom/msm8939-v3.0.dtsi#L613 > Fair enough Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
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, };