03 Jul, 2018

1 commit

  • 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: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Thierry Reding
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     

06 Apr, 2017

1 commit

  • At least on cherrytrail, the update bit will never go low when the
    enabled bit is not set.

    This causes the backlight on my cube iwork8 air tablet to never turn on
    again after being turned off because in the pwm_lpss_apply enable path
    pwm_lpss_update will fail causing an error exit and the enable-bit to
    never get set. Any following pwm_lpss_apply calls will fail the
    pwm_lpss_is_updating check.

    Since the docs say that the update bit should be set before the
    enable-bit, split pwm_lpss_update into setting the update-bit and
    pwm_lpss_wait_for_update, and move the pwm_lpss_wait_for_update call
    in the enable path to after setting the enable-bit.

    Fixes: 10d56a4 ("pwm: lpss: Avoid reconfiguring while UPDATE bit...")
    Cc: Ilkka Koskinen
    Signed-off-by: Hans de Goede
    Signed-off-by: Andy Shevchenko
    Tested-by: Hans de Goede
    Signed-off-by: Thierry Reding

    Hans de Goede
     

30 Jan, 2017

1 commit

  • The PWM LPSS probe drivers just pass a pointer to the exported board
    info structures to pwm_lpss_probe() based on device PCI or ACPI ID.

    In order to remove the knowledge of specific devices from library part of
    the driver and reduce noise in exported namespace just duplicate the
    board info structures and stop exporting them.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Thierry Reding

    Andy Shevchenko
     

06 Nov, 2015

2 commits


23 Aug, 2014

1 commit

  • The driver consists of core, PCI, and platform parts. It would be better
    to split them into separate files.

    The platform driver is now called pwm-lpss-platform. Thus, previously
    set CONFIG_PWM_LPSS=m is not enough to build it. But we are on the safe
    side since it seems no one from outside Intel is using it for now.

    While here, move to use macros module_pci_driver() and
    module_platform_driver().

    Signed-off-by: Andy Shevchenko
    Reviewed-by: Mika Westerberg
    Acked-by: Alan Cox
    [thierry.reding: change select to depends on PWM_LPSS, cleanup]
    Signed-off-by: Thierry Reding

    Andy Shevchenko