linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] mfd: sprd-sc27xx: Move poweroff/reboot support to the parent MFD driver
@ 2025-11-10 19:08 Otto Pflüger
  2025-11-10 19:08 ` [PATCH v2 1/3] mfd: sprd-sc27xx: Integrate power off and reboot support Otto Pflüger
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Otto Pflüger @ 2025-11-10 19:08 UTC (permalink / raw)
  To: Lee Jones, Orson Zhai, Baolin Wang, Chunyan Zhang, Mark Brown,
	Sebastian Reichel
  Cc: Rob Herring, linux-kernel, linux-spi, linux-pm, Otto Pflüger,
	Sebastian Reichel

Registers for powering off the system are present in all SC27xx-series
PMICs, although their locations vary between the specific PMIC models.
On systems using these chips, the PMIC can always power off the system
and is usually the only chip capable of doing this. Similarly, the PMICs
(except for SC2731) contain a reset register that can always be used to
restart the system.

There is an existing sc27xx-poweroff driver, but it currently only works
on SC2731 and is not probed anywhere since it is missing an OF match
table and is not instantiated by the MFD driver. Reboot for SC2731 is
implemented in drivers/spi/spi-sprd-adi.c, which is not really an
appropriate location for PMIC-specific code.

Since a separate device tree node for the poweroff support would not
provide anything useful (see [1]) and passing platform-specific data
between drivers is unnecessarily complex for such a simple feature,
reimplement the poweroff functionality in the main MFD driver. While at
it, add support for the newer SC2730 PMIC and its hardware reset
register.

Reboot is special because it requires storing the reboot mode. Move the
existing code for this from the SPI bus driver to the MFD driver.

[1]: https://lore.kernel.org/all/20251002025344.GA2958334-robh@kernel.org/

Signed-off-by: Otto Pflüger <otto.pflueger@abscue.de>
---
Changes in v2:
- Fix style issues in MFD driver
- Use dev_err instead of pr_emerg
- Link to v1: https://lore.kernel.org/r/20251007-sc27xx-mfd-poweroff-v1-0-89a2f919b731@abscue.de

---
Otto Pflüger (3):
      mfd: sprd-sc27xx: Integrate power off and reboot support
      spi: sprd-adi: Remove code for storing the reboot mode
      power: reset: sc27xx: Drop unused driver

 drivers/mfd/sprd-sc27xx-spi.c         | 148 ++++++++++++++++++++++++++++++++++
 drivers/power/reset/Kconfig           |   9 ---
 drivers/power/reset/Makefile          |   1 -
 drivers/power/reset/sc27xx-poweroff.c |  79 ------------------
 drivers/spi/spi-sprd-adi.c            |  73 +----------------
 5 files changed, 149 insertions(+), 161 deletions(-)
---
base-commit: ab40c92c74c6b0c611c89516794502b3a3173966
change-id: 20251007-sc27xx-mfd-poweroff-9cf728d55fed

Best regards,
-- 
Otto Pflüger <otto.pflueger@abscue.de>


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

end of thread, other threads:[~2025-11-26 15:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-10 19:08 [PATCH v2 0/3] mfd: sprd-sc27xx: Move poweroff/reboot support to the parent MFD driver Otto Pflüger
2025-11-10 19:08 ` [PATCH v2 1/3] mfd: sprd-sc27xx: Integrate power off and reboot support Otto Pflüger
2025-11-20 15:30   ` Lee Jones
2025-11-23 17:34     ` Otto Pflüger
2025-11-26 15:36       ` Lee Jones
2025-11-10 19:08 ` [PATCH v2 2/3] spi: sprd-adi: Remove code for storing the reboot mode Otto Pflüger
2025-11-10 19:09 ` [PATCH v2 3/3] power: reset: sc27xx: Drop unused driver Otto Pflüger
2025-11-19  6:33 ` [PATCH v2 0/3] mfd: sprd-sc27xx: Move poweroff/reboot support to the parent MFD driver Baolin Wang
2025-11-21  2:29   ` Cixi Geng

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).