Re: [PATCH 2/7] hwmon: (max31790) Report correct current pwm duty cycles

Jan Kundrát
2021-06-02T12:36:51Z

On středa 26. května 2021 17:40:17 CEST, Guenter Roeck wrote:
> The MAX31790 has two sets of registers for pwm duty cycles, one to request
> a duty cycle and one to read the actual current duty cycle. Both do not
> have to be the same.
>
> When reporting the pwm duty cycle to the user, the actual pwm duty cycle
> from pwm duty cycle registers needs to be reported. When setting it, the
> pwm target duty cycle needs to be written. Since we don't know the actual
> pwm duty cycle after a target pwm duty cycle has been written, set the
> valid flag to false to indicate that actual pwm duty cycle should be read
> from the chip instead of using cached values.
>
> Cc: Jan Kundrát <jan.kundrat@cesnet.cz>
> Cc: Václav Kubernát <kubernat@cesnet.cz>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>

Cheers,
Jan