pwm: Fix pwm_apply_args()
Commit 5ec803ed ("pwm: Add core infrastructure to allow atomic updates"), implemented pwm_disable() as a wrapper around pwm_apply_state(), and then, commit ef2bf499 ("pwm: Improve args checking in pwm_apply_state()") added missing checks on the ->period value in pwm_apply_state() to ensure we were not passing inappropriate values to the ->config() or ->apply() methods. The conjunction of these 2 commits led to a case where pwm_disable() was no longer succeeding, thus preventing the polarity setting done in pwm_apply_args(). Set a valid period in pwm_apply_args() to ensure polarity setting won't be rejected. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org> Suggested-by: NBrian Norris <briannorris@chromium.org> Fixes: 5ec803ed ("pwm: Add core infrastructure to allow atomic updates") Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: NBrian Norris <briannorris@chromium.org> Signed-off-by: NThierry Reding <thierry.reding@gmail.com>
Showing
想要评论请 注册 或 登录