Skip to content

Commit 229f3fe

Browse files
Alice Guodlezcano
authored andcommitted
thermal/drivers/qoriq: Power down TMU on system suspend
Enable power-down of TMU (Thermal Management Unit) for TMU version 2 during system suspend to save power. Save approximately 4.3mW on VDD_ANA_1P8 on i.MX93 platforms. Signed-off-by: Alice Guo <[email protected]> Signed-off-by: Frank Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent 92009c3 commit 229f3fe

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/thermal/qoriq_thermal.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#define SITES_MAX 16
1919
#define TMR_DISABLE 0x0
2020
#define TMR_ME 0x80000000
21+
#define TMR_CMD BIT(29)
2122
#define TMR_ALPF 0x0c000000
2223
#define TMR_ALPF_V2 0x03000000
2324
#define TMTMIR_DEFAULT 0x0000000f
@@ -342,6 +343,12 @@ static int qoriq_tmu_suspend(struct device *dev)
342343
if (ret)
343344
return ret;
344345

346+
if (data->ver > TMU_VER1) {
347+
ret = regmap_set_bits(data->regmap, REGS_TMR, TMR_CMD);
348+
if (ret)
349+
return ret;
350+
}
351+
345352
clk_disable_unprepare(data->clk);
346353

347354
return 0;
@@ -356,6 +363,12 @@ static int qoriq_tmu_resume(struct device *dev)
356363
if (ret)
357364
return ret;
358365

366+
if (data->ver > TMU_VER1) {
367+
ret = regmap_clear_bits(data->regmap, REGS_TMR, TMR_CMD);
368+
if (ret)
369+
return ret;
370+
}
371+
359372
/* Enable monitoring */
360373
return regmap_update_bits(data->regmap, REGS_TMR, TMR_ME, TMR_ME);
361374
}

0 commit comments

Comments
 (0)