linux/drivers/pwm
Uwe Kleine-König 2d6812b41e pwm: sti: Reduce number of allocations and drop usage of chip_data
Instead of using one allocation per capture channel, use a single one. Also
store it in driver data instead of chip data.

This has several advantages:

 - driver data isn't cleared when pwm_put() is called
 - Reduces memory fragmentation

Also register the pwm chip only after the per capture channel data is
initialized as the capture callback relies on this initialization and it
might be called even before pwmchip_add() returns.

It would be still better to have struct sti_pwm_compat_data and the
per-channel data struct sti_cpt_ddata in a single memory chunk, but that's
not easily possible because the number of capture channels isn't known yet
when the driver data struct is allocated.

Fixes: e926b12c61 ("pwm: Clear chip_data in pwm_put()")
Reported-by: George Stark <gnstark@sberdevices.ru>
Fixes: c97267ae83 ("pwm: sti: Add PWM capture callback")
Link: https://lore.kernel.org/r/20230705080650.2353391-7-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>
2023-10-13 10:07:17 +02:00
..
core.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
Kconfig pwm: crc: Allow compilation as module and with COMPILE_TEST 2023-10-13 10:07:17 +02:00
Makefile pwm: Add Renesas RZ/G2L MTU3a PWM driver 2023-06-23 15:46:29 +02:00
pwm-ab8500.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-apple.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-atmel-hlcdc.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-atmel-tcb.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-atmel.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-bcm2835.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-bcm-iproc.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-bcm-kona.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-berlin.c pwm: berlin: Put per-channel config into driver data 2023-10-13 10:07:17 +02:00
pwm-brcmstb.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-clk.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-clps711x.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-crc.c pwm: crc: Allow compilation as module and with COMPILE_TEST 2023-10-13 10:07:17 +02:00
pwm-cros-ec.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-dwc.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-ep93xx.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-fsl-ftm.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-hibvt.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-img.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-imx1.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-imx27.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-imx-tpm.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-intel-lgm.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-iqs620a.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-jz4740.c pwm: jz4740: Put per-channel clk into driver data 2023-10-13 10:07:17 +02:00
pwm-keembay.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-lp3943.c pwm: lp3943: Drop usage of pwm_[gs]et_chip_data() 2023-10-13 10:07:17 +02:00
pwm-lpc18xx-sct.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-lpc32xx.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +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-platform: Convert to platform remove callback returning void 2023-03-30 16:26:32 +02:00
pwm-lpss.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02: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: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-meson.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-microchip-core.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-mtk-disp.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-mxs.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-ntxec.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-omap-dmtimer.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-pca9685.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-pxa.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-raspberrypi-poe.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-rcar.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-renesas-tpu.c pwm: renesas: Drop usage of pwm_[gs]et_chip_data() 2023-10-13 10:07:17 +02:00
pwm-rockchip.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-rz-mtu3.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-samsung.c pwm: samsung: Put per-channel data into driver data 2023-10-13 10:07:17 +02:00
pwm-sifive.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-sl28cpld.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-spear.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-sprd.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-sti.c pwm: sti: Reduce number of allocations and drop usage of chip_data 2023-10-13 10:07:17 +02:00
pwm-stm32-lp.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-stm32.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-stmpe.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-sun4i.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-sunplus.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-tegra.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-tiecap.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-tiehrpwm.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-twl-led.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-twl.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-visconti.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-vt8500.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
pwm-xilinx.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
sysfs.c pwm: sysfs: Do not apply state to already disabled PWMs 2023-06-23 15:42:58 +02:00