1. 03 Jul, 2018 1 commit
    • Hans de Goede's avatar
      pwm: lpss: platform: Save/restore the ctrl register over a suspend/resume · 3c718460
      Hans de Goede authored
      commit 1d375b58 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>
      3c718460
  2. 06 Apr, 2017 1 commit
  3. 30 Jan, 2017 5 commits
  4. 11 Jul, 2016 3 commits
  5. 16 Dec, 2015 3 commits
  6. 06 Nov, 2015 3 commits
  7. 25 Aug, 2014 1 commit
  8. 22 Aug, 2014 3 commits
  9. 07 Aug, 2014 1 commit
  10. 07 May, 2014 1 commit
    • Thierry Reding's avatar
      pwm: lpss: Fix const qualifier and sparse warnings · 89c0339e
      Thierry Reding authored
      Fixes the following warnings reported by the 0-DAY kernel build testing
      backend:
      
         drivers/pwm/pwm-lpss.c: In function 'pwm_lpss_probe_pci':
      >> drivers/pwm/pwm-lpss.c:192:2: warning: passing argument 3 of 'pwm_lpss_probe' discards 'const' qualifier from pointer target type [enabled by default]
           lpwm = pwm_lpss_probe(&pdev->dev, &pdev->resource[0], info);
           ^
         drivers/pwm/pwm-lpss.c:130:30: note: expected 'struct pwm_lpss_boardinfo *' but argument is of type 'const struct pwm_lpss_boardinfo *'
          static struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev,
                                       ^
      >> drivers/pwm/pwm-lpss.c:143:28: sparse: incorrect type in return expression (different address spaces)
         drivers/pwm/pwm-lpss.c:143:28:    expected struct pwm_lpss_chip *
         drivers/pwm/pwm-lpss.c:143:28:    got void [noderef] <asn:2>*regs
      >> drivers/pwm/pwm-lpss.c:192:63: sparse: incorrect type in argument 3 (different modifiers)
         drivers/pwm/pwm-lpss.c:192:63:    expected struct pwm_lpss_boardinfo *info
         drivers/pwm/pwm-lpss.c:192:63:    got struct pwm_lpss_boardinfo const *[assigned] info
         drivers/pwm/pwm-lpss.c: In function 'pwm_lpss_probe_pci':
         drivers/pwm/pwm-lpss.c:192:2: warning: passing argument 3 of 'pwm_lpss_probe' discards 'const' qualifier from pointer target type [enabled by default]
           lpwm = pwm_lpss_probe(&pdev->dev, &pdev->resource[0], info);
           ^
         drivers/pwm/pwm-lpss.c:130:30: note: expected 'struct pwm_lpss_boardinfo *' but argument is of type 'const struct pwm_lpss_boardinfo *'
          static struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev,
                                       ^
      Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      89c0339e
  11. 28 Apr, 2014 1 commit
  12. 01 Apr, 2014 1 commit