Re: [PATCH] power: supply: max77693: Fix wrong conversion of charge input threshold value

From: Krzysztof Kozlowski
Date: Mon Mar 17 2025 - 03:38:23 EST


On 16/03/2025 21:11, Artur Weber wrote:
> The charge input threshold voltage register on the MAX77693 PMIC accepts
> four values: 0x0 for 4.3v, 0x1 for 4.7v, 0x2 for 4.8v and 0x3 for 4.9v.
> Due to an oversight, the driver calculated the values for 4.7v and above
> starting from 0x0, rather than from 0x1 ([(4700000 - 4700000) / 100000]
> gives 0).
>
> Add 1 to the calculation to ensure that 4.7v is converted to a register
> value of 0x1 and that the other two voltages are converted correctly as
> well.
>
> Fixes: 87c2d9067893 ("power: max77693: Add charger driver for Maxim 77693")
> Signed-off-by: Artur Weber <aweber.kernel@xxxxxxxxx>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>

Best regards,
Krzysztof