• Hans de Goede's avatar
    pwm: lpss: Only set update bit if we are actually changing the settings · 2153bbc1
    Hans de Goede authored
    According to the datasheet the update bit must be set if the on-time-div
    or the base-unit changes.
    
    Now that we properly order device resume on Cherry Trail so that the GFX0
    _PS0 method no longer exits with an error, we end up with a sequence of
    events where we are writing the same values twice in a row.
    
    First the _PS0 method restores the duty cycle of 0% the GPU driver set
    on suspend and then the GPU driver first updates just the enabled bit in
    the pwm_state from 0 to 1, causing us to write the same values again,
    before restoring the pre-suspend duty-cycle in a separate pwm_apply call.
    
    When writing the update bit the second time, without changing any of
    the values the update bit clears immediately / instantly, instead of
    staying 1 for a while as usual. After this the next setting of the update
    bit seems to be ignored, causing the restoring of the pre-suspend
    duty-cycle to not get applied. This makes the backlight come up with
    a 0% dutycycle after suspend/resume.
    
    Any further brightness changes after this do work.
    
    This commit moves the setting of the update bit into pwm_lpss_prepare()
    and only sets the bit if we have actually changed any of the values.
    
    This avoids the setting of the update bit the second time we configure
    the PWM to 0% dutycycle, this fixes the backlight coming up with 0%
    duty-cycle after a suspend/resume.
    Signed-off-by: 's avatarHans de Goede <hdegoede@redhat.com>
    Signed-off-by: 's avatarThierry Reding <thierry.reding@gmail.com>
    2153bbc1
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
core.c Loading commit data...
pwm-ab8500.c Loading commit data...
pwm-atmel-hlcdc.c Loading commit data...
pwm-atmel-tcb.c Loading commit data...
pwm-atmel.c Loading commit data...
pwm-bcm-iproc.c Loading commit data...
pwm-bcm-kona.c Loading commit data...
pwm-bcm2835.c Loading commit data...
pwm-berlin.c Loading commit data...
pwm-brcmstb.c Loading commit data...
pwm-clps711x.c Loading commit data...
pwm-crc.c Loading commit data...
pwm-cros-ec.c Loading commit data...
pwm-ep93xx.c Loading commit data...
pwm-fsl-ftm.c Loading commit data...
pwm-hibvt.c Loading commit data...
pwm-img.c Loading commit data...
pwm-imx.c Loading commit data...
pwm-jz4740.c Loading commit data...
pwm-lp3943.c Loading commit data...
pwm-lpc18xx-sct.c Loading commit data...
pwm-lpc32xx.c Loading commit data...
pwm-lpss-pci.c Loading commit data...
pwm-lpss-platform.c Loading commit data...
pwm-lpss.c Loading commit data...
pwm-lpss.h Loading commit data...
pwm-mediatek.c Loading commit data...
pwm-meson.c Loading commit data...
pwm-mtk-disp.c Loading commit data...
pwm-mxs.c Loading commit data...
pwm-omap-dmtimer.c Loading commit data...
pwm-pca9685.c Loading commit data...
pwm-puv3.c Loading commit data...
pwm-pxa.c Loading commit data...
pwm-rcar.c Loading commit data...
pwm-renesas-tpu.c Loading commit data...
pwm-rockchip.c Loading commit data...
pwm-samsung.c Loading commit data...
pwm-spear.c Loading commit data...
pwm-sti.c Loading commit data...
pwm-stm32-lp.c Loading commit data...
pwm-stm32.c Loading commit data...
pwm-stmpe.c Loading commit data...
pwm-sun4i.c Loading commit data...
pwm-tegra.c Loading commit data...
pwm-tiecap.c Loading commit data...
pwm-tiehrpwm.c Loading commit data...
pwm-tipwmss.c Loading commit data...
pwm-twl-led.c Loading commit data...
pwm-twl.c Loading commit data...
pwm-vt8500.c Loading commit data...
pwm-zx.c Loading commit data...
sysfs.c Loading commit data...