thermal/drivers/mediatek/lvts_thermal: Make coeff configurable
authorFrank Wunderlich <frank-w@public-files.de>
Fri, 22 Sep 2023 05:50:19 +0000 (07:50 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Sun, 15 Oct 2023 21:40:09 +0000 (23:40 +0200)
commit6725a29321e48b1dece66fc1ba7b458f0c1d6d77
treea22bf206470fcdc44df0ab219f9108a8c0e2fa81
parentbe2cc09bd5b46f13629d4fcdeac7ad1b18bb1a0b
thermal/drivers/mediatek/lvts_thermal: Make coeff configurable

The upcoming mt7988 has different temperature coefficients so we
cannot use constants in the functions lvts_golden_temp_init,
lvts_golden_temp_init and lvts_raw_to_temp anymore.

Add a field in the lvts_ctrl pointing to the lvts_data which now
contains the soc-specific temperature coefficents.

To make the code better readable, rename static int coeff_b to
golden_temp_offset, COEFF_A to temp_factor and COEFF_B to temp_offset.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de
drivers/thermal/mediatek/lvts_thermal.c