linux/drivers/thermal/qcom
Stephan Gerhold b6f739da00 thermal/drivers/qcom/tsens-v0_1: Add mdm9607 correction offsets
According to the msm-3.18 vendor kernel from Qualcomm, mdm9607 needs
"correction factors" to adjust for additional offsets observed after the
factory calibration values in the fuses [1, 2].

The fixed offsets should be applied unless there is a special
calibration mode value that indicates that no offsets are needed [3].

Note that the new calibration mode values are called differently in this
patch compared to the vendor kernel:
  - TSENS_TWO_POINT_CALIB_N_WA        -> ONE_PT_CALIB2_NO_OFFSET
  - TSENS_TWO_POINT_CALIB_N_OFFSET_WA -> TWO_PT_CALIB_NO_OFFSET
This is because close inspection of the calibration function [3] reveals
that TSENS_TWO_POINT_CALIB_N_WA is actually a "one point" calibration
because the if statements skip all "point2" related code for it.

[1]: d9d2db1b82
[2]: d75aef53a7
[3]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/blob/LE.UM.4.3.2.r1-04200-9x07/drivers/thermal/msm-tsens.c#L2987-3136

Fixes: a2149ab815 ("thermal/drivers/qcom/tsens-v0_1: Add support for MDM9607")
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Stephan Gerhold <stephan.gerhold@kernkonzept.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20230508-msm8909-tsens-v5-3-5eb632235ba7@kernkonzept.com
2023-06-26 12:03:13 +02:00
..
Kconfig nvmem: prefix all symbols with NVMEM_ 2022-09-24 14:54:38 +02:00
lmh.c firmware: qcom_scm: Move qcom_scm.h to include/linux/firmware/qcom/ 2023-02-08 19:15:16 -08:00
Makefile thermal/drivers/qcom: Add support for LMh driver 2021-08-18 09:32:25 +02:00
qcom-spmi-adc-tm5.c thermal/hwmon: Use the right device for devm_thermal_add_hwmon_sysfs() 2023-03-03 20:45:02 +01:00
qcom-spmi-temp-alarm.c thermal/hwmon: Use the right device for devm_thermal_add_hwmon_sysfs() 2023-03-03 20:45:02 +01:00
tsens-8960.c thermal/drivers/tsens: Allow configuring min and max trips 2022-12-14 15:25:40 +01:00
tsens-v0_1.c thermal/drivers/qcom/tsens-v0_1: Add mdm9607 correction offsets 2023-06-26 12:03:13 +02:00
tsens-v1.c thermal/drivers/qcom/tsens: Drop unused legacy structs 2023-06-26 12:03:13 +02:00
tsens-v2.c thermal/drivers/tsens: Add IPQ8074 support 2022-12-14 15:25:40 +01:00
tsens.c thermal/drivers/qcom/tsens-v0_1: Add mdm9607 correction offsets 2023-06-26 12:03:13 +02:00
tsens.h thermal/drivers/qcom/tsens-v0_1: Add mdm9607 correction offsets 2023-06-26 12:03:13 +02:00