All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
To: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
Cc: broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	nsekhar-l0cyMroinI0@public.gmane.org,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	pawel.moll-5wv7dgnIgG8@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
	galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
	lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [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-l0cyMroinI0@public.gmane.org>

* Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org> [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-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
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>

WARNING: multiple messages have this Message-ID (diff)
From: Tony Lindgren <tony@atomide.com>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: broonie@kernel.org, devicetree@vger.kernel.org,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	nsekhar@ti.com, ulf.hansson@linaro.org, robh+dt@kernel.org,
	pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	bcousson@baylibre.com, linux@arm.linux.org.uk,
	lgirdwood@gmail.com, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [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>

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

Thread overview: 27+ 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 ` Kishon Vijay Abraham I
2015-09-02 10:47 ` 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 10:47   ` Kishon Vijay Abraham I
2015-09-02 10:47   ` Kishon Vijay Abraham I
     [not found]   ` <1441190853-7133-2-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
2015-09-02 15:30     ` Tony Lindgren [this message]
2015-09-02 15:30       ` Tony Lindgren
2015-09-02 15:30       ` Tony Lindgren
2015-09-02 18:06     ` Mark Brown
2015-09-02 18:06       ` Mark Brown
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   ` Kishon Vijay Abraham I
2015-09-02 10:47   ` [PATCH 2/6] ARM: dts: dra7: use "ti, pbias-dra7" " 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 3/6] ARM: dts: omap243x: use "ti,pbias-omap2" " Kishon Vijay Abraham I
2015-09-02 10:47   ` [PATCH 3/6] ARM: dts: omap243x: use "ti, pbias-omap2" " Kishon Vijay Abraham I
     [not found] ` <1441190853-7133-1-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
2015-09-02 10:47   ` [PATCH 4/6] ARM: dts: omap3: use "ti,pbias-omap3" " Kishon Vijay Abraham I
2015-09-02 10:47     ` 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 5/6] ARM: dts: OMAP4: use "ti,pbias-omap4" " 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
2015-09-02 10:47   ` 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-4v6ys6ai5vpbdgjk7y7tuq@public.gmane.org \
    --cc=bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=kishon-l0cyMroinI0@public.gmane.org \
    --cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=nsekhar-l0cyMroinI0@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.