mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Dinh Nguyen <dinguyen@kernel.org>
Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org,
	Marek Vasut <marex@denx.de>
Subject: Re: [PATCH] clocksource: dw_apb: add reset control
Date: Wed, 26 Sep 2018 17:21:39 +0200	[thread overview]
Message-ID: <b99e898f-176f-b587-0d8e-eea18550f3da@linaro.org> (raw)
In-Reply-To: <1537195934-26035-1-git-send-email-dinguyen@kernel.org>

On 17/09/2018 16:52, Dinh Nguyen wrote:
> Add code to retrieve the reset property for the dw-apb timers.

The patch does more than that. Can you explain why the assert/deassert ?


> Signed-off-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
> ---
>  drivers/clocksource/dw_apb_timer_of.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c
> index 69866cd..24bc073 100644
> --- a/drivers/clocksource/dw_apb_timer_of.c
> +++ b/drivers/clocksource/dw_apb_timer_of.c
> @@ -22,6 +22,7 @@
>  #include <linux/of_address.h>
>  #include <linux/of_irq.h>
>  #include <linux/clk.h>
> +#include <linux/reset.h>
>  #include <linux/sched_clock.h>
>  
>  static void __init timer_get_base_and_rate(struct device_node *np,
> @@ -29,12 +30,20 @@ static void __init timer_get_base_and_rate(struct device_node *np,
>  {
>  	struct clk *timer_clk;
>  	struct clk *pclk;
> +	struct reset_control *rstc;
>  
>  	*base = of_iomap(np, 0);
>  
>  	if (!*base)
>  		panic("Unable to map regs for %s", np->name);
>  
> +	/* Unreset the timer if applicable */
> +	rstc = of_reset_control_get(np, NULL);
> +	if (!IS_ERR(rstc)) {
> +		reset_control_assert(rstc);
> +		reset_control_deassert(rstc);
> +	}
> +
>  	/*
>  	 * Not all implementations use a periphal clock, so don't panic
>  	 * if it's not present
> 


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


  parent reply	other threads:[~2018-09-26 15:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-17 14:52 Dinh Nguyen
2018-09-26 13:42 ` Dinh Nguyen
2018-09-26 15:21 ` Daniel Lezcano [this message]
2018-09-27 13:52   ` Dinh Nguyen
2018-09-27 14:22     ` Daniel Lezcano
2018-09-27 14:22       ` [PATCH] clocksource/drivers/dw_apb: Add " Daniel Lezcano
2018-09-27 14:32       ` [PATCH] clocksource: dw_apb: add " Dinh Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b99e898f-176f-b587-0d8e-eea18550f3da@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=dinguyen@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®