linux/drivers/pwm
Sjoerd Simons 4a1c683c98 pwm: samsung: Fix output race on disabling
When disabling the Samsung PWM the output state remains at the level it
was at the end of a PWM cycle. In other words, calling pwm_disable()
when at 100% duty cycle will keep the output active, while at all other
settings the output will go/stay inactive. On top of that the Samsung
PWM settings are double-buffered, which means the new settings only get
applied at the start of a new PWM cycle.

This results in a race if the PWM is at 100% duty cycle and a driver
calls:

  pwm_config(pwm, 0, period);
  pwm_disable(pwm);

In this case the PWMs output will unexpectedly stay active, unless a new
PWM cycle happened to start between the register writes in pwm_config()
and pwm_disable(). As far as I can tell this is a regression introduced
by 3bdf878, before that a call to pwm_config() would call
pwm_samsung_enable() which, while heavy-handed, made sure the expected
settings were live.

To resolve this, while not re-introducing the issues 3bdf878 (flickering
as the PWM got reset while in a PWM cycle) fixed, only force an update
of the settings when at 100% duty cycle, which shouldn't have any
noticeable effect on the output but is enough to ensure the behaviour is
as expected on disable.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2015-03-27 13:06:47 +01:00
..
core.c pwm: Remove unnecessary check before of_node_put() 2015-02-03 12:56:54 +01:00
Kconfig pwm: Imagination Technologies PWM DAC driver 2015-01-30 12:16:04 +01:00
Makefile pwm: Imagination Technologies PWM DAC driver 2015-01-30 12:16:04 +01:00
pwm-ab8500.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
pwm-atmel-hlcdc.c pwm: atmel-hlcdc: Add errata handling for sama5d4 2015-03-11 11:59:54 +01:00
pwm-atmel-tcb.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
pwm-atmel.c pwm: atmel: Fix calculation of prescale value 2014-09-25 08:52:39 +02:00
pwm-bcm2835.c pwm: Add BCM2835 PWM driver 2014-11-17 12:20:13 +01:00
pwm-bcm-kona.c pwm: kona: Introduce Kona PWM controller support 2014-04-28 13:07:44 +02:00
pwm-bfin.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
pwm-clps711x.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
pwm-ep93xx.c pwm: ep93xx: split module author names 2013-12-20 10:53:50 +01:00
pwm-fsl-ftm.c pwm: ftm: Add Power Management support for FTM PWM 2014-12-01 10:48:54 +01:00
pwm-img.c pwm: Imagination Technologies PWM DAC driver 2015-01-30 12:16:04 +01:00
pwm-imx.c Merge branch 'platform/remove_owner' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux into driver-core-next 2014-11-03 19:53:56 -08:00
pwm-jz4740.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
pwm-lp3943.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
pwm-lpc32xx.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
pwm-lpss-pci.c pwm: lpss: pci: Move to use pcim_enable_device() 2014-08-23 00:25:51 +02:00
pwm-lpss-platform.c pwm: lpss: Properly split driver to parts 2014-08-23 00:25:47 +02:00
pwm-lpss.c pwm: lpss: use c99 initializers in structures 2014-08-25 11:45:34 +02:00
pwm-lpss.h pwm: lpss: Properly split driver to parts 2014-08-23 00:25:47 +02:00
pwm-mxs.c pwm: mxs: Fix period divider computation 2015-03-11 13:11:16 +01:00
pwm-pca9685.c pwm: pca9685: Constify struct regmap_config 2015-03-11 10:25:13 +01:00
pwm-puv3.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
pwm-pxa.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
pwm-renesas-tpu.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
pwm-rockchip.c pwm: rockchip: Allow polarity invert on rk3288 2014-08-26 10:44:08 +02:00
pwm-samsung.c pwm: samsung: Fix output race on disabling 2015-03-27 13:06:47 +01:00
pwm-spear.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
pwm-sti.c pwm: sti: Maintain a bitmap of configured devices 2015-01-30 12:16:03 +01:00
pwm-sun4i.c pwm: Add Allwinner SoC support 2015-01-30 12:16:01 +01:00
pwm-tegra.c pwm: tegra: Use NSEC_PER_SEC 2015-02-18 08:40:29 +01:00
pwm-tiecap.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
pwm-tiehrpwm.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
pwm-tipwmss.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
pwm-tipwmss.h pwm: davinci: Add Kconfig support for ECAP & EHRPWM devices 2013-03-22 11:35:20 +01:00
pwm-twl-led.c pwm: twl-led: Include linux/of.h header 2013-10-08 15:45:44 +02:00
pwm-twl.c pwm: twl: Really disable twl6030 PWMs 2014-05-08 23:41:47 +02:00
pwm-vt8500.c pwm: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
sysfs.c pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro 2013-12-04 11:35:28 +01:00