pwm: lpss: Rework the sequence of programming PWM_SW_UPDATE
commit37670676a122a38e72ecd9dac0feff2a3dac967f
authorMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 18 Nov 2015 11:25:18 +0000 (18 13:25 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 16 Dec 2015 15:52:09 +0000 (16 16:52 +0100)
tree17902c0f618967159895e75b2d3b3b609f30a5ac
parent6f90a00c6667dce5651341f0629443cf7951b235
pwm: lpss: Rework the sequence of programming PWM_SW_UPDATE

Setting of PWM_SW_UPDATE is bit different in Intel Broxton compared to the
previous generation SoCs. Previously it was OK to set the bit many times
(from userspace via sysfs for example) before the PWM is actually enabled.

Starting from Intel Broxton it seems that we must set PWM_SW_UPDATE only
once before the PWM is enabled. Otherwise it is possible that the PWM does
not start properly.

Change the sequence of how PWM_SW_UPDATE is programmed so that we only set
it in pwm_lpss_config() when the PWM is already enabled. The initial
setting of PWM_SW_UPDATE will be done when PWM gets enabled. This should
make the driver work with the previous generation Intel SoCs and Broxton.

Add also small delay after the bit is set to let the hardware propagate it
properly.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-lpss.c