pwm: rcar: Add support "atomic" API
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Wed, 9 Jan 2019 08:19:05 +0000 (17:19 +0900)
committerThierry Reding <thierry.reding@gmail.com>
Mon, 4 Mar 2019 11:14:05 +0000 (12:14 +0100)
commit7f68ce8287d3b25a70455aec18ff678a908d49ee
tree0cb52f72f3a27a736137a0b8578f0bd05b793d01
parent74d0c3b2050927f364e3320091f234c108bd845d
pwm: rcar: Add support "atomic" API

This patch adds support for "atomic" API. This behavior differs with
legacy APIs a little.

 Legacy APIs:
  The PWMCNT register will be updated in rcar_pwm_config() even if
  the PWM state is disabled.

 Atomic API:
  The PWMCNT register will be updated in rcar_pwm_apply() only if
  the PWM state is enabled. Otherwize, if a PWM runs with 30% duty
  cycles and the pwm_apply_state() is called with state->enabled = 0,
  ->duty_cycle = 60 and ->period = 100, this is possible to output
  a 60% duty cycle.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-rcar.c