1. 09 Sep, 2018 1 commit
    • Vignesh R's avatar
      pwm: tiehrpwm: Fix disabling of output of PWMs · 8001317c
      Vignesh R authored
      commit 38dabd91ff0bde33352ca3cc65ef515599b77a05 upstream.
      
      pwm-tiehrpwm driver disables PWM output by putting it in low output
      state via active AQCSFRC register in ehrpwm_pwm_disable(). But, the
      AQCSFRC shadow register is not updated. Therefore, when shadow AQCSFRC
      register is re-enabled in ehrpwm_pwm_enable() (say to enable second PWM
      output), previous settings are lost as shadow register value is loaded
      into active register. This results in things like PWMA getting enabled
      automatically, when PWMB is enabled and vice versa. Fix this by
      updating AQCSFRC shadow register as well during ehrpwm_pwm_disable().
      
      Fixes: 19891b20 ("pwm: pwm-tiehrpwm: PWM driver support for EHRPWM")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarVignesh R <vigneshr@ti.com>
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8001317c
  2. 03 Jul, 2018 1 commit
    • Hans de Goede's avatar
      pwm: lpss: platform: Save/restore the ctrl register over a suspend/resume · 037aca0e
      Hans de Goede authored
      commit 1d375b58c12f08d8570b30b865def4734517f04f upstream.
      
      On some devices the contents of the ctrl register get lost over a
      suspend/resume and the PWM comes back up disabled after the resume.
      
      This is seen on some Bay Trail devices with the PWM in ACPI enumerated
      mode, so it shows up as a platform device instead of a PCI device.
      
      If we still think it is enabled and then try to change the duty-cycle
      after this, we end up with a "PWM_SW_UPDATE was not cleared" error and
      the PWM is stuck in that state from then on.
      
      This commit adds suspend and resume pm callbacks to the pwm-lpss-platform
      code, which save/restore the ctrl register over a suspend/resume, fixing
      this.
      
      Note that:
      
      1) There is no need to do this over a runtime suspend, since we
      only runtime suspend when disabled and then we properly set the enable
      bit and reprogram the timings when we re-enable the PWM.
      
      2) This may be happening on more systems then we realize, but has been
      covered up sofar by a bug in the acpi-lpss.c code which was save/restoring
      the regular device registers instead of the lpss private registers due to
      lpss_device_desc.prv_offset not being set. This is fixed by a later patch
      in this series.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      037aca0e
  3. 24 Apr, 2018 1 commit
  4. 22 Mar, 2018 2 commits
  5. 21 Apr, 2017 1 commit
  6. 15 Mar, 2017 1 commit
  7. 29 Nov, 2016 1 commit
  8. 21 Oct, 2016 1 commit
  9. 08 Sep, 2016 14 commits
  10. 06 Sep, 2016 5 commits
  11. 05 Sep, 2016 2 commits
    • David Hsu's avatar
      pwm: Unexport children before chip removal · 0733424c
      David Hsu authored
      Exported pwm channels aren't removed before the pwmchip and are
      leaked. This results in invalid sysfs files. This fix removes
      all exported pwm channels before chip removal.
      Signed-off-by: default avatarDavid Hsu <davidhsu@google.com>
      Fixes: 76abbdde ("pwm: Add sysfs interface")
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      0733424c
    • Paul Kocialkowski's avatar
      pwm: twl: Reliably disable TWL6030 PWMs · 45c0ce84
      Paul Kocialkowski authored
      The current TWL6030 code for the TWL PWM driver does not reliably disable the
      PWM output, as tested with LEDs. The previous commit to that driver introduced
      that regression.
      
      However, it does make sense to disable the PWM clock after resetting the PWM,
      but for some obscure reason, doing it all at once simply doesn't work.
      
      The TWL6030 datasheet mentions that PWMs have to be disabled in two distinct
      steps. However, clearing the clock enable bit in a second step (after issuing a
      reset first) does not work.
      
      The only approach that works is the one that was in place before the previous
      commit to the driver. It consists in enabling the PWM clock after issuing a
      reset. This is what TI kernel trees and production code seem to be using.
      
      However, adding an extra step to disable the PWM clock seems to work reliably,
      despite looking quite odd.
      Signed-off-by: default avatarPaul Kocialkowski <contact@paulk.fr>
      Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      45c0ce84
  12. 25 Jul, 2016 1 commit
    • Brian Norris's avatar
      pwm: Add ChromeOS EC PWM driver · 1f0d3bb0
      Brian Norris authored
      Use the new ChromeOS EC EC_CMD_PWM_{GET,SET}_DUTY commands to control
      one or more PWMs attached to the Embedded Controller. Because the EC
      allows us to modify the duty cycle (as a percentage, where U16_MAX is
      100%) but not the period, we assign the period a fixed value of
      EC_PWM_MAX_DUTY and reject all attempts to change it.
      
      This driver supports only device tree at the moment, because that
      provides a very flexible way of describing the relationship between PWMs
      and their consumer devices (e.g., backlight). On a non-DT system, we'll
      probably want to use the non-GENERIC addressing (i.e., we'll need to
      make special device instances that will use EC_PWM_TYPE_KB_LIGHT or
      EC_PWM_TYPE_DISPLAY_LIGHT), as well as the relatively inflexible
      pwm_lookup infrastructure for matching devices. Defer that work for now.
      Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      1f0d3bb0
  13. 11 Jul, 2016 9 commits