mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
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:
@@ -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 TH1520_PWM_REG_SIZE: usize = 0xB0;
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user