regulator: pwm: Switch to the atomic PWM API
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Tue, 14 Jun 2016 09:13:18 +0000 (11:13 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Mon, 11 Jul 2016 06:43:21 +0000 (08:43 +0200)
commit3f4eb39be9b1402ea01a5c67441d0b0bcb74b4b2
tree45f961742b2ef54d9c1e7dcc4c5119519e51e1ba
parentfd4f99c4c3ce8ccd9b8ea751afc614a7624ecef2
regulator: pwm: Switch to the atomic PWM API

Use the atomic API wherever appropriate and get rid of pwm_apply_args()
call (the reference period and polarity are now explicitly set when
calling pwm_apply_state()).

We also make use of the pwm_set_relative_duty_cycle() helper to ease
relative to absolute duty_cycle conversion.

Note that changes introduced by commit fd786fb0276a ("regulator: pwm:
Try to avoid voltage error in duty cycle calculation") are no longer
needed because pwm_set_relative_duty_cycle() takes care of all rounding
approximation for us.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/regulator/pwm-regulator.c