]> git.baikalelectronics.ru Git - kernel.git/commit
pwm: lpss: Force runtime-resume on suspend on Cherry Trail
authorHans de Goede <hdegoede@redhat.com>
Sun, 14 Oct 2018 15:12:01 +0000 (17:12 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 16 Oct 2018 11:15:57 +0000 (13:15 +0200)
commit6640c6fbb81b82a1ccd9ff7204ae35949f71e650
treecbd5ae9381fd5b93e5e017a2ae417a206873e359
parentc1d9336c94a3da0eced17b3c71f69e05f7da19a5
pwm: lpss: Force runtime-resume on suspend on Cherry Trail

On Cherry Trail devices under Windows the PWM controller used for the
backlight is considered part of the GPU even though it is part of the LPSS
block and thus is an entirely different independent hardware unit.

Because of this on Cherry Trail the GPU's (GFX0 ACPI node) _PS3 and _PS0
methods save and restore the PWM controller registers.

If userspace blanks the screen before suspending, such as e.g. GNOME
does, then the PWM controller will be runtime-suspended when the suspend
starts. This causes the GFX0 _PS? methods to save a value of 0xffffffff
for the PWM control register and to restore this value on resume.

0xffffffff is not a valid value for the register and writing this causes
problems such as e.g. a flickering backlight.

This commit adds a prepare method to the dev_pm_ops and makes it return 0
on Cherry Trail devices forcing a runtime-resume before other device's
suspend methods run. This fixes the reading and writing back of 0xffffffff.

Since we now always runtime-resume the device on suspend, it will be
resumed on resume too and we no longer need to check for the GFX0 _PS0
method having resumed it underneath us, so this commit removes the now no
longer necessary complete dev_pm_op.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-lpss-platform.c
drivers/pwm/pwm-lpss.h