Re: [PATCH v2 5/5] thermal/drivers/mediatek/lvts_thermal: Update calibration data documentation

From: Nícolas F. R. A. Prado
Date: Wed May 03 2023 - 21:02:04 EST


On Tue, Apr 25, 2023 at 03:30:52PM +0200, bchihi@xxxxxxxxxxxx wrote:
> From: Balsam CHIHI <bchihi@xxxxxxxxxxxx>
>
> Update LVTS calibration data documentation for mt8192 and mt8195.
>
> Signed-off-by: Balsam CHIHI <bchihi@xxxxxxxxxxxx>
> ---
> drivers/thermal/mediatek/lvts_thermal.c | 59 ++++++++++++++++++-------
> 1 file changed, 43 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
> index 8df7b4c72a658..3df4989f9902b 100644
> --- a/drivers/thermal/mediatek/lvts_thermal.c
> +++ b/drivers/thermal/mediatek/lvts_thermal.c
> @@ -531,30 +531,57 @@ static int lvts_sensor_init(struct device *dev, struct lvts_ctrl *lvts_ctrl,
> * The efuse blob values follows the sensor enumeration per thermal
> * controller. The decoding of the stream is as follow:
> *
> - * stream index map for MCU Domain :
> + * MT8195 :
> + * Stream index map for MCU Domain mt8195 :
> *
> - * <-----mcu-tc#0-----> <-----sensor#0-----> <-----sensor#1----->
> - * 0x01 | 0x02 | 0x03 | 0x04 | 0x05 | 0x06 | 0x07 | 0x08 | 0x09
> + * <-----sensor#0-----> <-----sensor#1----->
> + * 0x04 | 0x05 | 0x06 | 0x07 | 0x08 | 0x09

I don't think you need to remove the controller calibration data from this
comment, even though you don't use it in the code. Could come in handy in the
future.

> *
[..]
> + * MT8192 :
> + * Stream index map for MCU Domain mt8192 :
> + *
> + * <--------sensor#0---------> <--------sensor#1--------->
> + * 0x04 | 0x05 | 0x06 | 0x07 | 0x08 | 0x09 | 0x0A | 0x0B

Each sensor data is 3 bytes long, just like for MT8195. The fourth byte contains
the controller calibration data, but it is spread across these fourth bytes. I'd
just leave these bytes undocumented for now since they're not currently used.

So,

+ * <-----sensor#0-----> <-----sensor#1----->
+ * 0x04 | 0x05 | 0x06 | 0x07 | 0x08 | 0x09 | 0x0A | 0x0B

etc.

With that fixed,

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@xxxxxxxxxxxxx>

Thanks,
Nícolas