Skip to content

Commit 62194e6

Browse files
Nicolas Pitredlezcano
authored andcommitted
thermal/drivers/mediatek/lvts_thermal: Move comment
Move efuse data interpretation inside lvts_golden_temp_init() alongside the actual code retrieving wanted value. Signed-off-by: Nicolas Pitre <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8c25958 commit 62194e6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/thermal/mediatek/lvts_thermal.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -734,11 +734,15 @@ static int lvts_calibration_read(struct device *dev, struct lvts_domain *lvts_td
734734
return 0;
735735
}
736736

737-
static int lvts_golden_temp_init(struct device *dev, u32 *value, int temp_offset)
737+
static int lvts_golden_temp_init(struct device *dev, u8 *calib, int temp_offset)
738738
{
739739
u32 gt;
740740

741-
gt = (*value) >> 24;
741+
/*
742+
* The golden temp information is contained in the 4th byte (index = 3)
743+
* of efuse data.
744+
*/
745+
gt = calib[3];
742746

743747
if (gt && gt < LVTS_GOLDEN_TEMP_MAX)
744748
golden_temp = gt;
@@ -762,11 +766,7 @@ static int lvts_ctrl_init(struct device *dev, struct lvts_domain *lvts_td,
762766
if (ret)
763767
return ret;
764768

765-
/*
766-
* The golden temp information is contained in the first chunk
767-
* of efuse data.
768-
*/
769-
ret = lvts_golden_temp_init(dev, (u32 *)lvts_td->calib, lvts_data->temp_offset);
769+
ret = lvts_golden_temp_init(dev, lvts_td->calib, lvts_data->temp_offset);
770770
if (ret)
771771
return ret;
772772

0 commit comments

Comments
 (0)