• Clemens Gruber's avatar
    pwm: pca9685: Switch to atomic API · 9af1fba3
    Clemens Gruber authored
    
    
    The switch to the atomic API goes hand in hand with a few fixes to
    previously experienced issues:
    - The duty cycle is no longer lost after disable/enable (previously the
      OFF registers were cleared in disable and the user was required to
      call config to restore the duty cycle settings)
    - If one sets a period resulting in the same prescale register value,
      the sleep and write to the register is now skipped
    - Previously, only the full ON bit was toggled in GPIO mode (and full
      OFF cleared if set to high), which could result in both full OFF and
      full ON not being set and on=0, off=0, which is not allowed according
      to the datasheet
    - The OFF registers were reset to 0 in probe, which could lead to the
      forbidden on=0, off=0. Fixed by resetting to POR default (full OFF)
    Signed-off-by: default avatarClemens Gruber <clemens.gruber@pqgruber.com>
    Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
    9af1fba3
pwm-pca9685.c 13.3 KB