public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: arnd@arndb•de (Arnd Bergmann)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v4] ARM: prima2: move to generic reset controller driver framework
Date: Mon, 6 Jan 2014 16:41:03 +0100	[thread overview]
Message-ID: <201401061641.03491.arnd@arndb.de> (raw)
In-Reply-To: <1389003878-10094-1-git-send-email-21cnbao@gmail.com>

On Monday 06 January 2014, Barry Song wrote:
> this moves to generic IP module reset framework, and make other drivers
> use common device_reset() API.
> 
> diff --git a/Documentation/devicetree/bindings/reset/sirf,rstc.txt b/Documentation/devicetree/bindings/reset/sirf,rstc.txt
> new file mode 100644
> index 0000000..0505de7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/reset/sirf,rstc.txt
> @@ -0,0 +1,42 @@
> +CSR SiRFSoC Reset Controller
> +======================================
> +
> +Please also refer to reset.txt in this directory for common reset
> +controller binding usage.
> +
> +Required properties:
> +- compatible: Should be "sirf,prima2-rstc" or "sirf,marco-rstc"
> +- reg: should be register base and length as documented in the
> +  datasheet
> +- #reset-cells: 1, see below
> +
> +example:
> +
> +rstc: reset-controller at 88010000 {
> +	compatible = "sirf,prima2-rstc";
> +	reg = <0x88010000 0x1000>;
> +	#reset-cells = <1>;
> +};

Binding looks good to me.

> +void __init sirfsoc_of_rstc_init(void)
> +{
> +	struct device_node *np = of_find_matching_node(NULL, rstc_ids);
> +	if (!np) {
> +		pr_err("unable to find compatible sirf rstc node in dtb\n");
> +		return;
> +	}
> +
> +	sirfsoc_rstc_base = of_iomap(np, 0);
> +	if (!sirfsoc_rstc_base) {
> +		pr_err("unable to map rstc cpu registers\n");
> +		return;
> +	}
> +
> +	sirfsoc_reset_controller.of_node = np;
> +
> +	reset_controller_register(&sirfsoc_reset_controller);
> +}
> +

Can't this be a regular platform device? Drivers that get the reference to
the reset controller should respect a -EPROBE_DEFER error message if they
get initialized in the wrong order.

	Arnd

  reply	other threads:[~2014-01-06 15:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-06 10:24 [PATCH v4] ARM: prima2: move to generic reset controller driver framework Barry Song
2014-01-06 15:41 ` Arnd Bergmann [this message]
2014-01-07  2:09   ` Barry Song
2014-01-07 15:53     ` Arnd Bergmann
2014-01-09  3:51       ` Barry Song
2014-01-09 11:21         ` Arnd Bergmann
2014-01-09 12:29           ` Barry Song

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=201401061641.03491.arnd@arndb.de \
    --to=arnd@arndb$(echo .)de \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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