Skip to contentSkip to conversation

Add support tsens in ipq5210 & ipq9650

PATCH In review Varadarajan Narayanan 2 participants 4 messages Jun 15 – Jun 17

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v4 cover Add support tsens in ipq5210 & ipq9650

ipq5210 and ipq9560 have the Qualcomm tsens-v2 IP. The tsens framework in these two SoCs are similar to the one found in ipq5332. This series adds the sensor data to the tsens-v2 driver.

v4: Fix version number

v3: (incorrect version number)
Add additional constraints for ipq9650
https://lore.kernel.org/linux-arm-msm/[email protected]/

v2: Combine bindings and driver patches
Use fallback for ipq5210 and dropped the driver changes
https://lore.kernel.org/linux-arm-msm/[email protected]/

v1: bindings - https://lore.kernel.org/linux-arm-msm/[email protected]/

    driver - https://lore.kernel.org/linux-arm-msm/[email protected]/

Varadarajan Narayanan (2):
dt-bindings: thermal: tsens: add ipq5210 & ipq9650 compatible thermal/drivers/qcom/tsens: Add support for ipq9650 tsens

 .../devicetree/bindings/thermal/qcom-tsens.yaml          | 9 +++++++++
 drivers/thermal/qcom/tsens-v2.c                          | 8 ++++++++
 drivers/thermal/qcom/tsens.c                             | 3 +++
 drivers/thermal/qcom/tsens.h                             | 2 +-
 4 files changed, 21 insertions(+), 1 deletion(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v4 1/2 dt-bindings: thermal: tsens: add ipq5210 & ipq9650 compatible

Add the compatible for the thermal sensors on the ipq5210 and ipq9650. The ipq5210 uses ipq5332-tsens as a fallback, while ipq9650 is added as a standalone v2 TSENS compatible with combined interrupt.

---
v4: Fix version number

v3: patch version no. mixup
Include ipq9650 to all applicable constraints
https://lore.kernel.org/linux-arm-msm/[email protected]/

v2: Fix fallback definition

    https://lore.kernel.org/linux-arm-msm/[email protected]/
---
 .../devicetree/bindings/thermal/qcom-tsens.yaml          | 9 +++++++++
 1 file changed, 9 insertions(+)
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml +9 -0
index f0efaa8349ee..bcec314e0532 100644
@@ -95,6 +95,13 @@ properties:
           - qcom,ipq5332-tsens
           - qcom,ipq5424-tsens
           - qcom,ipq8074-tsens
+          - qcom,ipq9650-tsens
+
+      - description: v2 of TSENS with combined interrupt
+        items:
+          - enum:
+              - qcom,ipq5210-tsens
+          - const: qcom,ipq5332-tsens
 
       - description: v2 of TSENS with combined interrupt
         items:
@@ -306,6 +313,7 @@ allOf:
               - qcom,ipq5332-tsens
               - qcom,ipq5424-tsens
               - qcom,ipq8074-tsens
+              - qcom,ipq9650-tsens
     then:
       properties:
         interrupts:
@@ -323,6 +331,7 @@ allOf:
               - qcom,ipq5332-tsens
               - qcom,ipq5424-tsens
               - qcom,ipq8074-tsens
+              - qcom,ipq9650-tsens
               - qcom,tsens-v0_1
               - qcom,tsens-v1
               - qcom,tsens-v2
Signature · 1 line
2.34.1
Reviewed-by on v4 1/2
#2 lore raw

Re: [PATCH v4 1/2] dt-bindings: thermal: tsens: add ipq5210 & ipq9650 compatible

Quoted 7 lines · Varadarajan Narayanan

Add the compatible for the thermal sensors on the ipq5210 and ipq9650. The ipq5210 uses ipq5332-tsens as a fallback, while ipq9650 is added as a standalone v2 TSENS compatible with combined interrupt.

---
v4: Fix version number

Best regards,
Krzysztof

#3 lore raw

PATCH v4 2/2 thermal/drivers/qcom/tsens: Add support for ipq9650 tsens

In reply to Varadarajan Narayanan

ipq9650's tsens is similar to ipq5332 tsens but has different number of sensors. Re-use the ipq5332 data for ipq9650 and modify the sensor related information.

---
v4: Pick R-b Dmitry Baryshkov

---
 drivers/thermal/qcom/tsens-v2.c | 8 ++++++++
 drivers/thermal/qcom/tsens.c    | 3 +++
 drivers/thermal/qcom/tsens.h    | 2 +-
 3 files changed, 12 insertions(+), 1 deletion(-)
drivers/thermal/qcom/tsens-v2.c +8 -0
index 2ee117aa91ba..70ee5ca4ece2 100644
@@ -299,6 +299,14 @@ const struct tsens_plat_data data_ipq5424 = {
 	.fields		= tsens_v2_regfields,
 };
 
+const struct tsens_plat_data data_ipq9650 = {
+	.num_sensors	= 11,
+	.ops		= &ops_ipq5332,
+	.hw_ids		= (unsigned int []){5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
+	.feat		= &ipq5332_feat,
+	.fields		= tsens_v2_regfields,
+};
+
 /* Kept around for backward compatibility with old msm8996.dtsi */
 struct tsens_plat_data data_8996 = {
 	.num_sensors	= 13,
drivers/thermal/qcom/tsens.c +3 -0
index 6e3714ecab1d..3e09a06db06b 100644
@@ -1173,6 +1173,9 @@ static const struct of_device_id tsens_table[] = {
 	}, {
 		.compatible = "qcom,ipq8074-tsens",
 		.data = &data_ipq8074,
+	}, {
+		.compatible = "qcom,ipq9650-tsens",
+		.data = &data_ipq9650,
 	}, {
 		.compatible = "qcom,mdm9607-tsens",
 		.data = &data_9607,
drivers/thermal/qcom/tsens.h +1 -1
index e8376accdff3..2514f1161794 100644
@@ -676,7 +676,7 @@ extern const struct tsens_plat_data data_ipq5018;
 
 /* TSENS v2 targets */
 extern struct tsens_plat_data data_8996, data_ipq8074, data_tsens_v2;
-extern const struct tsens_plat_data data_ipq5332, data_ipq5424;
+extern const struct tsens_plat_data data_ipq5332, data_ipq5424, data_ipq9650;
 
 /* TSENS automotive targets */
 extern struct tsens_plat_data data_automotive_v2;
Signature · 1 line
2.34.1