public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris BREZILLON <boris.brezillon@free-electrons.com>
To: Lee Jones <lee.jones@linaro.org>, Hans de Goede <hdegoede@redhat.com>
Cc: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, dev@linux-sunxi.org,
	Carlo Caione <carlo@caione.org>, Shuge <shuge@allwinnertech.com>,
	kevin@allwinnertech.com
Subject: Re: [RFC PATCH 1/3] mfd: AXP22x: add support for APX221 PMIC
Date: Fri, 23 May 2014 09:11:34 +0200	[thread overview]
Message-ID: <537EF4A6.2050405@free-electrons.com> (raw)
In-Reply-To: <20140520074810.GE20874@lee--X1>

Hello Lee
On 20/05/2014 09:48, Lee Jones wrote:
>>>>> This patch introduces preliminary support for the X-Powers AXP221 PMIC.
>>>>> The AXP221 is typically used on boards using Allwinner's A31 SoC.
>>>>>
>>>>> At the moment, this driver only exposes regulator devices, but other
>>>>> subdevices.
>>>>>
>>>>> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
>>>>> ---
>>>>>  drivers/mfd/Kconfig        |  12 +++
>>>>>  drivers/mfd/Makefile       |   1 +
>>>>>  drivers/mfd/axp22x.c       | 237 +++++++++++++++++++++++++++++++++++++++++++++
>>>>>  include/linux/mfd/axp22x.h | 149 ++++++++++++++++++++++++++++
>>>>>  4 files changed, 399 insertions(+)
>>>>>  create mode 100644 drivers/mfd/axp22x.c
>>>>>  create mode 100644 include/linux/mfd/axp22x.h
>>>> Not a chance.
>>>>
>>>> Farrrr, too much common code with axp20x.c - please merge into one file.
>>>>
>>> This was one of the questions I asked in my cover letter (could you take
>>> a look at it and tell me what's your prefered solution ?) ;-).
>>>
>>> I first tried to reuse the axp20x drivers, but ended up copying almost
>>> all definitions, hence I decided to first do a different driver and ask
>>> for advices.
>> I've just taken a good look at this (I'm planning on doing an axp152 driver
>> myself), and it seems that using a single mfd driver for the 20x and 221 should
>> be quite feasible:
>>
>> - axp20x.h would get some new register defines for registers which are
>>   different (or unique) to the 221 prefixed with aXP221
>> - An axp20x_writeable_ranges would need
>>   to be extended with a third range going from AXP221_BAT_CAP1 (0xe0)
>>   to AXP221_BAT_LOW_THRESH (0xe6)
>> - axp20x_writeable_table would get .n_yes_ranges set to 2, and a new
>>   apx22x_writeable_table would be introduced with n_yes_ranges set to 3.
>> - add a new axp221_supplies array
>> - add a new axp221_cells array
>> - and finally use the proper structs in axp20x_i2c_probe depending on the type
>>
>> Note that this means sharing ie the interrupt table, which is ok since they
>> are the same, except that the 221 has a couple of interrupts missing, but
>> the ones which are shared are all at the same place.
> Exactly.  As .probe() is identical, you only require some device
> matching and some extra structs where the data actually differs
> between devices.
>

I think you've applied this patch on your for-next tree by mistake.
As stated above, this driver should be merged with the axp20x one.

Best Regards,

Boris

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


  reply	other threads:[~2014-05-23  7:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 17:51 [RFC PATCH 0/3] mfd: AXP22x: add support for APX221 PMIC Boris BREZILLON
2014-05-15 17:51 ` [RFC PATCH 1/3] " Boris BREZILLON
2014-05-19 17:28   ` Lee Jones
2014-05-19 17:45     ` Boris BREZILLON
2014-05-20  7:39       ` Hans de Goede
2014-05-20  7:48         ` Lee Jones
2014-05-23  7:11           ` Boris BREZILLON [this message]
2014-05-23 10:03             ` Lee Jones
2014-05-15 17:51 ` [RFC PATCH 2/3] regulator: AXP22x: add support for AXP221 regulators Boris BREZILLON
2014-05-15 17:51 ` [RFC PATCH 3/3] ARM: sunxi: dt: define AXP221 pmic node available on the APP4-EVB1 board Boris BREZILLON
2014-05-19 14:03 ` [RFC PATCH 0/3] mfd: AXP22x: add support for APX221 PMIC Maxime Ripard

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=537EF4A6.2050405@free-electrons.com \
    --to=boris.brezillon@free-electrons.com \
    --cc=broonie@kernel.org \
    --cc=carlo@caione.org \
    --cc=dev@linux-sunxi.org \
    --cc=hdegoede@redhat.com \
    --cc=kevin@allwinnertech.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=sameo@linux.intel.com \
    --cc=shuge@allwinnertech.com \
    /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