Thread (16 messages) flat view 16 messages, 3 authors, 2020-11-29
STALE2118d

Revision v6 of 15 in this series.

Revisions (15)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 [diff vs current]
  5. v5 [diff vs current]
  6. v6 current
  7. v7 [diff vs current]
  8. v8 [diff vs current]
  9. v9 [diff vs current]
  10. v10 [diff vs current]
  11. v11 [diff vs current]
  12. v12 [diff vs current]
  13. v13 [diff vs current]
  14. v14 [diff vs current]
  15. v15 [diff vs current]

[RFC PATCH v6 1/8] drivers: thermal: tsens: use get_temp for tsens_valid

From: Ansuel Smith <ansuelsmth@gmail.com>
Date: 2020-08-14 13:43:07
Also in: linux-arm-msm, linux-pm, lkml
Subsystem: arm/qualcomm mailing list, qualcomm tsens thermal driver, the rest, thermal · Maintainers: Amit Kucheria, Thara Gopinath, Linus Torvalds, Rafael J. Wysocki, Daniel Lezcano

Use the driver get_temp function instead of force to use the generic get
temp function. This is needed as tsens v0 version use a custom function
to get the real temperature.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
 drivers/thermal/qcom/tsens.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index 9af6f71ab640..9fe9a2b26705 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -580,7 +580,6 @@ int get_temp_tsens_valid(const struct tsens_sensor *s, int *temp)
 {
 	struct tsens_priv *priv = s->priv;
 	int hw_id = s->hw_id;
-	u32 temp_idx = LAST_TEMP_0 + hw_id;
 	u32 valid_idx = VALID_0 + hw_id;
 	u32 valid;
 	int ret;
@@ -600,9 +599,9 @@ int get_temp_tsens_valid(const struct tsens_sensor *s, int *temp)
 	}
 
 	/* Valid bit is set, OK to read the temperature */
-	*temp = tsens_hw_to_mC(s, temp_idx);
+	ret = priv->ops->get_temp(s, temp);
 
-	return 0;
+	return ret;
 }
 
 int get_temp_common(const struct tsens_sensor *s, int *temp)
-- 
2.27.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help