[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250429085048.1310409-3-guodong@riscstar.com>
Date: Tue, 29 Apr 2025 16:50:44 +0800
From: Guodong Xu <guodong@...cstar.com>
To: ukleinek@...nel.org,
robh@...nel.org,
krzk+dt@...nel.org,
conor+dt@...nel.org,
paul.walmsley@...ive.com,
palmer@...belt.com,
aou@...s.berkeley.edu,
alex@...ti.fr,
dlan@...too.org,
p.zabel@...gutronix.de,
drew@...7.com,
inochiama@...il.com,
geert+renesas@...der.be,
heylenay@....org,
tglx@...utronix.de,
hal.feng@...rfivetech.com,
unicorn_wang@...look.com,
duje.mihanovic@...le.hr,
heikki.krogerus@...ux.intel.com
Cc: elder@...cstar.com,
linux-pwm@...r.kernel.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org,
spacemit@...ts.linux.dev,
guodong@...cstar.com
Subject: [PATCH v3 2/6] pwm: pxa: add optional reset control
Support optional reset control for the PWM PXA driver.
During the probe, it acquires the reset controller using
devm_reset_control_get_optional_exclusive_deasserted() to get and deassert
the reset controller to enable the PWM channel.
Signed-off-by: Guodong Xu <guodong@...cstar.com>
---
v3: Dropped the addition of a reset_control field to the struct pxa_pwm_chip
Using a local variable for reset in pwm_probe() instead
v2: No change
drivers/pwm/pwm-pxa.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
index 430bd6a709e9..f6a862531601 100644
--- a/drivers/pwm/pwm-pxa.c
+++ b/drivers/pwm/pwm-pxa.c
@@ -25,6 +25,7 @@
#include <linux/io.h>
#include <linux/pwm.h>
#include <linux/of.h>
+#include <linux/reset.h>
#include <asm/div64.h>
@@ -160,6 +161,7 @@ static int pwm_probe(struct platform_device *pdev)
const struct platform_device_id *id = platform_get_device_id(pdev);
struct pwm_chip *chip;
struct pxa_pwm_chip *pc;
+ struct reset_control *rst;
int ret = 0;
if (IS_ENABLED(CONFIG_OF) && id == NULL)
@@ -179,6 +181,11 @@ static int pwm_probe(struct platform_device *pdev)
if (IS_ERR(pc->clk))
return PTR_ERR(pc->clk);
+ rst = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev,
+ NULL);
+ if (IS_ERR(rst))
+ return PTR_ERR(rst);
+
chip->ops = &pxa_pwm_ops;
if (IS_ENABLED(CONFIG_OF))
--
2.43.0
Powered by blists - more mailing lists