Skip to content

Commit 18e997e

Browse files
Mason Changgregkh
authored andcommitted
thermal/drivers/mediatek/lvts_thermal: Add mt7988 lvts commands
commit 685a755 upstream. These commands are necessary to avoid severely abnormal and inaccurate temperature readings that are caused by using the default commands. Signed-off-by: Mason Chang <mason-cw.chang@mediatek.com> Link: https://lore.kernel.org/r/20250526102659.30225-4-mason-cw.chang@mediatek.com Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent dcb1ca0 commit 18e997e

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

drivers/thermal/mediatek/lvts_thermal.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,8 @@ static int lvts_resume(struct device *dev)
14431443
}
14441444

14451445
static const u32 default_conn_cmds[] = { 0xC103FFFF, 0xC502FF55 };
1446+
static const u32 mt7988_conn_cmds[] = { 0xC103FFFF, 0xC502FC55 };
1447+
14461448
/*
14471449
* Write device mask: 0xC1030000
14481450
*/
@@ -1453,6 +1455,12 @@ static const u32 default_init_cmds[] = {
14531455
0xC10300FC, 0xC103009D, 0xC10300F1, 0xC10300E1
14541456
};
14551457

1458+
static const u32 mt7988_init_cmds[] = {
1459+
0xC1030300, 0xC1030420, 0xC1030500, 0xC10307A6, 0xC1030CFC,
1460+
0xC1030A8C, 0xC103098D, 0xC10308F1, 0xC1030B04, 0xC1030E01,
1461+
0xC10306B8
1462+
};
1463+
14561464
/*
14571465
* The MT8186 calibration data is stored as packed 3-byte little-endian
14581466
* values using a weird layout that makes sense only when viewed as a 32-bit
@@ -1747,11 +1755,11 @@ static const struct lvts_ctrl_data mt8195_lvts_ap_data_ctrl[] = {
17471755

17481756
static const struct lvts_data mt7988_lvts_ap_data = {
17491757
.lvts_ctrl = mt7988_lvts_ap_data_ctrl,
1750-
.conn_cmd = default_conn_cmds,
1751-
.init_cmd = default_init_cmds,
1758+
.conn_cmd = mt7988_conn_cmds,
1759+
.init_cmd = mt7988_init_cmds,
17521760
.num_lvts_ctrl = ARRAY_SIZE(mt7988_lvts_ap_data_ctrl),
1753-
.num_conn_cmd = ARRAY_SIZE(default_conn_cmds),
1754-
.num_init_cmd = ARRAY_SIZE(default_init_cmds),
1761+
.num_conn_cmd = ARRAY_SIZE(mt7988_conn_cmds),
1762+
.num_init_cmd = ARRAY_SIZE(mt7988_init_cmds),
17551763
.temp_factor = LVTS_COEFF_A_MT7988,
17561764
.temp_offset = LVTS_COEFF_B_MT7988,
17571765
.gt_calib_bit_offset = 24,

0 commit comments

Comments
 (0)