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:
Linus Torvalds
2026-04-15 14:13:31 -07:00
5 changed files with 13 additions and 6 deletions

View File

@@ -39,7 +39,10 @@ properties:
- amlogic,meson-s4-pwm - amlogic,meson-s4-pwm
- items: - items:
- enum: - enum:
- amlogic,a4-pwm
- amlogic,a5-pwm
- amlogic,c3-pwm - amlogic,c3-pwm
- amlogic,t7-pwm
- amlogic,meson-a1-pwm - amlogic,meson-a1-pwm
- const: amlogic,meson-s4-pwm - const: amlogic,meson-s4-pwm
- items: - items:

View File

@@ -21450,6 +21450,7 @@ M: Uwe Kleine-König <ukleinek@kernel.org>
L: linux-pwm@vger.kernel.org L: linux-pwm@vger.kernel.org
S: Maintained S: Maintained
Q: https://patchwork.ozlabs.org/project/linux-pwm/list/ 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 T: git https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git
F: Documentation/devicetree/bindings/pwm/ F: Documentation/devicetree/bindings/pwm/
F: Documentation/driver-api/pwm.rst F: Documentation/driver-api/pwm.rst

View File

@@ -352,7 +352,7 @@ static int pwm_imx_tpm_probe(struct platform_device *pdev)
struct clk *clk; struct clk *clk;
void __iomem *base; void __iomem *base;
int ret; int ret;
unsigned int npwm; unsigned int i, npwm;
u32 val; u32 val;
base = devm_platform_ioremap_resource(pdev, 0); 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); 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); ret = devm_pwmchip_add(&pdev->dev, chip);
if (ret) if (ret)
return dev_err_probe(&pdev->dev, ret, "failed to add PWM chip\n"); return dev_err_probe(&pdev->dev, ret, "failed to add PWM chip\n");

View File

@@ -10,7 +10,6 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/gpio.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mfd/ingenic-tcu.h> #include <linux/mfd/ingenic-tcu.h>
#include <linux/mfd/syscon.h> #include <linux/mfd/syscon.h>

View File

@@ -64,10 +64,7 @@ const TH1520_PWM_REG_SIZE: usize = 0xB0;
fn ns_to_cycles(ns: u64, rate_hz: u64) -> u64 { fn ns_to_cycles(ns: u64, rate_hz: u64) -> u64 {
const NSEC_PER_SEC_U64: u64 = time::NSEC_PER_SEC as u64; const NSEC_PER_SEC_U64: u64 = time::NSEC_PER_SEC as u64;
(match ns.checked_mul(rate_hz) { ns.saturating_mul(rate_hz) / NSEC_PER_SEC_U64
Some(product) => product,
None => u64::MAX,
}) / NSEC_PER_SEC_U64
} }
fn cycles_to_ns(cycles: u64, rate_hz: u64) -> u64 { fn cycles_to_ns(cycles: u64, rate_hz: u64) -> u64 {