From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Stefan Agner <stefan-XLVq0VzYD2Y@public.gmane.org>,
thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org
Cc: mark.rutland-5wv7dgnIgG8@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/3] regulator: tps6586x: add voltage table for tps658643
Date: Wed, 27 Nov 2013 10:09:16 -0700 [thread overview]
Message-ID: <5296273C.1000705@wwwdotorg.org> (raw)
In-Reply-To: <8be2fe8560cc19f03d5be40ad3dc21d5979c8358.1385508112.git.stefan-XLVq0VzYD2Y@public.gmane.org>
On 11/26/2013 04:45 PM, Stefan Agner wrote:
> Depending on version, the voltage table might be different. Add version
> compatibility to the regulator information in order to select correct
> voltage table.
> diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
> -static const unsigned int tps6586x_ldo4_voltages[] = {
> +static const unsigned int tps6586x_ldo4_sm2_voltages[] = {
> +static const unsigned int tps658643_sm2_voltages[] = {
What's the logic behind the "ldo4_sm2" v.s. "sm2" naming? Does it match
the data sheet in some way? If not, it might be better to name this
something like "tps6586x_ldo4_voltages" and "tps65863_ldo4_voltages".
> -#define TPS6586X_REGULATOR(_id, _pin_name, vdata, vreg, shift, nbits, \
> - ereg0, ebit0, ereg1, ebit1, goreg, gobit) \
> +#define TPS6586X_REG(_ver, _id, _pin_name, vdata, vreg, shift, nbits, \
> + ereg0, ebit0, ereg1, ebit1, goreg, gobit) \
Why rename the macro?
There's an embedded TAB before "nbits".
> +/* Add version specific entries before any */
> static struct tps6586x_regulator tps6586x_regulator[] = {
> TPS6586X_SYS_REGULATOR(),
> - TPS6586X_LDO(LDO_0, "vinldo01", ldo0, SUPPLYV1, 5, 3, ENC, 0, END, 0),
...
> + TPS6586X_LDO(TPS6586X_ANY, LDO_0, "vinldo01", tps6586x_ldo0, SUPPLYV1,
> + 5, 3, ENC, 0, END, 0),
Rather than changing all the macros and table entries, wouldn't it be
much simpler to:
1) Make tps6586x_regulator[] only contain all the common regulator
definitions.
2) Add new version-specific tables for each version of regulator, so
tps6586x_other_regulator[] and tps65863_regulator[].
3) Have probe() walk multiple tables of regulators, selecting which
tables to walk based on version.
That would result in a much smaller and less invasive diff.
WARNING: multiple messages have this Message-ID (diff)
From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] regulator: tps6586x: add voltage table for tps658643
Date: Wed, 27 Nov 2013 10:09:16 -0700 [thread overview]
Message-ID: <5296273C.1000705@wwwdotorg.org> (raw)
In-Reply-To: <8be2fe8560cc19f03d5be40ad3dc21d5979c8358.1385508112.git.stefan@agner.ch>
On 11/26/2013 04:45 PM, Stefan Agner wrote:
> Depending on version, the voltage table might be different. Add version
> compatibility to the regulator information in order to select correct
> voltage table.
> diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
> -static const unsigned int tps6586x_ldo4_voltages[] = {
> +static const unsigned int tps6586x_ldo4_sm2_voltages[] = {
> +static const unsigned int tps658643_sm2_voltages[] = {
What's the logic behind the "ldo4_sm2" v.s. "sm2" naming? Does it match
the data sheet in some way? If not, it might be better to name this
something like "tps6586x_ldo4_voltages" and "tps65863_ldo4_voltages".
> -#define TPS6586X_REGULATOR(_id, _pin_name, vdata, vreg, shift, nbits, \
> - ereg0, ebit0, ereg1, ebit1, goreg, gobit) \
> +#define TPS6586X_REG(_ver, _id, _pin_name, vdata, vreg, shift, nbits, \
> + ereg0, ebit0, ereg1, ebit1, goreg, gobit) \
Why rename the macro?
There's an embedded TAB before "nbits".
> +/* Add version specific entries before any */
> static struct tps6586x_regulator tps6586x_regulator[] = {
> TPS6586X_SYS_REGULATOR(),
> - TPS6586X_LDO(LDO_0, "vinldo01", ldo0, SUPPLYV1, 5, 3, ENC, 0, END, 0),
...
> + TPS6586X_LDO(TPS6586X_ANY, LDO_0, "vinldo01", tps6586x_ldo0, SUPPLYV1,
> + 5, 3, ENC, 0, END, 0),
Rather than changing all the macros and table entries, wouldn't it be
much simpler to:
1) Make tps6586x_regulator[] only contain all the common regulator
definitions.
2) Add new version-specific tables for each version of regulator, so
tps6586x_other_regulator[] and tps65863_regulator[].
3) Have probe() walk multiple tables of regulators, selecting which
tables to walk based on version.
That would result in a much smaller and less invasive diff.
WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren@wwwdotorg.org>
To: Stefan Agner <stefan@agner.ch>,
thierry.reding@gmail.com, sameo@linux.intel.com, dev@lynxeye.de
Cc: mark.rutland@arm.com, linux-tegra@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] regulator: tps6586x: add voltage table for tps658643
Date: Wed, 27 Nov 2013 10:09:16 -0700 [thread overview]
Message-ID: <5296273C.1000705@wwwdotorg.org> (raw)
In-Reply-To: <8be2fe8560cc19f03d5be40ad3dc21d5979c8358.1385508112.git.stefan@agner.ch>
On 11/26/2013 04:45 PM, Stefan Agner wrote:
> Depending on version, the voltage table might be different. Add version
> compatibility to the regulator information in order to select correct
> voltage table.
> diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
> -static const unsigned int tps6586x_ldo4_voltages[] = {
> +static const unsigned int tps6586x_ldo4_sm2_voltages[] = {
> +static const unsigned int tps658643_sm2_voltages[] = {
What's the logic behind the "ldo4_sm2" v.s. "sm2" naming? Does it match
the data sheet in some way? If not, it might be better to name this
something like "tps6586x_ldo4_voltages" and "tps65863_ldo4_voltages".
> -#define TPS6586X_REGULATOR(_id, _pin_name, vdata, vreg, shift, nbits, \
> - ereg0, ebit0, ereg1, ebit1, goreg, gobit) \
> +#define TPS6586X_REG(_ver, _id, _pin_name, vdata, vreg, shift, nbits, \
> + ereg0, ebit0, ereg1, ebit1, goreg, gobit) \
Why rename the macro?
There's an embedded TAB before "nbits".
> +/* Add version specific entries before any */
> static struct tps6586x_regulator tps6586x_regulator[] = {
> TPS6586X_SYS_REGULATOR(),
> - TPS6586X_LDO(LDO_0, "vinldo01", ldo0, SUPPLYV1, 5, 3, ENC, 0, END, 0),
...
> + TPS6586X_LDO(TPS6586X_ANY, LDO_0, "vinldo01", tps6586x_ldo0, SUPPLYV1,
> + 5, 3, ENC, 0, END, 0),
Rather than changing all the macros and table entries, wouldn't it be
much simpler to:
1) Make tps6586x_regulator[] only contain all the common regulator
definitions.
2) Add new version-specific tables for each version of regulator, so
tps6586x_other_regulator[] and tps65863_regulator[].
3) Have probe() walk multiple tables of regulators, selecting which
tables to walk based on version.
That would result in a much smaller and less invasive diff.
next prev parent reply other threads:[~2013-11-27 17:09 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-26 23:45 [PATCH 0/3] regulator: tps6586x: add version detection and voltage tables Stefan Agner
2013-11-26 23:45 ` Stefan Agner
2013-11-26 23:45 ` Stefan Agner
2013-11-26 23:45 ` [PATCH 1/3] mfd: tps6586x: add version detection Stefan Agner
2013-11-26 23:45 ` Stefan Agner
2013-11-26 23:45 ` Stefan Agner
2013-11-27 13:09 ` Lee Jones
2013-11-27 13:09 ` Lee Jones
2013-11-27 13:11 ` Lee Jones
2013-11-27 13:11 ` Lee Jones
2013-11-27 13:49 ` Stefan Agner
2013-11-27 13:49 ` Stefan Agner
2013-11-27 13:49 ` Stefan Agner
[not found] ` <cd69295e946b48451f449eacc02efa4a-XLVq0VzYD2Y@public.gmane.org>
2013-11-27 13:55 ` Lee Jones
2013-11-27 13:55 ` Lee Jones
2013-11-27 13:55 ` Lee Jones
[not found] ` <cfb203a896eda67c106794d89e668d56@agner.ch>
[not found] ` <20131127143429.GN3296@lee--X1>
2013-11-27 14:36 ` Lee Jones
2013-11-27 14:36 ` Lee Jones
2013-11-27 14:36 ` Lee Jones
2013-11-27 15:26 ` Stefan Agner
2013-11-27 15:26 ` Stefan Agner
2013-11-27 15:26 ` Stefan Agner
2013-11-27 15:30 ` Lee Jones
2013-11-27 15:30 ` Lee Jones
2013-11-27 15:52 ` Stefan Agner
2013-11-27 15:52 ` Stefan Agner
2013-11-27 15:52 ` Stefan Agner
[not found] ` <89dbf704d8617c77259e04753e4380c9-XLVq0VzYD2Y@public.gmane.org>
2013-11-27 16:14 ` Lee Jones
2013-11-27 16:14 ` Lee Jones
2013-11-27 16:14 ` Lee Jones
[not found] ` <ef881d39f78b75b4badeebb5be0264edc3906d86.1385508112.git.stefan-XLVq0VzYD2Y@public.gmane.org>
2013-11-27 16:58 ` Stephen Warren
2013-11-27 16:58 ` Stephen Warren
2013-11-27 16:58 ` Stephen Warren
[not found] ` <529624CA.6030604-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-11-27 21:44 ` Stefan Agner
2013-11-27 21:44 ` Stefan Agner
2013-11-27 21:44 ` Stefan Agner
2013-11-26 23:45 ` [PATCH 2/3] regulator: tps6586x: add voltage table for tps658643 Stefan Agner
2013-11-26 23:45 ` Stefan Agner
2013-11-26 23:45 ` Stefan Agner
[not found] ` <8be2fe8560cc19f03d5be40ad3dc21d5979c8358.1385508112.git.stefan-XLVq0VzYD2Y@public.gmane.org>
2013-11-27 17:09 ` Stephen Warren [this message]
2013-11-27 17:09 ` Stephen Warren
2013-11-27 17:09 ` Stephen Warren
[not found] ` <5296273C.1000705-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-11-27 21:56 ` Stefan Agner
2013-11-27 21:56 ` Stefan Agner
2013-11-27 21:56 ` Stefan Agner
[not found] ` <93a0f4b1da2a54e58cee0756ab5f3e36-XLVq0VzYD2Y@public.gmane.org>
2013-11-28 8:30 ` Thierry Reding
2013-11-28 8:30 ` Thierry Reding
2013-11-28 8:30 ` Thierry Reding
2013-11-26 23:45 ` [PATCH 3/3] ARM: tegra: set SM2 voltage correct Stefan Agner
2013-11-26 23:45 ` Stefan Agner
2013-11-26 23:45 ` Stefan Agner
[not found] ` <c9ceead9e3df77b5a33ad654db23c241cd624096.1385508112.git.stefan-XLVq0VzYD2Y@public.gmane.org>
2013-11-27 9:59 ` Lucas Stach
2013-11-27 9:59 ` Lucas Stach
2013-11-27 9:59 ` Lucas Stach
[not found] ` <1385546387.4270.11.camel-WzVe3FnzCwFR6QfukMTsflXZhhPuCNm+@public.gmane.org>
2013-11-27 11:05 ` Stefan Agner
2013-11-27 11:05 ` Stefan Agner
2013-11-27 11:05 ` Stefan Agner
2013-11-27 11:06 ` Lucas Stach
2013-11-27 11:06 ` Lucas Stach
2013-11-27 17:13 ` Stephen Warren
2013-11-27 17:13 ` Stephen Warren
2013-11-27 17:13 ` Stephen Warren
[not found] ` <5296281C.1060403-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-11-27 22:03 ` Stefan Agner
2013-11-27 22:03 ` Stefan Agner
2013-11-27 22:03 ` Stefan Agner
2013-11-28 9:49 ` Lucas Stach
2013-11-28 9:49 ` Lucas Stach
2013-11-28 9:49 ` Lucas Stach
2013-11-30 16:24 ` Stefan Agner
2013-11-30 16:24 ` Stefan Agner
[not found] ` <cover.1385508112.git.stefan-XLVq0VzYD2Y@public.gmane.org>
2013-11-28 8:13 ` [PATCH 0/3] regulator: tps6586x: add version detection and voltage tables Thierry Reding
2013-11-28 8:13 ` Thierry Reding
2013-11-28 8:13 ` Thierry Reding
2013-11-29 8:20 ` Kai Poggensee
2013-11-29 8:20 ` Kai Poggensee
2013-11-29 8:20 ` Kai Poggensee
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=5296273C.1000705@wwwdotorg.org \
--to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
--cc=dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=stefan-XLVq0VzYD2Y@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@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.