[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160622124019.GF26943@ulmo.ba.sec>
Date: Wed, 22 Jun 2016 14:40:19 +0200
From: Thierry Reding <thierry.reding@...il.com>
To: Laxman Dewangan <ldewangan@...dia.com>
Cc: robh+dt@...nel.org, swarren@...dotorg.org, gnurou@...il.com,
linux-pwm@...r.kernel.org, devicetree@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org,
Rohith Seelaboyina <rseelaboyina@...dia.com>
Subject: Re: [PATCH 1/5] pwm: tegra: Add support for reset control
On Wed, Jun 22, 2016 at 05:17:19PM +0530, Laxman Dewangan wrote:
> From: Rohith Seelaboyina <rseelaboyina@...dia.com>
>
> Add reset control of the PWM controller to reset it before
> accessing the PWM register.
>
> Signed-off-by: Rohith Seelaboyina <rseelaboyina@...dia.com>
> Signed-off-by: Laxman Dewangan <ldewangan@...dia.com>
> ---
> drivers/pwm/pwm-tegra.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
> index d4de060..71b9c4d 100644
> --- a/drivers/pwm/pwm-tegra.c
> +++ b/drivers/pwm/pwm-tegra.c
> @@ -29,6 +29,7 @@
> #include <linux/pwm.h>
> #include <linux/platform_device.h>
> #include <linux/slab.h>
> +#include <linux/reset.h>
>
> #define PWM_ENABLE (1 << 31)
> #define PWM_DUTY_WIDTH 8
> @@ -43,6 +44,7 @@ struct tegra_pwm_chip {
> struct device *dev;
>
> struct clk *clk;
> + struct reset_control *rstc;
Drop the 'c' at the end, for consistency with other drivers.
>
> void __iomem *mmio_base;
> };
> @@ -189,6 +191,14 @@ static int tegra_pwm_probe(struct platform_device *pdev)
> if (IS_ERR(pwm->clk))
> return PTR_ERR(pwm->clk);
>
> + pwm->rstc = devm_reset_control_get(&pdev->dev, "pwm");
> + if (IS_ERR(pwm->rstc)) {
> + ret = PTR_ERR(pwm->rstc);
> + dev_err(&pdev->dev, "Reset control is not found: %d\n", ret);
> + return ret;
> + }
> + reset_control_reset(pwm->rstc);
I think you want reset_control_deassert() here and the call its counter-
part, reset_control_assert(), in tegra_pwm_remove().
No particular need to respin, I can make those changes when I apply.
Thierry
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists