linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/6] regulator: pbias: program pbias register offset in pbias driver
Date: Wed, 2 Sep 2015 08:30:16 -0700	[thread overview]
Message-ID: <20150902153015.GR4215@atomide.com> (raw)
In-Reply-To: <1441190853-7133-2-git-send-email-kishon@ti.com>

* Kishon Vijay Abraham I <kishon@ti.com> [150902 03:51]:
> --- a/drivers/regulator/pbias-regulator.c
> +++ b/drivers/regulator/pbias-regulator.c

How about add a comment here:

/* Offset from SCM general area (and syscon) base */
  
> +static const struct pbias_of_data pbias_of_data_omap2 = {
> +	.offset = 0x230,
> +};
> +
> +static const struct pbias_of_data pbias_of_data_omap3 = {
> +	.offset = 0x2b0,
> +};
> +
> +static const struct pbias_of_data pbias_of_data_omap4 = {
> +	.offset = 0x60,
> +};
> +
> +static const struct pbias_of_data pbias_of_data_omap5 = {
> +	.offset = 0x60,
> +};
> +
> +static const struct pbias_of_data pbias_of_data_dra7 = {
> +	.offset = 0xe00,
> +};
> +
>  static const struct of_device_id pbias_of_match[] = {
>  	{ .compatible = "ti,pbias-omap", },
> +	{ .compatible = "ti,pbias-omap2", .data = &pbias_of_data_omap2, },
> +	{ .compatible = "ti,pbias-omap3", .data = &pbias_of_data_omap3, },
> +	{ .compatible = "ti,pbias-omap4", .data = &pbias_of_data_omap4, },
> +	{ .compatible = "ti,pbias-omap5", .data = &pbias_of_data_omap5, },
> +	{ .compatible = "ti,pbias-dra7", .data = &pbias_of_data_dra7, },
>  	{},
>  };
...

> @@ -129,6 +161,18 @@ static int pbias_regulator_probe(struct platform_device *pdev)
>  	if (IS_ERR(syscon))
>  		return PTR_ERR(syscon);
>  
> +	match = of_match_device(of_match_ptr(pbias_of_match), &pdev->dev);
> +	if (match && match->data) {
> +		data = match->data;
> +		offset = data->offset;
> +	} else {
> +		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +		if (!res)
> +			return -EINVAL;
> +
> +		offset = res->start;
> +	}
> +
>  	cfg.regmap = syscon;
>  	cfg.dev = &pdev->dev;
>  

Maybe add a warning here for parsing the legacy broken IORESOURCE_MEM
that's known to be broken from DT point of view?

Other than that, looks OK to me and should allow also changing to
use a generic solution, Mark may have some other comments.

Anyways, something like this is needed for v4.3-rc cycle, probably
best that Mark queues all these after review. So feel free to add
for the whole series:

Acked-by: Tony Lindgren <tony@atomide.com>

  reply	other threads:[~2015-09-02 15:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 10:47 [PATCH 0/6] Fix pbias regulator enable Kishon Vijay Abraham I
2015-09-02 10:47 ` [PATCH 1/6] regulator: pbias: program pbias register offset in pbias driver Kishon Vijay Abraham I
2015-09-02 15:30   ` Tony Lindgren [this message]
2015-09-02 18:06   ` Mark Brown
2015-09-02 10:47 ` [PATCH 2/6] ARM: dts: dra7: use "ti, pbias-dra7" compatible string for pbias Kishon Vijay Abraham I
2015-09-02 10:47 ` [PATCH 3/6] ARM: dts: omap243x: use "ti, pbias-omap2" " Kishon Vijay Abraham I
2015-09-02 10:47 ` [PATCH 4/6] ARM: dts: omap3: use "ti, pbias-omap3" " Kishon Vijay Abraham I
2015-09-02 10:47 ` [PATCH 5/6] ARM: dts: OMAP4: use "ti, pbias-omap4" " Kishon Vijay Abraham I
2015-09-02 10:47 ` [PATCH 6/6] ARM: dts: OMAP5: use "ti, pbias-omap5" " Kishon Vijay Abraham I

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=20150902153015.GR4215@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).