UPSTREAM: regulator: pwm: Fix calculation of voltage-to-duty cycle
With following equation for calculating
voltage_to_duty_cycle_percentage
100 - (((req_uV * 100) - (min_uV * 100)) / diff);
we get 0% for max_uV and 100% for min_uV.
Correcting this to
((req_uV * 100) - (min_uV * 100)) / diff;
to get proper duty cycle.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
1aaab34878ac14efede3f0e737b99447745699d1)
Change-Id: I61d88577ece2d7bec3e9ea6c863c101c65892271
Signed-off-by: David Wu <david.wu@rock-chips.com>