backlight: pwm_bl: Switch to using "atomic" PWM API
authorEnric Balletbo i Serra <enric.balletbo@collabora.com>
Tue, 14 Aug 2018 16:50:59 +0000 (18:50 +0200)
committerLee Jones <lee.jones@linaro.org>
Tue, 9 Oct 2018 09:58:42 +0000 (02:58 -0700)
commite6bcca0890b96a3c2c5e72169de72ba4d2b01b78
tree4773454f176ecf3c97fdb8679a5cb8b0d09a7f67
parent0b193400b3f2b7af446f5a624f8af51b34d6f5d1
backlight: pwm_bl: Switch to using "atomic" PWM API

The "atomic" API allows us to configure PWM period and duty_cycle and
enable it in one call.

The patch also moves the pwm_init_state just before any use of the
pwm_state struct, this fixes a potential bug where pwm_get_state
can be called before pwm_init_state.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/video/backlight/pwm_bl.c