linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v8 0/8] spacemit: introduce P1 PMIC support
@ 2025-07-10 17:50 Alex Elder
  2025-07-10 17:50 ` [PATCH v8 1/8] dt-bindings: mfd: add support the SpacemiT P1 PMIC Alex Elder
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Alex Elder @ 2025-07-10 17:50 UTC (permalink / raw)
  To: lee, lgirdwood, broonie, alexandre.belloni, robh, krzk+dt,
	conor+dt
  Cc: mat.jonczyk, dlan, paul.walmsley, palmer, aou, alex,
	troymitchell988, guodong, linux-rtc, devicetree, linux-riscv,
	spacemit, linux-kernel

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.

Version 7 provided the ability in "simple-mfd-i2c.c" to specify the
max_register value for the regmap configuration as an alternative
to providing a "full" regmap structure.  The max_register value is
ignored if a regmap_config is also supplied in simple_mfd_data.

Lee Jones felt the logic in v7 was more complex than it needed to
be, and suggested removing the const qualifier from the global
regmap_config structure used by default.

This version does what Lee suggested, and the logic is indeed
simpler.  However in order to avoid compile warnings the const
qualifier was removed from other places as well.  (Checkpatch
even complains about this.)

Frankly I think my original solution--which simply used the
existing ability to provide a regmap_config structure--was the
best (version 5 of the series is done this way).  I don't think
adding simple_mfd_data->max_register provides real benefit.
  https://lore.kernel.org/lkml/20250625164119.1068842-1-elder@riscstar.com/

					-Alex

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

Between version 7 and version 8:
  - Change the global regmap_config to not be const in patch 2.

Here is version 7 of this series:
  https://lore.kernel.org/lkml/20250702213658.545163-1-elder@riscstar.com/
  
Between version 6 and version 7:
  - Revise patch 2 to preserve the option to provide a full regmap config

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

Between version 5 and version 6:
  - Added Rob Herring's reviewed-by to patch 1
  - Add the simple MFD functionality suggested by Lee Jones
  - Update patch 3 (previously 2) accordingly

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

Between version 4 and version 5:
  - Only check the seconds register for change when looping on read
  - Return without re-enabling the RTC if writing registers fails
  - If the RTC is disabled when reading, return an error

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

More complete history is available at that link.


Alex Elder (8):
  dt-bindings: mfd: add support the SpacemiT P1 PMIC
  mfd: simple-mfd-i2c: specify max_register
  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      | 138 +++++++++++++++
 arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi  |   7 +
 arch/riscv/boot/dts/spacemit/k1.dtsi          |  11 ++
 drivers/mfd/Kconfig                           |  11 ++
 drivers/mfd/simple-mfd-i2c.c                  |  20 ++-
 drivers/mfd/simple-mfd-i2c.h                  |   3 +-
 drivers/regulator/Kconfig                     |  12 ++
 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 ++++++++++++++++++
 13 files changed, 621 insertions(+), 3 deletions(-)
 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: b551c4e2a98a177a06148cf16505643cd2108386
-- 
2.45.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-07-24 10:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-10 17:50 [PATCH v8 0/8] spacemit: introduce P1 PMIC support Alex Elder
2025-07-10 17:50 ` [PATCH v8 1/8] dt-bindings: mfd: add support the SpacemiT P1 PMIC Alex Elder
2025-07-10 17:51 ` [PATCH v8 2/8] mfd: simple-mfd-i2c: specify max_register Alex Elder
2025-07-23  9:51   ` Lee Jones
2025-07-23 12:42     ` Alex Elder
2025-07-24 10:14       ` Lee Jones
2025-07-10 17:51 ` [PATCH v8 3/8] mfd: simple-mfd-i2c: add SpacemiT P1 support Alex Elder
2025-07-10 17:51 ` [PATCH v8 4/8] regulator: spacemit: support SpacemiT P1 regulators Alex Elder
2025-07-10 17:51 ` [PATCH v8 5/8] rtc: spacemit: support the SpacemiT P1 RTC Alex Elder
2025-07-23 21:39   ` Alexandre Belloni
2025-07-23 23:37     ` Alex Elder
2025-07-10 17:51 ` [PATCH v8 6/8] riscv: dts: spacemit: enable the i2c8 adapter Alex Elder
2025-07-10 17:51 ` [PATCH v8 7/8] riscv: dts: spacemit: define fixed regulators Alex Elder
2025-07-10 17:51 ` [PATCH v8 8/8] riscv: dts: spacemit: define regulator constraints Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).