1. 25 Jul, 2017 1 commit
  2. 13 Apr, 2017 1 commit
  3. 20 Jan, 2017 1 commit
  4. 18 Jan, 2017 1 commit
  5. 04 Jan, 2017 1 commit
  6. 06 Nov, 2015 1 commit
  7. 17 Aug, 2015 3 commits
    • Clemens Gruber's avatar
      pwm-pca9685: Support changing the output frequency · 01ec8472
      Clemens Gruber authored
      Previously, period_ns and duty_ns were only used to determine the
      ratio of ON and OFF time, the default frequency of 200 Hz was never
      changed.
      The PCA9685 however is capable of changing the PWM output frequency,
      which is expected when changing the period.
      
      This patch configures the prescaler accordingly, using the formula
      and notes provided in the PCA9685 datasheet.
      Bounds checking for the minimum and maximum frequencies, last updated
      in revision v.4 of said datasheet, is also added.
      
      The prescaler is only touched if the period changed, because we have to
      put the chip into sleep mode to unlock the prescale register.
      If it is changed, the PWM output frequency changes for all outputs,
      because there is one prescaler per chip. This is documented in the
      PCA9685 datasheet and in the comments.
      
      If the duty cycle is not changed at the same time as the period, then
      we restart the PWM output using the duty cycle to period ratio from
      before the period change.
      When using LEDs for example, previously set brightness levels stay the
      same when the frequency changes.
      
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
      Signed-off-by: default avatarClemens Gruber <clemens.gruber@pqgruber.com>
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      01ec8472
    • Clemens Gruber's avatar
      pwm-pca9685: Fix several driver bugs · 4a627b52
      Clemens Gruber authored
      Problems:
      - When duty_ns == period_ns, the full OFF bit was not cleared and the
        PWM output of the PCA9685 stayed off.
      - When duty_ns == period_ns and the catch-all channel was used, the
        ALL_LED_OFF_L register was not cleared.
      - The full ON bit was not cleared when setting the OFF time, therefore
        the exact OFF time was ignored when setting a duty_ns < period_ns
      
      Solution: Clear both OFF registers when setting full ON and clear the
      full ON bit when changing the OFF registers.
      
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
      Signed-off-by: default avatarClemens Gruber <clemens.gruber@pqgruber.com>
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      4a627b52
    • Krzysztof Kozlowski's avatar
      pwm: pca9685: Drop owner assignment · 09c14459
      Krzysztof Kozlowski authored
      i2c_driver does not need to set an owner because i2c_register_driver()
      will set it.
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      09c14459
  8. 11 Mar, 2015 1 commit
  9. 26 Jun, 2013 1 commit
  10. 12 Jun, 2013 2 commits