Skip to content

Commit b996233

Browse files
committed
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
2 parents 5af6e08 + aa8f351 commit b996233

5 files changed

Lines changed: 13 additions & 6 deletions

File tree

Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ properties:
3939
- amlogic,meson-s4-pwm
4040
- items:
4141
- enum:
42+
- amlogic,a4-pwm
43+
- amlogic,a5-pwm
4244
- amlogic,c3-pwm
45+
- amlogic,t7-pwm
4346
- amlogic,meson-a1-pwm
4447
- const: amlogic,meson-s4-pwm
4548
- items:

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21450,6 +21450,7 @@ M: Uwe Kleine-König <ukleinek@kernel.org>
2145021450
L: linux-pwm@vger.kernel.org
2145121451
S: Maintained
2145221452
Q: https://patchwork.ozlabs.org/project/linux-pwm/list/
21453+
C: irc://irc.libera.chat/linux-pwm
2145321454
T: git https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git
2145421455
F: Documentation/devicetree/bindings/pwm/
2145521456
F: Documentation/driver-api/pwm.rst

drivers/pwm/pwm-imx-tpm.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static int pwm_imx_tpm_probe(struct platform_device *pdev)
352352
struct clk *clk;
353353
void __iomem *base;
354354
int ret;
355-
unsigned int npwm;
355+
unsigned int i, npwm;
356356
u32 val;
357357

358358
base = devm_platform_ioremap_resource(pdev, 0);
@@ -382,6 +382,13 @@ static int pwm_imx_tpm_probe(struct platform_device *pdev)
382382

383383
mutex_init(&tpm->lock);
384384

385+
/* count the enabled channels */
386+
for (i = 0; i < npwm; ++i) {
387+
val = readl(base + PWM_IMX_TPM_CnSC(i));
388+
if (FIELD_GET(PWM_IMX_TPM_CnSC_ELS, val))
389+
++tpm->enable_count;
390+
}
391+
385392
ret = devm_pwmchip_add(&pdev->dev, chip);
386393
if (ret)
387394
return dev_err_probe(&pdev->dev, ret, "failed to add PWM chip\n");

drivers/pwm/pwm-jz4740.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#include <linux/clk.h>
1212
#include <linux/err.h>
13-
#include <linux/gpio.h>
1413
#include <linux/kernel.h>
1514
#include <linux/mfd/ingenic-tcu.h>
1615
#include <linux/mfd/syscon.h>

drivers/pwm/pwm_th1520.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ const TH1520_PWM_REG_SIZE: usize = 0xB0;
6464
fn ns_to_cycles(ns: u64, rate_hz: u64) -> u64 {
6565
const NSEC_PER_SEC_U64: u64 = time::NSEC_PER_SEC as u64;
6666

67-
(match ns.checked_mul(rate_hz) {
68-
Some(product) => product,
69-
None => u64::MAX,
70-
}) / NSEC_PER_SEC_U64
67+
ns.saturating_mul(rate_hz) / NSEC_PER_SEC_U64
7168
}
7269

7370
fn cycles_to_ns(cycles: u64, rate_hz: u64) -> u64 {

0 commit comments

Comments
 (0)