diff mbox series

[RFC,07/10] thermal/drivers/tsens: use tsens_calibrate_nvmem for msm8976 calibration

Message ID 20220910124701.4060321-8-dmitry.baryshkov@linaro.org
State New
Headers show
Series [RFC,01/10] dt-bindings: thermal: tsens: support per-sensor calibration cells | expand

Commit Message

Dmitry Baryshkov Sept. 10, 2022, 12:46 p.m. UTC
Call tsens_calibrate_nvmem() for parsing msm8976 calibration data in
addition to parsing the blob manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/thermal/qcom/tsens-v1.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/thermal/qcom/tsens-v1.c b/drivers/thermal/qcom/tsens-v1.c
index 11363a318ae8..2a4440a34735 100644
--- a/drivers/thermal/qcom/tsens-v1.c
+++ b/drivers/thermal/qcom/tsens-v1.c
@@ -213,6 +213,11 @@  static int calibrate_8976(struct tsens_priv *priv)
 	u32 p1[11], p2[11];
 	int mode = 0, tmp = 0;
 	u32 *qfprom_cdata;
+	int ret;
+
+	ret = tsens_calibrate_nvmem(priv, 2);
+	if (!ret)
+		return 0;
 
 	qfprom_cdata = (u32 *)qfprom_read(priv->dev, "calib");
 	if (IS_ERR(qfprom_cdata))