linux-stable/drivers/pwm
Uwe Kleine-König 615fd61ca6 pwm: meson: Explicitly set .polarity in .get_state()
[ Upstream commit 8caa81eb95 ]

The driver only supports normal polarity. Complete the implementation of
.get_state() by setting .polarity accordingly.

This fixes a regression that was possible since commit c73a310762
("pwm: Handle .get_state() failures") which stopped to zero-initialize
the state passed to the .get_state() callback. This was reported at
https://forum.odroid.com/viewtopic.php?f=177&t=46360 . While this was an
unintended side effect, the real issue is the driver's callback not
setting the polarity.

There is a complicating fact, that the .apply() callback fakes support
for inversed polarity. This is not (and cannot) be matched by
.get_state(). As fixing this isn't easy, only point it out in a comment
to prevent authors of other drivers from copying that approach.

Fixes: c375bcbaab ("pwm: meson: Read the full hardware state in meson_pwm_get_state()")
Reported-by: Munehisa Kamata <kamatam@amazon.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20230310191405.2606296-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-13 17:02:36 +02:00
..
core.c pwm: Handle .get_state() failures 2022-12-06 12:46:29 +01:00
Kconfig pwm: pxa: Enable for MMP platform 2022-12-06 12:46:15 +01:00
Makefile pwm: Add clock based PWM output driver 2022-07-29 13:41:18 +02:00
pwm-ab8500.c
pwm-atmel-hlcdc.c pwm: atmel-hlcdc: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:49 +02:00
pwm-atmel-tcb.c pwm: atmel-tcb: Fix typo in comment 2022-06-22 15:33:13 +02:00
pwm-atmel.c pwm: Make .get_state() callback return an error code 2022-12-06 12:46:22 +01:00
pwm-bcm-iproc.c pwm: Make .get_state() callback return an error code 2022-12-06 12:46:22 +01:00
pwm-bcm-kona.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 2) 2022-06-10 14:51:35 +02:00
pwm-bcm2835.c
pwm-berlin.c
pwm-brcmstb.c pwm: brcmstb: Remove useless locking 2022-02-24 14:46:24 +01:00
pwm-clk.c pwm: Add clock based PWM output driver 2022-07-29 13:41:18 +02:00
pwm-clps711x.c pwm: clps71xx: Implement .apply() callback 2022-04-22 18:52:30 +02:00
pwm-crc.c pwm: crc: Propagate errors in .get_state() to the caller 2022-12-06 12:46:25 +01:00
pwm-cros-ec.c pwm: cros-ec: Explicitly set .polarity in .get_state() 2023-04-13 17:02:35 +02:00
pwm-dwc.c pwm: Make .get_state() callback return an error code 2022-12-06 12:46:22 +01:00
pwm-ep93xx.c
pwm-fsl-ftm.c pwm: fsl-ftm: Use regmap_clear_bits and regmap_set_bits where applicable 2022-12-06 12:46:08 +01:00
pwm-hibvt.c pwm: hibvt: Explicitly set .polarity in .get_state() 2023-04-13 17:02:35 +02:00
pwm-img.c pwm: img: Use regmap_clear_bits and regmap_set_bits where applicable 2022-12-06 12:46:09 +01:00
pwm-imx-tpm.c pwm: Make .get_state() callback return an error code 2022-12-06 12:46:22 +01:00
pwm-imx1.c pwm: imx1: Implement .apply callback 2022-02-02 17:05:19 +01:00
pwm-imx27.c pwm: imx27: Propagate errors in .get_state() to the caller 2022-12-06 12:46:26 +01:00
pwm-intel-lgm.c pwm: Make .get_state() callback return an error code 2022-12-06 12:46:22 +01:00
pwm-iqs620a.c pwm: iqs620a: Explicitly set .polarity in .get_state() 2023-04-13 17:02:35 +02:00
pwm-jz4740.c pwm: jz4740: Use regmap_{set,clear}_bits 2022-11-29 13:06:47 +01:00
pwm-keembay.c pwm: Make .get_state() callback return an error code 2022-12-06 12:46:22 +01:00
pwm-lp3943.c pwm: lp3943: Implement .apply() callback 2022-04-22 18:43:09 +02:00
pwm-lpc18xx-sct.c pwm: lpc18xx-sct: Fix a comment to match code 2022-12-06 12:46:04 +01:00
pwm-lpc32xx.c pwm: lpc32xx: Implement .apply() callback 2022-05-20 16:29:01 +02:00
pwm-lpss-pci.c pwm: lpss: Rename pwm_lpss_probe() --> devm_pwm_lpss_probe() 2022-11-22 16:36:27 +02:00
pwm-lpss-platform.c pwm: lpss: Rename pwm_lpss_probe() --> devm_pwm_lpss_probe() 2022-11-22 16:36:27 +02:00
pwm-lpss.c pwm: Changes for v6.2-rc1 2022-12-21 09:41:28 -08:00
pwm-lpss.h pwm: lpss: Allow other drivers to enable PWM LPSS 2022-11-22 16:36:27 +02:00
pwm-mediatek.c pwm: mediatek: Add support for MT7986 2022-12-06 12:46:12 +01:00
pwm-meson.c pwm: meson: Explicitly set .polarity in .get_state() 2023-04-13 17:02:36 +02:00
pwm-mtk-disp.c pwm: mtk-disp: Propagate errors in .get_state() to the caller 2022-12-06 12:46:27 +01:00
pwm-mxs.c
pwm-ntxec.c
pwm-omap-dmtimer.c pwm: omap-dmtimer: Don't check the return code of pwmchip_remove() 2021-09-02 21:38:52 +02:00
pwm-pca9685.c pwm: pca9685: Convert to i2c's .probe_new() 2022-12-06 12:46:31 +01:00
pwm-pxa.c pwm: pxa: Add reference manual link and limitations 2022-12-06 12:46:15 +01:00
pwm-raspberrypi-poe.c pwm: Make .get_state() callback return an error code 2022-12-06 12:46:22 +01:00
pwm-rcar.c pwm: rcar: Simplify multiplication/shift logic 2022-02-24 15:14:56 +01:00
pwm-renesas-tpu.c pwm: renesas-tpu: Improve precision of period and duty_cycle calculation 2022-05-20 16:18:40 +02:00
pwm-rockchip.c pwm: rockchip: Propagate errors in .get_state() to the caller 2022-12-06 12:46:28 +01:00
pwm-samsung.c pwm: samsung: Implement .apply() callback 2022-05-20 15:59:34 +02:00
pwm-sifive.c pwm: sifive: Always let the first pwm_apply_state succeed 2023-03-11 13:50:22 +01:00
pwm-sl28cpld.c pwm: Make .get_state() callback return an error code 2022-12-06 12:46:22 +01:00
pwm-spear.c
pwm-sprd.c pwm: sprd: Explicitly set .polarity in .get_state() 2023-04-13 17:02:36 +02:00
pwm-sti.c pwm: sti: Implement .apply() callback 2022-05-20 16:28:18 +02:00
pwm-stm32-lp.c pwm: stm32-lp: fix the check on arr and cmp registers update 2023-03-11 13:50:22 +01:00
pwm-stm32.c pwm: stm32: Use regmap_clear_bits and regmap_set_bits where applicable 2022-12-06 12:46:11 +01:00
pwm-stmpe.c pwm: stmpe: Implement .apply() callback 2022-05-20 16:28:35 +02:00
pwm-sun4i.c pwm: sun4i: Propagate errors in .get_state() to the caller 2022-12-06 12:46:30 +01:00
pwm-sunplus.c pwm: Make .get_state() callback return an error code 2022-12-06 12:46:22 +01:00
pwm-tegra.c pwm: tegra: Fix 32 bit build 2022-11-11 15:03:59 +01:00
pwm-tiecap.c
pwm-tiehrpwm.c pwm: tiehrpwm: Implement .apply() callback 2022-02-24 13:52:59 +01:00
pwm-twl-led.c pwm: twl-led: Document some limitations and link to the reference manual 2022-07-29 13:41:18 +02:00
pwm-twl.c pwm: twl: Implement .apply() callback 2021-11-17 17:12:42 +01:00
pwm-visconti.c pwm: Make .get_state() callback return an error code 2022-12-06 12:46:22 +01:00
pwm-vt8500.c pwm: vt8500: Rename variable pointing to driver private data 2022-02-24 14:35:20 +01:00
pwm-xilinx.c pwm: Make .get_state() callback return an error code 2022-12-06 12:46:22 +01:00
sysfs.c pwm: sysfs: Replace sprintf() with sysfs_emit() 2022-09-28 17:52:02 +02:00