Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pwm: pxa: Add optional reset control

Support optional reset control for the PWM PXA driver.

During 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@riscstar.com>
Link: https://lore.kernel.org/r/20250429085048.1310409-3-guodong@riscstar.com
[ukleinek: Fix conflict with commit df08fff8add2 ("pwm: pxa: Improve using dev_err_probe()")]
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

authored by

Guodong Xu and committed by
Uwe Kleine-König
52d2d14d 08e0b981

+6
+6
drivers/pwm/pwm-pxa.c
··· 25 25 #include <linux/io.h> 26 26 #include <linux/pwm.h> 27 27 #include <linux/of.h> 28 + #include <linux/reset.h> 28 29 29 30 #include <asm/div64.h> 30 31 ··· 162 161 struct pwm_chip *chip; 163 162 struct pxa_pwm_chip *pc; 164 163 struct device *dev = &pdev->dev; 164 + struct reset_control *rst; 165 165 int ret = 0; 166 166 167 167 if (IS_ENABLED(CONFIG_OF) && id == NULL) ··· 180 178 pc->clk = devm_clk_get(dev, NULL); 181 179 if (IS_ERR(pc->clk)) 182 180 return dev_err_probe(dev, PTR_ERR(pc->clk), "Failed to get clock\n"); 181 + 182 + rst = devm_reset_control_get_optional_exclusive_deasserted(dev, NULL); 183 + if (IS_ERR(rst)) 184 + return PTR_ERR(rst); 183 185 184 186 chip->ops = &pxa_pwm_ops; 185 187