]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
thermal/drivers/qcom/tsens: Disable wakeup interrupt setup on automotive targets
authorPriyansh Jain <priyansh.jain@oss.qualcomm.com>
Mon, 1 Jun 2026 06:37:57 +0000 (12:07 +0530)
committerDaniel Lezcano <daniel.lezcano@kernel.org>
Wed, 3 Jun 2026 07:13:04 +0000 (09:13 +0200)
Add a no_irq_wake flag to struct tsens_plat_data to allow platforms
to control whether TSENS interrupts should be configured as wakeup
sources.

Create a new data_automotive structure and add compatible strings for
automotive TSENS variants (SA8775P, SA8255P) with wakeup interrupts
disabled.

Automotive platforms can enter a low-power parking suspend state where the
application processors and thermal mitigation paths are not active. In this
state, waking the system due to TSENS threshold interrupts does not enable
useful thermal action, but it does repeatedly break suspend residency and
increase battery drain.

Allow these automotive variants to keep TSENS monitoring enabled during
normal runtime while opting out of TSENS wakeup interrupts during suspend,
so the system can remain in low power until ignition/resume.

Signed-off-by: Priyansh Jain <priyansh.jain@oss.qualcomm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Link: https://patch.msgid.link/20260601-tsens_interrupt_wake_control-v2-2-ce9570946abd@oss.qualcomm.com
drivers/thermal/qcom/tsens-v2.c
drivers/thermal/qcom/tsens.c
drivers/thermal/qcom/tsens.h

index e06f8e5802e877ece0a4ac1850c97e1170d5656b..2ee117aa91baeab7aa52c96d8f5512efef5d1f16 100644 (file)
@@ -306,3 +306,11 @@ struct tsens_plat_data data_8996 = {
        .feat           = &tsens_v2_feat,
        .fields = tsens_v2_regfields,
 };
+
+/* Do not enable wakeup capable interrupts for automotive platforms */
+struct tsens_plat_data data_automotive_v2 = {
+       .ops            = &ops_generic_v2,
+       .feat           = &tsens_v2_feat,
+       .fields         = tsens_v2_regfields,
+       .no_irq_wake = true,
+};
index 78d12c247fb9a6bad41530152895a84f61150828..6e3714ecab1dafd2d51c373cd3627a2f19931a65 100644 (file)
@@ -1212,6 +1212,12 @@ static const struct of_device_id tsens_table[] = {
        }, {
                .compatible = "qcom,tsens-v2",
                .data = &data_tsens_v2,
+       }, {
+               .compatible = "qcom,sa8775p-tsens",
+               .data = &data_automotive_v2,
+       }, {
+               .compatible = "qcom,sa8255p-tsens",
+               .data = &data_automotive_v2,
        },
        {}
 };
@@ -1424,7 +1430,7 @@ static int tsens_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, priv);
 
-       device_init_wakeup(dev, true);
+       device_init_wakeup(dev, !data->no_irq_wake);
 
        if (!priv->ops || !priv->ops->init || !priv->ops->get_temp)
                return -EINVAL;
index 206ee2d5d301d11f7b0de768fcd56013ada5f5cf..e8376accdff3d2257f0cb85bbb32d4fc017d3b10 100644 (file)
@@ -532,6 +532,7 @@ struct tsens_features {
  * @hw_ids: Subset of sensors ids supported by platform, if not the first n
  * @feat: features of the IP
  * @fields: bitfield locations
+ * @no_irq_wake: if set, TSENS interrupts will not be configured as wakeup sources
  */
 struct tsens_plat_data {
        const u32               num_sensors;
@@ -539,6 +540,7 @@ struct tsens_plat_data {
        unsigned int            *hw_ids;
        struct tsens_features   *feat;
        const struct reg_field          *fields;
+       bool            no_irq_wake;
 };
 
 /**
@@ -676,4 +678,7 @@ extern const struct tsens_plat_data data_ipq5018;
 extern struct tsens_plat_data data_8996, data_ipq8074, data_tsens_v2;
 extern const struct tsens_plat_data data_ipq5332, data_ipq5424;
 
+/* TSENS automotive targets */
+extern struct tsens_plat_data data_automotive_v2;
+
 #endif /* __QCOM_TSENS_H__ */