aboutsummaryrefslogtreecommitdiff
path: root/drivers/pwm/pwm-dwc.c
AgeCommit message (Collapse)AuthorFilesLines
2023-02-20pwm: dwc: Use devm_pwmchip_add()Ben Dooks1-5/+1
Add the PWM chip using devm_pwmchip_add() to avoid having to manually remove it. This is useful for subsequent patches adding platform device support. Signed-off-by: Ben Dooks <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2023-02-20pwm: dwc: Move memory allocation to own functionBen Dooks1-7/+17
In preparation for adding other bus support, move the allocation of the PWM structure out of the main driver code. Signed-off-by: Ben Dooks <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2023-02-20pwm: dwc: Change &pci->dev to dev in probeBen Dooks1-6/+4
The dwc_pwm_probe() assigns dev to be &pci->dev but then uses &pci->dev throughout the function. Change these all to the 'dev' variable to make lines shorter. Signed-off-by: Ben Dooks <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2022-12-06pwm: Make .get_state() callback return an error codeUwe Kleine-König1-2/+4
.get_state() might fail in some cases. To make it possible that a driver signals such a failure change the prototype of .get_state() to return an error code. This patch was created using coccinelle and the following semantic patch: @p1@ identifier getstatefunc; identifier driver; @@ struct pwm_ops driver = { ..., .get_state = getstatefunc ,... }; @p2@ identifier p1.getstatefunc; identifier chip, pwm, state; @@ -void +int getstatefunc(struct pwm_chip *chip, struct pwm_device *pwm, struct pwm_state *state) { ... - return; + return 0; ... } plus the actual change of the prototype in include/linux/pwm.h (plus some manual fixing of indentions and empty lines). So for now all drivers return success unconditionally. They are adapted in the following patches to make the changes easier reviewable. Reviewed-by: Heiko Stuebner <[email protected]> Reviewed-by: Baolin Wang <[email protected]> Reviewed-by: Tzung-Bi Shih <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Reviewed-by: Nobuhiro Iwamatsu <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Reviewed-by: Dave Stevenson <[email protected]> Acked-by: Douglas Anderson <[email protected]> Acked-by: Jernej Skrabec <[email protected]> Acked-by: Pavel Machek <[email protected]> Acked-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2021-03-22pwm: Always allocate PWM chip base ID dynamicallyUwe Kleine-König1-1/+0
Since commit 5e5da1e9fbee ("pwm: ab8500: Explicitly allocate pwm chip base dynamically") all drivers use dynamic ID allocation explicitly. New drivers are supposed to do the same, so remove support for driver specified base IDs and drop all assignments in the low-level drivers. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: Add DesignWare PWM Controller DriverJarkko Nikula1-0/+319
Introduce driver for Synopsys DesignWare PWM Controller used on Intel Elkhart Lake. Initial implementation is done by Felipe Balbi while he was working at Intel with later changes from Raymond Tan and me. Co-developed-by: Felipe Balbi (Intel) <[email protected]> Signed-off-by: Felipe Balbi (Intel) <[email protected]> Co-developed-by: Raymond Tan <[email protected]> Signed-off-by: Raymond Tan <[email protected]> Signed-off-by: Jarkko Nikula <[email protected]> Signed-off-by: Thierry Reding <[email protected]>