All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Alex Elder <elder@riscstar.com>
Cc: lgirdwood@gmail.com, broonie@kernel.org,
	alexandre.belloni@bootlin.com, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, mat.jonczyk@o2.pl,
	dlan@gentoo.org, paul.walmsley@sifive.com, palmer@dabbelt.com,
	aou@eecs.berkeley.edu, alex@ghiti.fr, linux.amoon@gmail.com,
	troymitchell988@gmail.com, guodong@riscstar.com,
	linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-riscv@lists.infradead.org, spacemit@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v10 2/8] mfd: simple-mfd-i2c: specify max_register
Date: Thu, 31 Jul 2025 14:41:48 +0100	[thread overview]
Message-ID: <20250731134148.GI1049189@google.com> (raw)
In-Reply-To: <e3cd0e11-e516-4cf6-b8f8-5cf2b5a236a4@riscstar.com>

On Thu, 31 Jul 2025, Alex Elder wrote:

> On 7/31/25 8:18 AM, Lee Jones wrote:
> > On Sat, 26 Jul 2025, Alex Elder wrote:
> > 
> > > All devices supported by simple MFD use the same 8-bit register 8-bit
> > > value regmap configuration.  There is an option available for a device
> > > to specify a custom configuration, but no existing device uses it.
> > > 
> > > Rather than requiring a "full" regmap configuration to be provided to
> > > change only the max_register value, Lee Jones suggested allowing
> > > max_register to be specified in the simple_mfd_data structure.  The
> > > 8-bit register 8-bit configuration is still used by default, but
> > > max_register is also applied if it is non-zero.
> > > 
> > > If both regmap_config and max_register are provided, the max_register
> > > field in the regmap_config structure is ignored.
> > > 
> > > Signed-off-by: Alex Elder <elder@riscstar.com>
> > > Suggested-by: Lee Jones <lee@kernel.org>
> > > ---
> > > v10: - Rename simple_regmap_config() -> simple_regmap_config_get()
> > >       - Introduce simple_regmap_config_put() to free regmap_config
> > > 
> > >   drivers/mfd/simple-mfd-i2c.c | 45 ++++++++++++++++++++++++++++++++----
> > >   drivers/mfd/simple-mfd-i2c.h |  5 +---
> > >   2 files changed, 41 insertions(+), 9 deletions(-)
> > 
> > This has gone from an in-function 11 line change to 50 lines and the
> > inclusion of 2 new functions.  As much as I _really_ appreciate the time
> > and effort you have put into this [0], the added complexity being added
> > here doesn't sit right with me.  How would you like to go back to your
> > v4 idea of providing a bespoke regmap_config for for device?
> 
> I LOVE this suggestion.  I will send v11 shortly and it will
> be very much like v6 (or something like that).
> 
> > [0] Beers on me for sending you down this path!
> 
> I'm looking forward to seeing you again, beer or not.

Likewise!  =:-)

-- 
Lee Jones [李琼斯]

WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee@kernel.org>
To: Alex Elder <elder@riscstar.com>
Cc: lgirdwood@gmail.com, broonie@kernel.org,
	alexandre.belloni@bootlin.com, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, mat.jonczyk@o2.pl,
	dlan@gentoo.org, paul.walmsley@sifive.com, palmer@dabbelt.com,
	aou@eecs.berkeley.edu, alex@ghiti.fr, linux.amoon@gmail.com,
	troymitchell988@gmail.com, guodong@riscstar.com,
	linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-riscv@lists.infradead.org, spacemit@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v10 2/8] mfd: simple-mfd-i2c: specify max_register
Date: Thu, 31 Jul 2025 14:41:48 +0100	[thread overview]
Message-ID: <20250731134148.GI1049189@google.com> (raw)
In-Reply-To: <e3cd0e11-e516-4cf6-b8f8-5cf2b5a236a4@riscstar.com>

On Thu, 31 Jul 2025, Alex Elder wrote:

> On 7/31/25 8:18 AM, Lee Jones wrote:
> > On Sat, 26 Jul 2025, Alex Elder wrote:
> > 
> > > All devices supported by simple MFD use the same 8-bit register 8-bit
> > > value regmap configuration.  There is an option available for a device
> > > to specify a custom configuration, but no existing device uses it.
> > > 
> > > Rather than requiring a "full" regmap configuration to be provided to
> > > change only the max_register value, Lee Jones suggested allowing
> > > max_register to be specified in the simple_mfd_data structure.  The
> > > 8-bit register 8-bit configuration is still used by default, but
> > > max_register is also applied if it is non-zero.
> > > 
> > > If both regmap_config and max_register are provided, the max_register
> > > field in the regmap_config structure is ignored.
> > > 
> > > Signed-off-by: Alex Elder <elder@riscstar.com>
> > > Suggested-by: Lee Jones <lee@kernel.org>
> > > ---
> > > v10: - Rename simple_regmap_config() -> simple_regmap_config_get()
> > >       - Introduce simple_regmap_config_put() to free regmap_config
> > > 
> > >   drivers/mfd/simple-mfd-i2c.c | 45 ++++++++++++++++++++++++++++++++----
> > >   drivers/mfd/simple-mfd-i2c.h |  5 +---
> > >   2 files changed, 41 insertions(+), 9 deletions(-)
> > 
> > This has gone from an in-function 11 line change to 50 lines and the
> > inclusion of 2 new functions.  As much as I _really_ appreciate the time
> > and effort you have put into this [0], the added complexity being added
> > here doesn't sit right with me.  How would you like to go back to your
> > v4 idea of providing a bespoke regmap_config for for device?
> 
> I LOVE this suggestion.  I will send v11 shortly and it will
> be very much like v6 (or something like that).
> 
> > [0] Beers on me for sending you down this path!
> 
> I'm looking forward to seeing you again, beer or not.

Likewise!  =:-)

-- 
Lee Jones [李琼斯]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2025-07-31 13:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-26 13:09 [PATCH v10 0/8] spacemit: introduce P1 PMIC support Alex Elder
2025-07-26 13:09 ` Alex Elder
2025-07-26 13:09 ` [PATCH v10 1/8] dt-bindings: mfd: add support the SpacemiT P1 PMIC Alex Elder
2025-07-26 13:09   ` Alex Elder
2025-07-26 13:09 ` [PATCH v10 2/8] mfd: simple-mfd-i2c: specify max_register Alex Elder
2025-07-26 13:09   ` Alex Elder
2025-07-31 13:18   ` Lee Jones
2025-07-31 13:18     ` Lee Jones
2025-07-31 13:28     ` Alex Elder
2025-07-31 13:28       ` Alex Elder
2025-07-31 13:41       ` Lee Jones [this message]
2025-07-31 13:41         ` Lee Jones
2025-07-26 13:09 ` [PATCH v10 3/8] mfd: simple-mfd-i2c: add SpacemiT P1 support Alex Elder
2025-07-26 13:09   ` Alex Elder
2025-07-26 13:09 ` [PATCH v10 4/8] regulator: spacemit: support SpacemiT P1 regulators Alex Elder
2025-07-26 13:09   ` Alex Elder
2025-07-28  7:37   ` kernel test robot
2025-07-28  7:37     ` kernel test robot
2025-07-28 16:43     ` Alex Elder
2025-07-28 16:43       ` Alex Elder
2025-07-26 13:09 ` [PATCH v10 5/8] rtc: spacemit: support the SpacemiT P1 RTC Alex Elder
2025-07-26 13:09   ` Alex Elder
2025-07-26 13:10 ` [PATCH v10 6/8] riscv: dts: spacemit: enable the i2c8 adapter Alex Elder
2025-07-26 13:10   ` Alex Elder
2025-07-26 13:10 ` [PATCH v10 7/8] riscv: dts: spacemit: define fixed regulators Alex Elder
2025-07-26 13:10   ` Alex Elder
2025-07-26 13:10 ` [PATCH v10 8/8] riscv: dts: spacemit: define regulator constraints Alex Elder
2025-07-26 13:10   ` Alex Elder

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=20250731134148.GI1049189@google.com \
    --to=lee@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=alexandre.belloni@bootlin.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlan@gentoo.org \
    --cc=elder@riscstar.com \
    --cc=guodong@riscstar.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux.amoon@gmail.com \
    --cc=mat.jonczyk@o2.pl \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.org \
    --cc=spacemit@lists.linux.dev \
    --cc=troymitchell988@gmail.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 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.