public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Chris Morgan <macroalpha82@gmail.com>
Cc: linux-sunxi@lists.linux.dev, linux-pm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-iio@vger.kernel.org, quentin.schulz@free-electrons.com,
	mripard@kernel.org, tgamblin@baylibre.com,
	aidanmacdonald.0x0@gmail.com, u.kleine-koenig@pengutronix.de,
	lee@kernel.org, samuel@sholland.org, jernej.skrabec@gmail.com,
	sre@kernel.org, wens@csie.org, conor+dt@kernel.org,
	krzk+dt@kernel.org, robh@kernel.org, lars@metafoo.de,
	Chris Morgan <macromorgan@hotmail.com>,
	Philippe Simons <simons.philippe@gmail.com>
Subject: Re: [PATCH V2 14/15] power: supply: axp20x_battery: add support for AXP717
Date: Sat, 17 Aug 2024 10:59:49 +0100	[thread overview]
Message-ID: <20240817105949.2a091d13@jic23-huawei> (raw)
In-Reply-To: <66bd1ddf.ca0a0220.13e5d4.8871@mx.google.com>

On Wed, 14 Aug 2024 16:13:01 -0500
Chris Morgan <macroalpha82@gmail.com> wrote:

> On Sat, Aug 03, 2024 at 12:10:44PM +0100, Jonathan Cameron wrote:
> > On Fri,  2 Aug 2024 14:20:25 -0500
> > Chris Morgan <macroalpha82@gmail.com> wrote:
> >   
> > > From: Chris Morgan <macromorgan@hotmail.com>
> > > 
> > > Add support for the AXP717 PMIC battery charger. The AXP717 differs
> > > greatly from existing AXP battery chargers in that it cannot measure
> > > the discharge current. The datasheet does not document the current
> > > value's offset or scale, so the POWER_SUPPLY_PROP_CURRENT_NOW is left
> > > unscaled.
> > > 
> > > Tested-by: Philippe Simons <simons.philippe@gmail.com>
> > > Signed-off-by: Chris Morgan <macromorgan@hotmail.com>  
> > Hi.
> > 
> > A few drive by comments,
> > 
> > Jonathan
> >   
> > > ---
> > >  drivers/power/supply/axp20x_battery.c | 444 ++++++++++++++++++++++++++
> > >  1 file changed, 444 insertions(+)
> > > 
> > > diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c
> > > index c903c588b361..53af4ad0549d 100644
> > > --- a/drivers/power/supply/axp20x_battery.c
> > > +++ b/drivers/power/supply/axp20x_battery.c
> > > @@ -32,9 +32,19 @@
> > >  #include <linux/mfd/axp20x.h>
> > >  
> > >  #define AXP20X_PWR_STATUS_BAT_CHARGING	BIT(2)
> > > +#define AXP717_PWR_STATUS_MASK		GENMASK(6, 5)
> > > +#define AXP717_PWR_STATUS_BAT_STANDBY	(0 << 5)
> > > +#define AXP717_PWR_STATUS_BAT_CHRG	(1 << 5)
> > > +#define AXP717_PWR_STATUS_BAT_DISCHRG	(2 << 5)  
> > 
> > Fine to match local style in this patch, but just thought I'd
> > comment that this driver would probably be more readable with
> > use of FIELD_PREP and changing convention to not shift the defined
> > values for contents of each field.
> > 
> > To change to that it would either need to be before this patch,
> > or done as a follow up.  
> 
> I'll take your other comments and apply them, but if it's okay with
> you I'll opt to not use FIELD_PREP/FIELD_GET for the moment, so the
> style remains the same. I will make sure to use those macros for
> other drivers I'm working on though as they seem handy.
That's fine, though if you are in a position to test, it would be good to follow
up with a tidy up of this driver as that style is much more compact and
helps with maintenance longer term.

Jonathan


  reply	other threads:[~2024-08-17 10:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02 19:20 [PATCH V2 00/15] Add Battery and USB Supply for AXP717 Chris Morgan
2024-08-02 19:20 ` [PATCH V2 01/15] iio: adc: axp20x_adc: Add adc_en1 and adc_en1 to axp_data Chris Morgan
2024-08-03 10:58   ` Jonathan Cameron
2024-08-02 19:20 ` [PATCH V2 02/15] power: supply: axp20x_battery: Remove design from min and max voltage Chris Morgan
2024-08-02 19:20 ` [PATCH V2 03/15] power: supply: axp20x_battery: Make iio and battery config per device Chris Morgan
2024-08-02 19:20 ` [PATCH V2 04/15] power: supply: axp20x_usb_power: Make VBUS and IIO " Chris Morgan
2024-08-02 19:20 ` [PATCH V2 05/15] dt-bindings: power: supply: axp20x: Add input-current-limit-microamp Chris Morgan
2024-08-04 15:37   ` Krzysztof Kozlowski
2024-08-02 19:20 ` [PATCH V2 06/15] power: supply: axp20x_usb_power: add input-current-limit-microamp Chris Morgan
2024-08-02 19:20 ` [PATCH V2 07/15] dt-bindings: power: supply: axp20x-battery: Add monitored-battery Chris Morgan
2024-08-04 15:38   ` Krzysztof Kozlowski
2024-08-02 19:20 ` [PATCH V2 08/15] dt-bindings: iio: adc: Add AXP717 compatible Chris Morgan
2024-08-03 10:59   ` Jonathan Cameron
2024-08-02 19:20 ` [PATCH V2 09/15] dt-bindings: power: supply: axp20x: " Chris Morgan
2024-08-04 15:38   ` Krzysztof Kozlowski
2024-08-02 19:20 ` [PATCH V2 10/15] " Chris Morgan
2024-08-04 15:38   ` Krzysztof Kozlowski
2024-08-02 19:20 ` [PATCH V2 11/15] mfd: axp20x: Add ADC, BAT, and USB cells for AXP717 Chris Morgan
2024-08-02 19:20 ` [PATCH V2 12/15] iio: adc: axp20x_adc: add support for AXP717 ADC Chris Morgan
2024-08-03 11:00   ` Jonathan Cameron
2024-08-02 19:20 ` [PATCH V2 13/15] power: supply: axp20x_usb_power: Add support for AXP717 Chris Morgan
2024-08-02 19:20 ` [PATCH V2 14/15] power: supply: axp20x_battery: add " Chris Morgan
2024-08-03 11:10   ` Jonathan Cameron
2024-08-14 21:13     ` Chris Morgan
2024-08-17  9:59       ` Jonathan Cameron [this message]
2024-08-02 19:20 ` [PATCH V2 15/15] arm64: dts: allwinner: h700: Add charger for Anbernic RG35XX Chris Morgan

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=20240817105949.2a091d13@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=aidanmacdonald.0x0@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=macroalpha82@gmail.com \
    --cc=macromorgan@hotmail.com \
    --cc=mripard@kernel.org \
    --cc=quentin.schulz@free-electrons.com \
    --cc=robh@kernel.org \
    --cc=samuel@sholland.org \
    --cc=simons.philippe@gmail.com \
    --cc=sre@kernel.org \
    --cc=tgamblin@baylibre.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wens@csie.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