Re: [PATCH v3] thermal: qoriq: Update the settings for TMUv2

From: Daniel Lezcano
Date: Mon May 25 2020 - 07:22:50 EST


On 25/05/2020 09:21, Yuantian Tang wrote:
> For TMU v2, TMSAR registers need to be set properly to get the
> accurate temperature values.
> Also the temperature read needs to be converted to degree Celsius
> since it is in degrees Kelvin.

> Signed-off-by: Yuantian Tang <andy.tang@xxxxxxx>
> ---

[ ... ]

> @@ -202,6 +213,8 @@ static void qoriq_tmu_init_device(struct qoriq_tmu_data *data)
> } else {
> regmap_write(data->regmap, REGS_V2_TMTMIR, TMTMIR_DEFAULT);
> regmap_write(data->regmap, REGS_V2_TEUMR(0), TEUMR0_V2);
> + for (i = 0; i < 7; i++)

Please wrap this litteral 7 to an explicit constant name

> + regmap_write(data->regmap, REGS_V2_TMSAR(i), TMSARA_V2);
> }
>
> /* Disable monitoring */
> @@ -212,6 +225,7 @@ static const struct regmap_range qoriq_yes_ranges[] = {
> regmap_reg_range(REGS_TMR, REGS_TSCFGR),
> regmap_reg_range(REGS_TTRnCR(0), REGS_TTRnCR(3)),
> regmap_reg_range(REGS_V2_TEUMR(0), REGS_V2_TEUMR(2)),
> + regmap_reg_range(REGS_V2_TMSAR(0), REGS_V2_TMSAR(15)),
> regmap_reg_range(REGS_IPBRR(0), REGS_IPBRR(1)),
> /* Read only registers below */
> regmap_reg_range(REGS_TRITSR(0), REGS_TRITSR(15)),
>


--
<http://www.linaro.org/> Linaro.org â Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog