aboutsummaryrefslogtreecommitdiff
path: root/drivers/pwm
AgeCommit message (Collapse)AuthorFilesLines
2020-12-17pwm: Fix dependencies on HAS_IOMEMUwe Kleine-König1-7/+28
Drivers making use of IO remapping must depend on HAS_IOMEM. Reported-by: kernel test robot <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: Use -EINVAL for unsupported polarityThierry Reding3-3/+3
Instead of using a mix of -EOPNOTSUPP and -ENOTSUPP, use the more standard -EINVAL to signal that the specified polarity value was invalid. Acked-by: Uwe Kleine-König <[email protected]> Acked-by: Lee Jones <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: sti: Remove unnecessary blank lineThierry Reding1-1/+0
A single blank line is enough to separate logical code blocks. Acked-by: Uwe Kleine-König <[email protected]> Acked-by: Lee Jones <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: sti: Avoid conditional gotosThierry Reding1-26/+22
Using gotos for conditional code complicates this code significantly. Convert the code to simple conditional blocks to increase readability. Suggested-by: Uwe Kleine-König <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Acked-by: Lee Jones <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: Add PWM fan controller driver for LGM SoCRahul Tanwar3-0/+256
Intel Lightning Mountain(LGM) SoC contains a PWM fan controller. This PWM controller does not have any other consumer, it is a dedicated PWM controller for fan attached to the system. Add driver for this PWM fan controller. Signed-off-by: Rahul Tanwar <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: Add DesignWare PWM Controller DriverJarkko Nikula3-0/+329
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]>
2020-12-17pwm: mediatek: Add MT8183 SoC supportFabien Parent1-0/+7
Add PWM support for the MT8183 SoC. Signed-off-by: Fabien Parent <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: mediatek: Always use bus clockFabien Parent1-0/+12
The MediaTek PWM IP can sometimes use the 26 MHz source clock to generate the PWM signal, but the driver currently assumes that we always use the PWM bus clock to generate the PWM signal. This commit modifies the PWM driver in order to force the PWM IP to always use the bus clock as source clock. I do not have the datasheet of all the MediaTek SoC, so I don't know if the register to choose the source clock is present in all the SoCs or only in subset. As a consequence I made this change optional by using a platform data paremeter to says whether this register is supported or not. On all the SoCs I don't have the datasheet (MT2712, MT7622, MT7623, MT7628, MT7629) I kept the behavior to be the same as before this change. Signed-off-by: Fabien Parent <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: Add PWM driver for Intel Keem BayVijayakannan Ayyathurai3-0/+250
The Intel Keem Bay SoC requires PWM support. Add the pwm-keembay driver to enable this. Signed-off-by: Lai, Poey Seng <[email protected]> Co-developed-by: Vineetha G. Jaya Kumaran <[email protected]> Signed-off-by: Vineetha G. Jaya Kumaran <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Co-developed-by: Vijayakannan Ayyathurai <[email protected]> Signed-off-by: Vijayakannan Ayyathurai <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: lp3943: Dynamically allocate PWM chip baseLokesh Vutla1-0/+1
When there are other PWM controllers enabled along with pwm-lp3943, pwm-lp3942 is failing to probe with -EEXIST error. This is because other PWM controllers are probed first and assigned PWM base 0 and pwm-lp3943 is requesting for 0 again. In order to avoid this, assign the chip base with -1, so that it is dynamically allocated. Fixes: af66b3c0934e ("pwm: Add LP3943 PWM driver") Signed-off-by: Lokesh Vutla <[email protected]> Reviewed-by: Uwe Kleine-König <u.kleine-kö[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: atmel-tcb: Add sama5d2 supportAlexandre Belloni1-3/+20
Add sama5d2 support. The sama5d2 has a new clock input, its gclk. Index 0 of the clock selector is the gclk instead of the peripheral clock divided by 2. For now, the gclk is not used because the peripheral clock divided by 8 already gives a 9.6ns resolution which is enough for most use cases. Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: atmel-tcb: Switch to new bindingAlexandre Belloni2-107/+137
The PWM is now a subnode of the used TCB. This is cleaner and it mainly allows to stop wasting TCB channels when only 2 or 4 PWMs are used. This also removes the atmel_tclib dependency Cc: Thierry Reding <[email protected]> Cc: [email protected] Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: tiehrpwm: Handle deferred probe with dev_err_probe()Grygorii Strashko1-8/+4
The devm_clk_get() may return -EPROBE_DEFER which is not handled properly by TI EHRPWM driver and causes unnecessary boot log messages. Hence, add proper deferred probe handling with new dev_err_probe() API. Signed-off-by: Grygorii Strashko <[email protected]> Reviewed-by: Vignesh Raghavendra <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: lpss: Set DPM_FLAG_SMART_SUSPEND on Cherry Trail devicesHans de Goede1-1/+5
As the comment above the code setting the DPM_FLAG_NO_DIRECT_COMPLETE flag explains: /* * On Cherry Trail devices the GFX0._PS0 AML checks if the controller * is on and if it is not on it turns it on and restores what it * believes is the correct state to the PWM controller. * Because of this we must disallow direct-complete, which keeps the * controller (runtime)suspended, on resume to avoid 2 issues: * 1. The controller getting turned on without the linux-pm code * knowing about this. On devices where the controller is unused * this causes it to stay on during the next suspend causing high * battery drain (because S0i3 is not reached) * 2. The state restoring code unexpectedly messing with the controller */ The pm-core must not skip resume to avoid the GFX0._PS0 AML code messing with the PWM controller behind our back. But leaving the controller runtime-suspended (skipping runtime-resume + normal-suspend) during suspend is fine. Set the DPM_FLAG_SMART_SUSPEND flag to allow this. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: lpss: Use DPM_FLAG_NO_DIRECT_COMPLETE instead of declaring a prepare ↵Hans de Goede1-20/+15
handler ACPI LPSS devices use direct-complete style suspend/resume handling by default. We set the DPM_FLAG_SMART_PREPARE and define a prepare handler to disable this on Cherry Trail devices. Clean this up a bit by setting the DPM_FLAG_NO_DIRECT_COMPLETE flag for Cherry Trail devices, instead of defining a prepare handler. While at it also improve the comment explaining why this is necessary. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: lpss: Log error from pwm_lpss_is_updating() if the update bit is still setHans de Goede1-1/+6
pwm_lpss_is_updating() does a sanity check which should never fail. If the check does actually fail that is worth logging an error, especially since this means that we will skip making the requested changes to the PWM settings. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: ab8500: Explicitly allocate pwm chip base dynamicallyUwe Kleine-König1-1/+1
The ab8500 driver is the last one which doesn't (explicitly) use dynamic allocation of the pwm id. Looking through the kernel sources I didn't find a place that relies on this id. And with the device probed from device tree pdev->id is -1 anyhow; making this explicit looks beneficial, too. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: zx: Add missing cleanup in error pathUwe Kleine-König1-0/+1
zx_pwm_probe() called clk_prepare_enable() before; this must be undone in the error path. Fixes: 4836193c435c ("pwm: Add ZTE ZX PWM device driver") Signed-off-by: Uwe Kleine-König <[email protected]> Acked-by: Shawn Guo <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: ab8500: Add error message if pwmchip_add() failsUwe Kleine-König1-1/+1
pwmchip_add() doesn't emit an error message, so add one in the driver. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: imx1: Use dev_err_probe() to simplify error handlingAnson Huang1-15/+6
dev_err_probe() can reduce code size, uniform error handling and record the defer probe reason etc., use it to simplify the code. Signed-off-by: Anson Huang <[email protected]> Acked-by: Lee Jones <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: imx27: Use dev_err_probe() to simplify error handlingAnson Huang1-19/+6
dev_err_probe() can reduce code size, uniform error handling and record the defer probe reason etc., use it to simplify the code. Signed-off-by: Anson Huang <[email protected]> Acked-by: Lee Jones <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: imx-tpm: Use dev_err_probe() to simplify error handlingAnson Huang1-7/+3
dev_err_probe() can reduce code size, uniform error handling and record the defer probe reason etc., use it to simplify the code. Signed-off-by: Anson Huang <[email protected]> Acked-by: Lee Jones <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: atmel: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Acked-by: Claudiu Beznea <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: sifive: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: hibvt: Convert to devm_platform_ioremap_resource()Yangtao Li1-5/+2
Use devm_platform_ioremap_resource() to simplify code. While at it, also declare the "i" and "ret" variables on the same line since they are of the same type. Signed-off-by: Yangtao Li <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: lpc18xx-sct: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: img: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: clps711x: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: mtk-disp: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: brcmstb: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Nicolas Saenz Julienne <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: vt8500: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: berlin: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: bcm2835: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: tiecap: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: imx: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: tiehrpwm: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: samsung: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: bcm-iproc: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: rockchip: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: meson: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Martin Blumenstingl <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: lpc32xx: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: bcm-kona: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: spear: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: zx: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: pxa: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: sti: Convert to devm_platform_ioremap_resource()Yangtao Li1-4/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: mediatek: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: tegra: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: ep93xx: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2020-12-17pwm: renesas-tpu: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>