mirror of
https://github.com/torvalds/linux.git
synced 2025-11-03 10:10:33 +02:00
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 df08fff8ad ("pwm: pxa: Improve using dev_err_probe()")]
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
This commit is contained in:
parent
08e0b98123
commit
52d2d14d9e
1 changed files with 6 additions and 0 deletions
|
|
@ -25,6 +25,7 @@
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/pwm.h>
|
#include <linux/pwm.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
|
#include <linux/reset.h>
|
||||||
|
|
||||||
#include <asm/div64.h>
|
#include <asm/div64.h>
|
||||||
|
|
||||||
|
|
@ -161,6 +162,7 @@ static int pwm_probe(struct platform_device *pdev)
|
||||||
struct pwm_chip *chip;
|
struct pwm_chip *chip;
|
||||||
struct pxa_pwm_chip *pc;
|
struct pxa_pwm_chip *pc;
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
|
struct reset_control *rst;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_OF) && id == NULL)
|
if (IS_ENABLED(CONFIG_OF) && id == NULL)
|
||||||
|
|
@ -179,6 +181,10 @@ static int pwm_probe(struct platform_device *pdev)
|
||||||
if (IS_ERR(pc->clk))
|
if (IS_ERR(pc->clk))
|
||||||
return dev_err_probe(dev, PTR_ERR(pc->clk), "Failed to get clock\n");
|
return dev_err_probe(dev, PTR_ERR(pc->clk), "Failed to get clock\n");
|
||||||
|
|
||||||
|
rst = devm_reset_control_get_optional_exclusive_deasserted(dev, NULL);
|
||||||
|
if (IS_ERR(rst))
|
||||||
|
return PTR_ERR(rst);
|
||||||
|
|
||||||
chip->ops = &pxa_pwm_ops;
|
chip->ops = &pxa_pwm_ops;
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_OF))
|
if (IS_ENABLED(CONFIG_OF))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue