[PATCH v13 0/7] spacemit: introduce P1 PMIC support

Alex Elder posted 7 patches 5 months, 2 weeks ago
.../devicetree/bindings/mfd/spacemit,p1.yaml  |  86 +++++++++
.../boot/dts/spacemit/k1-bananapi-f3.dts      | 135 ++++++++++++++
arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi  |   7 +
arch/riscv/boot/dts/spacemit/k1.dtsi          |  13 ++
drivers/mfd/Kconfig                           |  13 ++
drivers/mfd/simple-mfd-i2c.c                  |  17 ++
drivers/regulator/Kconfig                     |  13 ++
drivers/regulator/Makefile                    |   1 +
drivers/regulator/spacemit-p1.c               | 157 ++++++++++++++++
drivers/rtc/Kconfig                           |  10 ++
drivers/rtc/Makefile                          |   1 +
drivers/rtc/rtc-spacemit-p1.c                 | 167 ++++++++++++++++++
12 files changed, 620 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mfd/spacemit,p1.yaml
create mode 100644 drivers/regulator/spacemit-p1.c
create mode 100644 drivers/rtc/rtc-spacemit-p1.c
[PATCH v13 0/7] spacemit: introduce P1 PMIC support
Posted by Alex Elder 5 months, 2 weeks ago
The SpacemiT P1 is an I2C-controlled PMIC that implements 6 buck
converters and 12 LDOs.  It contains a load switch, ADC channels,
GPIOs, a real-time clock, and a watchdog timer.

This series introduces a multifunction driver for the P1 PMIC as
well as drivers for its regulators and RTC.

In this version I updated Troy Mitchell's e-mail address, and
modified the definition of the MFD_SPACEMIT_P1 config option so
it enables I2C_K1, to allow it to be usable.  The series is now
based on net-next rather than linux-v6.17-rc1.

					-Alex

This series is available here:
  https://github.com/riscstar/linux/tree/outgoing/pmic-v13

Between version 12 and version 13:
  - Rebased onto August 25 linux-next
  - Updated Troy Mitchell's e-mail address in patch 1
  - Add Troy Mitchell's Acked-by in patch 1
  - In patch 2, have MFD_SPACEMIT_P1 select I2C_K1 and depend on
    ARCH_SPACEMIT as suggested (privately) by Yixun Lan

Here is version 12 of this series:
  https://lore.kernel.org/lkml/20250813024509.2325988-1-elder@riscstar.com/

Between version 11 and version 12:
  - Simple rebase

Here is version 11 of this series:
  https://lore.kernel.org/lkml/20250803025812.373029-1-elder@riscstar.com/

Between version 10 and version 11:
  - Abandon trying to implement a simple_mfd_data->max_register field
  - Fix a missing dependency pointed out by the kernel test robot

Here is version 10 of this series:
  https://lore.kernel.org/lkml/20250726131003.3137282-1-elder@riscstar.com/

Between version 9 and version 10:
  - The #address-cells and #size-cells for the i2c8 DTS node
    were moved into its primary definition in "k1.dtsi".
  - The interrupts property for the i2c8 DTS node was moved
    below its clock-related properties.
  - The status property in the pmic@41 DTS node was dropped.
  - The function that provides the regmap_config structure
    to use was reworked a bit.
  - A new function was added to free the regmap_config
    structure after it's no longer needed.

Here is version 9 of this series:
  https://lore.kernel.org/lkml/20250724202511.499288-1-elder@riscstar.com/

Between version 8 and version 9:
  - The max_config value is always used if it is provided with the
    simple_mfd_data structure.
  - The regmap_config structure used is allocated dynamically if
    necessary; otherwise regmap_config_8r_8v is used.
  - A small duplicated comment is removed

Here is version 8 of this series:
  https://lore.kernel.org/lkml/20250710175107.1280221-1-elder@riscstar.com/

More complete history is available at that link.

Alex Elder (7):
  dt-bindings: mfd: add support the SpacemiT P1 PMIC
  mfd: simple-mfd-i2c: add SpacemiT P1 support
  regulator: spacemit: support SpacemiT P1 regulators
  rtc: spacemit: support the SpacemiT P1 RTC
  riscv: dts: spacemit: enable the i2c8 adapter
  riscv: dts: spacemit: define fixed regulators
  riscv: dts: spacemit: define regulator constraints

 .../devicetree/bindings/mfd/spacemit,p1.yaml  |  86 +++++++++
 .../boot/dts/spacemit/k1-bananapi-f3.dts      | 135 ++++++++++++++
 arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi  |   7 +
 arch/riscv/boot/dts/spacemit/k1.dtsi          |  13 ++
 drivers/mfd/Kconfig                           |  13 ++
 drivers/mfd/simple-mfd-i2c.c                  |  17 ++
 drivers/regulator/Kconfig                     |  13 ++
 drivers/regulator/Makefile                    |   1 +
 drivers/regulator/spacemit-p1.c               | 157 ++++++++++++++++
 drivers/rtc/Kconfig                           |  10 ++
 drivers/rtc/Makefile                          |   1 +
 drivers/rtc/rtc-spacemit-p1.c                 | 167 ++++++++++++++++++
 12 files changed, 620 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/spacemit,p1.yaml
 create mode 100644 drivers/regulator/spacemit-p1.c
 create mode 100644 drivers/rtc/rtc-spacemit-p1.c


base-commit: 6c68f4c0a147c025ae0b25fab688c7c47964a02f
-- 
2.48.1
Re: (subset) [PATCH v13 0/7] spacemit: introduce P1 PMIC support
Posted by Lee Jones 5 months, 1 week ago
On Mon, 25 Aug 2025 12:20:49 -0500, Alex Elder wrote:
> The SpacemiT P1 is an I2C-controlled PMIC that implements 6 buck
> converters and 12 LDOs.  It contains a load switch, ADC channels,
> GPIOs, a real-time clock, and a watchdog timer.
> 
> This series introduces a multifunction driver for the P1 PMIC as
> well as drivers for its regulators and RTC.
> 
> [...]

Applied, thanks!

[1/7] dt-bindings: mfd: add support the SpacemiT P1 PMIC
      commit: baac6755d3e8ddf47eee2be3ca72fe14ebae2143
[2/7] mfd: simple-mfd-i2c: add SpacemiT P1 support
      commit: 49833495c85f26d070e70148fd9607c6fbf927fd

--
Lee Jones [李琼斯]

Re: (subset) [PATCH v13 0/7] spacemit: introduce P1 PMIC support
Posted by Alex Elder 4 months, 4 weeks ago
On 9/3/25 7:19 AM, Lee Jones wrote:
> On Mon, 25 Aug 2025 12:20:49 -0500, Alex Elder wrote:
>> The SpacemiT P1 is an I2C-controlled PMIC that implements 6 buck
>> converters and 12 LDOs.  It contains a load switch, ADC channels,
>> GPIOs, a real-time clock, and a watchdog timer.
>>
>> This series introduces a multifunction driver for the P1 PMIC as
>> well as drivers for its regulators and RTC.
>>
>> [...]
> 
> Applied, thanks!
> 
> [1/7] dt-bindings: mfd: add support the SpacemiT P1 PMIC
>        commit: baac6755d3e8ddf47eee2be3ca72fe14ebae2143
> [2/7] mfd: simple-mfd-i2c: add SpacemiT P1 support
>        commit: 49833495c85f26d070e70148fd9607c6fbf927fd
> 
> --
> Lee Jones [李琼斯]
> 

Yixun Lan plans to merge patches 5-7 of this series.

That leaves patch 3, which enables regulator support, and patch
4, which adds RTC support.

How should these two patches be merged?  Mark has reviewed the
regulator patch 3 and Alexandre has acked the RTC patch 4.

Thank you.

					-Alex
Re: (subset) [PATCH v13 0/7] spacemit: introduce P1 PMIC support
Posted by Yixun Lan 4 months, 4 weeks ago
Hi Alex,

On 11:36 Thu 11 Sep     , Alex Elder wrote:
> On 9/3/25 7:19 AM, Lee Jones wrote:
> > On Mon, 25 Aug 2025 12:20:49 -0500, Alex Elder wrote:
> >> The SpacemiT P1 is an I2C-controlled PMIC that implements 6 buck
> >> converters and 12 LDOs.  It contains a load switch, ADC channels,
> >> GPIOs, a real-time clock, and a watchdog timer.
> >>
> >> This series introduces a multifunction driver for the P1 PMIC as
> >> well as drivers for its regulators and RTC.
> >>
> >> [...]
> > 
> > Applied, thanks!
> > 
> > [1/7] dt-bindings: mfd: add support the SpacemiT P1 PMIC
> >        commit: baac6755d3e8ddf47eee2be3ca72fe14ebae2143
> > [2/7] mfd: simple-mfd-i2c: add SpacemiT P1 support
> >        commit: 49833495c85f26d070e70148fd9607c6fbf927fd
> > 
> > --
> > Lee Jones [李琼斯]
> > 
> 
> Yixun Lan plans to merge patches 5-7 of this series.
> 
DT patches usually go as the last one, in this case, they effectively
depened on patch 3 which adds the regulator support

As Mark suggest it go via MFD, that leaves Jones to handle,
It's close to the release of rc6, I'd hope it isn't too late..

> That leaves patch 3, which enables regulator support, and patch
> 4, which adds RTC support.
> 
> How should these two patches be merged?  Mark has reviewed the
> regulator patch 3 and Alexandre has acked the RTC patch 4.
> 
> Thank you.
> 
> 					-Alex

-- 
Yixun Lan (dlan)
Re: (subset) [PATCH v13 0/7] spacemit: introduce P1 PMIC support
Posted by Mark Brown 4 months, 4 weeks ago
On Thu, Sep 11, 2025 at 11:36:41AM -0500, Alex Elder wrote:

> That leaves patch 3, which enables regulator support, and patch
> 4, which adds RTC support.

> How should these two patches be merged?  Mark has reviewed the
> regulator patch 3 and Alexandre has acked the RTC patch 4.

We'd both have been expecting them to go via MFD.
Re: (subset) [PATCH v13 0/7] spacemit: introduce P1 PMIC support
Posted by Lee Jones 4 months, 3 weeks ago
On Thu, 11 Sep 2025, Mark Brown wrote:

> On Thu, Sep 11, 2025 at 11:36:41AM -0500, Alex Elder wrote:
> 
> > That leaves patch 3, which enables regulator support, and patch
> > 4, which adds RTC support.
> 
> > How should these two patches be merged?  Mark has reviewed the
> > regulator patch 3 and Alexandre has acked the RTC patch 4.
> 
> We'd both have been expecting them to go via MFD.

Why?  I don't see any dependencies between them (usually a shared MFD
header-file).  If there are no deps, it should be taken through its own
repo, no?

-- 
Lee Jones [李琼斯]
Re: (subset) [PATCH v13 0/7] spacemit: introduce P1 PMIC support
Posted by Mark Brown 4 months, 3 weeks ago
On Tue, Sep 16, 2025 at 09:42:29AM +0100, Lee Jones wrote:
> On Thu, 11 Sep 2025, Mark Brown wrote:
> > On Thu, Sep 11, 2025 at 11:36:41AM -0500, Alex Elder wrote:

> > > How should these two patches be merged?  Mark has reviewed the
> > > regulator patch 3 and Alexandre has acked the RTC patch 4.

> > We'd both have been expecting them to go via MFD.

> Why?  I don't see any dependencies between them (usually a shared MFD
> header-file).  If there are no deps, it should be taken through its own
> repo, no?

I used to just apply things but at some point Linus complained about
cases where the MFD ended up not getting merged (missing the merge
window or whatever) so I've been treating them like they had an actual
dependency.
Re: (subset) [PATCH v13 0/7] spacemit: introduce P1 PMIC support
Posted by Lee Jones 4 months, 3 weeks ago
On Tue, 16 Sep 2025, Mark Brown wrote:

> On Tue, Sep 16, 2025 at 09:42:29AM +0100, Lee Jones wrote:
> > On Thu, 11 Sep 2025, Mark Brown wrote:
> > > On Thu, Sep 11, 2025 at 11:36:41AM -0500, Alex Elder wrote:
> 
> > > > How should these two patches be merged?  Mark has reviewed the
> > > > regulator patch 3 and Alexandre has acked the RTC patch 4.
> 
> > > We'd both have been expecting them to go via MFD.
> 
> > Why?  I don't see any dependencies between them (usually a shared MFD
> > header-file).  If there are no deps, it should be taken through its own
> > repo, no?
> 
> I used to just apply things but at some point Linus complained about
> cases where the MFD ended up not getting merged (missing the merge
> window or whatever) so I've been treating them like they had an actual
> dependency.

Not sure I've seen any of that from Linus, but I don't doubt you.  The
MFD part has been merged now, so it's save to go ahead and apply the
Regulator part.

-- 
Lee Jones [李琼斯]
Re: (subset) [PATCH v13 0/7] spacemit: introduce P1 PMIC support
Posted by Yixun Lan 4 months, 3 weeks ago
Hi Mark, Jones,

On 13:27 Tue 16 Sep     , Lee Jones wrote:
> On Tue, 16 Sep 2025, Mark Brown wrote:
> 
> > On Tue, Sep 16, 2025 at 09:42:29AM +0100, Lee Jones wrote:
> > > On Thu, 11 Sep 2025, Mark Brown wrote:
> > > > On Thu, Sep 11, 2025 at 11:36:41AM -0500, Alex Elder wrote:
> > 
> > > > > How should these two patches be merged?  Mark has reviewed the
> > > > > regulator patch 3 and Alexandre has acked the RTC patch 4.
> > 
> > > > We'd both have been expecting them to go via MFD.
> > 
> > > Why?  I don't see any dependencies between them (usually a shared MFD
> > > header-file).  If there are no deps, it should be taken through its own
> > > repo, no?
> > 
> > I used to just apply things but at some point Linus complained about
> > cases where the MFD ended up not getting merged (missing the merge
> > window or whatever) so I've been treating them like they had an actual
> > dependency.
> 
> Not sure I've seen any of that from Linus, but I don't doubt you.  The
> MFD part has been merged now, so it's save to go ahead and apply the
> Regulator part.
> 

Forgive me to chim in..

To be honest, I don't really mind which tree the patch to go through.. 

But since the patch 3 has no build time dependency on previous two,
so it should be fair to take via pmu/regulator tree, I've done a check
locally which imply this..

What do you think, Mark?

-- 
Yixun Lan (dlan)
Re: (subset) [PATCH v13 0/7] spacemit: introduce P1 PMIC support
Posted by Mark Brown 4 months, 3 weeks ago
On Mon, 25 Aug 2025 12:20:49 -0500, Alex Elder wrote:
> The SpacemiT P1 is an I2C-controlled PMIC that implements 6 buck
> converters and 12 LDOs.  It contains a load switch, ADC channels,
> GPIOs, a real-time clock, and a watchdog timer.
> 
> This series introduces a multifunction driver for the P1 PMIC as
> well as drivers for its regulators and RTC.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[3/7] regulator: spacemit: support SpacemiT P1 regulators
      commit: 8b84d712ad849172f6bbcad57534b284d942b0b5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Re: (subset) [PATCH v13 0/7] spacemit: introduce P1 PMIC support
Posted by Yixun Lan 3 months, 3 weeks ago
On Mon, 25 Aug 2025 12:20:49 -0500, Alex Elder wrote:
> The SpacemiT P1 is an I2C-controlled PMIC that implements 6 buck
> converters and 12 LDOs.  It contains a load switch, ADC channels,
> GPIOs, a real-time clock, and a watchdog timer.
> 
> This series introduces a multifunction driver for the P1 PMIC as
> well as drivers for its regulators and RTC.
> 
> [...]

Applied, thanks!

[5/7] riscv: dts: spacemit: enable the i2c8 adapter
      https://github.com/spacemit-com/linux/commit/3e8d7309e6260b1d066e733bf3e2e1b6a0d3f82b
[6/7] riscv: dts: spacemit: define fixed regulators
      https://github.com/spacemit-com/linux/commit/1df07a40453fd652132051419140950d47941fe9
[7/7] riscv: dts: spacemit: define regulator constraints
      https://github.com/spacemit-com/linux/commit/09a412d397484e76588707d85ccc37f71e491091

Best regards,
-- 
Yixun Lan