From: boris.brezillon@free-electrons.com (Boris BREZILLON)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/6] mfd: axp20x: add AXP221 PMIC support
Date: Tue, 27 May 2014 12:14:18 +0200 [thread overview]
Message-ID: <5384657A.3030207@free-electrons.com> (raw)
In-Reply-To: <20140527100540.GJ5875@lee--X1>
On 27/05/2014 12:05, Lee Jones wrote:
>> Add support for the AXP221 PMIC device to the existing AXP20x driver.
>>
>> The AXP221 defines a new set of registers, power supplies and regulators,
>> but most of the API is similar to the AXP20x ones.
>> The AXP20x irq chip definition is reused, though some interrupts are not
>> available in the AXP221.
>>
>> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
>> ---
>> drivers/mfd/axp20x.c | 58 +++++++++++++++++++++++++++++++++++++++++++---
> Quite a difference from 237 lines, eh?
Yep.
I never said my RFC was using the best approach, I actually asked how
code sharing should be done in my cover letter ;-).
>> include/linux/mfd/axp20x.h | 56 ++++++++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 111 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
>> index dee6539..119a7ed 100644
>> --- a/drivers/mfd/axp20x.c
>> +++ b/drivers/mfd/axp20x.c
> [...]
>
>> @@ -190,7 +233,12 @@ static int axp20x_i2c_probe(struct i2c_client *i2c,
>> axp20x->dev = &i2c->dev;
>> dev_set_drvdata(axp20x->dev, axp20x);
>>
>> - axp20x->regmap = devm_regmap_init_i2c(i2c, &axp20x_regmap_config);
>> + if (axp20x->variant == AXP221_ID)
>> + axp20x->regmap = devm_regmap_init_i2c(i2c,
>> + &axp22x_regmap_config);
>> + else
>> + axp20x->regmap = devm_regmap_init_i2c(i2c,
>> + &axp20x_regmap_config);
> Better to put these into a variable and have one instance of
> devm_regmap_init_i2c() where you pass said variable as the second
> parameter.
Sure, I'll change that.
Thanks for your review.
Best Regards,
Boris
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
WARNING: multiple messages have this Message-ID (diff)
From: Boris BREZILLON <boris.brezillon@free-electrons.com>
To: Lee Jones <lee.jones@linaro.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Maxime Ripard <maxime.ripard@free-electrons.com>,
Carlo Caione <carlo@caione.org>, Shuge <shuge@allwinnertech.com>,
kevin@allwinnertech.com, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, dev@linux-sunxi.org
Subject: Re: [PATCH v3 1/6] mfd: axp20x: add AXP221 PMIC support
Date: Tue, 27 May 2014 12:14:18 +0200 [thread overview]
Message-ID: <5384657A.3030207@free-electrons.com> (raw)
In-Reply-To: <20140527100540.GJ5875@lee--X1>
On 27/05/2014 12:05, Lee Jones wrote:
>> Add support for the AXP221 PMIC device to the existing AXP20x driver.
>>
>> The AXP221 defines a new set of registers, power supplies and regulators,
>> but most of the API is similar to the AXP20x ones.
>> The AXP20x irq chip definition is reused, though some interrupts are not
>> available in the AXP221.
>>
>> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
>> ---
>> drivers/mfd/axp20x.c | 58 +++++++++++++++++++++++++++++++++++++++++++---
> Quite a difference from 237 lines, eh?
Yep.
I never said my RFC was using the best approach, I actually asked how
code sharing should be done in my cover letter ;-).
>> include/linux/mfd/axp20x.h | 56 ++++++++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 111 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
>> index dee6539..119a7ed 100644
>> --- a/drivers/mfd/axp20x.c
>> +++ b/drivers/mfd/axp20x.c
> [...]
>
>> @@ -190,7 +233,12 @@ static int axp20x_i2c_probe(struct i2c_client *i2c,
>> axp20x->dev = &i2c->dev;
>> dev_set_drvdata(axp20x->dev, axp20x);
>>
>> - axp20x->regmap = devm_regmap_init_i2c(i2c, &axp20x_regmap_config);
>> + if (axp20x->variant == AXP221_ID)
>> + axp20x->regmap = devm_regmap_init_i2c(i2c,
>> + &axp22x_regmap_config);
>> + else
>> + axp20x->regmap = devm_regmap_init_i2c(i2c,
>> + &axp20x_regmap_config);
> Better to put these into a variable and have one instance of
> devm_regmap_init_i2c() where you pass said variable as the second
> parameter.
Sure, I'll change that.
Thanks for your review.
Best Regards,
Boris
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2014-05-27 10:14 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-27 9:38 [PATCH v3 0/6] mfd: axp20x: add AXP221 PMIC support Boris BREZILLON
2014-05-27 9:38 ` Boris BREZILLON
2014-05-27 9:38 ` [PATCH v3 1/6] " Boris BREZILLON
2014-05-27 9:38 ` Boris BREZILLON
2014-05-27 10:05 ` Lee Jones
2014-05-27 10:05 ` Lee Jones
2014-05-27 10:14 ` Boris BREZILLON [this message]
2014-05-27 10:14 ` Boris BREZILLON
2014-05-27 9:38 ` [PATCH v3 2/6] regulator: axp20x: prepare support for multiple AXP chip families Boris BREZILLON
2014-05-27 9:38 ` Boris BREZILLON
2014-05-27 9:38 ` [PATCH v3 3/6] regulator: axp20x: add support for AXP221 regulators Boris BREZILLON
2014-05-27 9:38 ` Boris BREZILLON
2014-05-27 9:38 ` [PATCH v3 4/6] regulator: axp20x: reset probe data before each probe Boris BREZILLON
2014-05-27 9:38 ` Boris BREZILLON
2014-05-27 9:38 ` [PATCH v3 5/6] regulator: add support for regulator set registration Boris BREZILLON
2014-05-27 9:38 ` Boris BREZILLON
2014-06-10 13:40 ` Boris BREZILLON
2014-06-10 13:40 ` Boris BREZILLON
2014-06-16 8:08 ` Lee Jones
2014-06-16 8:08 ` Lee Jones
2014-06-16 13:24 ` Boris BREZILLON
2014-06-16 13:24 ` Boris BREZILLON
2014-05-27 9:38 ` [PATCH v3 6/6] regulator: axp20x: make use of devm_regulator_set_register Boris BREZILLON
2014-05-27 9:38 ` Boris BREZILLON
2014-05-27 19:49 ` [PATCH v3 0/6] mfd: axp20x: add AXP221 PMIC support Mark Brown
2014-05-27 19:49 ` Mark Brown
[not found] ` <9ed19670-7a2e-4324-a201-6d3c8514bdb3@googlegroups.com>
2014-05-28 17:49 ` Mark Brown
2014-05-28 17:49 ` Mark Brown
2014-05-28 19:46 ` Boris BREZILLON
2014-05-28 19:46 ` Boris BREZILLON
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=5384657A.3030207@free-electrons.com \
--to=boris.brezillon@free-electrons.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 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.