mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
pwm: Changes for v7.1-rc1
Just two minor fixes, a device tree binding addition to support a few more SoCs (without the need for driver adaptions), a driver include cleanup and the addition of the #linux-pwm irc channel to MAINTAINERS. -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmncplIACgkQj4D7WH0S /k6WnQf+PtJRECp1UNnzLLZAiqEw2u24LrUQzeC0vSI0V72eZstnr7DCcpNyQGfs edqw+UfpJGxxrwQTRNCjGkmi7xB3KY8dzElcfoGJRAyxha3qScY2env8Q1nxabB4 y7eGOGyenhQOoEZhAGYM4Se5VvX5Ch/LuqLrPqszTWPJQOkUI7EAoSSj2i8T2uiT LjYT97GRpsf5u8clGPNHIl2hkoGeq38TdKNwBUMXoMdbj0UEsLfsSyNW0rV2dGE9 J0mieqHhCfgx09wjdTa8WLvVyK0Yd2vwyfyOSeRs1BrqLlVk6N3+nnj/BENQ7mXm 9z/qPlEfWB2u9TbBoakxkDON+CQ7Mg== =MdZa -----END PGP SIGNATURE----- Merge tag 'pwm/for-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux Pull pwm updates from Uwe Kleine-König: "Just two minor fixes, a device tree binding addition to support a few more SoCs (without the need for driver adaptions), a driver include cleanup and the addition of the #linux-pwm irc channel to MAINTAINERS" * tag 'pwm/for-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux: pwm: th1520: fix `CLIPPY=1` warning pwm: jz4740: Drop unused include MAINTAINERS: Add #linux-pwm irc channel to pwm entry dt-bindings: pwm: amlogic: Document A4 A5 and T7 PWM pwm: imx-tpm: Count the number of enabled channels in probe
This commit is contained in:
commit
b9962335d4
|
|
@ -39,7 +39,10 @@ properties:
|
|||
- amlogic,meson-s4-pwm
|
||||
- items:
|
||||
- enum:
|
||||
- amlogic,a4-pwm
|
||||
- amlogic,a5-pwm
|
||||
- amlogic,c3-pwm
|
||||
- amlogic,t7-pwm
|
||||
- amlogic,meson-a1-pwm
|
||||
- const: amlogic,meson-s4-pwm
|
||||
- items:
|
||||
|
|
|
|||
|
|
@ -21450,6 +21450,7 @@ M: Uwe Kleine-König <ukleinek@kernel.org>
|
|||
L: linux-pwm@vger.kernel.org
|
||||
S: Maintained
|
||||
Q: https://patchwork.ozlabs.org/project/linux-pwm/list/
|
||||
C: irc://irc.libera.chat/linux-pwm
|
||||
T: git https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git
|
||||
F: Documentation/devicetree/bindings/pwm/
|
||||
F: Documentation/driver-api/pwm.rst
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ static int pwm_imx_tpm_probe(struct platform_device *pdev)
|
|||
struct clk *clk;
|
||||
void __iomem *base;
|
||||
int ret;
|
||||
unsigned int npwm;
|
||||
unsigned int i, npwm;
|
||||
u32 val;
|
||||
|
||||
base = devm_platform_ioremap_resource(pdev, 0);
|
||||
|
|
@ -382,6 +382,13 @@ static int pwm_imx_tpm_probe(struct platform_device *pdev)
|
|||
|
||||
mutex_init(&tpm->lock);
|
||||
|
||||
/* count the enabled channels */
|
||||
for (i = 0; i < npwm; ++i) {
|
||||
val = readl(base + PWM_IMX_TPM_CnSC(i));
|
||||
if (FIELD_GET(PWM_IMX_TPM_CnSC_ELS, val))
|
||||
++tpm->enable_count;
|
||||
}
|
||||
|
||||
ret = devm_pwmchip_add(&pdev->dev, chip);
|
||||
if (ret)
|
||||
return dev_err_probe(&pdev->dev, ret, "failed to add PWM chip\n");
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mfd/ingenic-tcu.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
|
|
|
|||
|
|
@ -64,10 +64,7 @@ const fn th1520_pwm_fp(n: u32) -> usize {
|
|||
fn ns_to_cycles(ns: u64, rate_hz: u64) -> u64 {
|
||||
const NSEC_PER_SEC_U64: u64 = time::NSEC_PER_SEC as u64;
|
||||
|
||||
(match ns.checked_mul(rate_hz) {
|
||||
Some(product) => product,
|
||||
None => u64::MAX,
|
||||
}) / NSEC_PER_SEC_U64
|
||||
ns.saturating_mul(rate_hz) / NSEC_PER_SEC_U64
|
||||
}
|
||||
|
||||
fn cycles_to_ns(cycles: u64, rate_hz: u64) -> u64 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user