linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] regulator: bd9571mwv: Add support for toggle power switches
@ 2018-07-13 15:47 Geert Uytterhoeven
  2018-07-13 15:47 ` [PATCH v3 1/3] regulator: bd9571mwv: Use "backup_mode" sysfs file instead of "wake_up" Geert Uytterhoeven
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2018-07-13 15:47 UTC (permalink / raw)
  To: Marek Vasut, Liam Girdwood, Mark Brown
  Cc: Rafael J . Wysocki, Pavel Machek, Len Brown, linux-pm,
	linux-renesas-soc, linux-kernel, Geert Uytterhoeven

	Hi all,

The ROHM BD9571MWV PMIC on the Renesas Salvator-X(S) and ULCB
development boards supports DDR Backup Power, which means that the DDR
power rails can be kept powered while the main SoC is powered down.

This patch series extends the support for DDR backup mode (see commit
6eb0bfae6973eb6a ("regulator: bd9571mwv: Add support for backup mode"))
to systems with toggle instead of momentary power switches.

With a toggle power switch (or level signal), the following steps must
be followed exactly:
   1. Configure PMIC for backup mode, which changes the role of the
      power switch to a wake-up switch, 
   2. Switch accessory power switch off, to prepare for system suspend,
      which is a manual step not controlled by software,
   3. Suspend system,
   4. Switch accessory power switch on, to resume.

Unlike on systems with a momentary toggle switch, an additional step 2
must be performed in between step 1 and step 3.  Hence step 1 can no
longer be handled in the PMIC's suspend callback.

This patch series allows performing step 1 when the user writes
"on" to the PMIC's "backup_mode" virtual file in sysfs, e.g.

    echo on > /sys/bus/i2c/drivers/bd9571mwv/*/bd9571mwv-regulator*/backup_mode

Conversely, writing "off" reverts the role of the accessory switch to a
power switch.
Note that unlike with momentary switches, backup mode is not enabled by
default, as enabling it prevents the board from being powered off using
the power switch, which may confuse the user.

Changes compared to v2:
  - Drop 'PM / wakeup: Add callback for wake-up change notification',
  - New patch 'regulator: bd9571mwv: Use "backup_mode" sysfs file
    instead of "wake_up"',
  - Replace use of "wake_up" sysfs file and extra callback for wake-up
    change notification by custom "backup_mode" sysfs file,
  - New patch ;regulator: bd9571mwv: Document "backup_mode" sysfs file'.

Changes compared to v1:
  - Improve patch descriptions,
  - Drop "return;" at end of function.

This has been tested on Salvator-XS.

For testing, this series is also available in the
topic/bd9571-toggle-power-switch-v3 branch of my renesas-drivers git
repository at
git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git.

Thanks!

Geert Uytterhoeven (3):
  regulator: bd9571mwv: Use "backup_mode" sysfs file instead of
    "wake_up"
  regulator: bd9571mwv: Add support for toggle power switches
  regulator: bd9571mwv: Document "backup_mode" sysfs file

 .../testing/sysfs-driver-bd9571mwv-regulator  | 27 ++++++++
 drivers/regulator/bd9571mwv-regulator.c       | 69 +++++++++++++++++--
 2 files changed, 90 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-bd9571mwv-regulator

-- 
2.17.1


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

end of thread, other threads:[~2018-07-16  8:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-13 15:47 [PATCH v3 0/3] regulator: bd9571mwv: Add support for toggle power switches Geert Uytterhoeven
2018-07-13 15:47 ` [PATCH v3 1/3] regulator: bd9571mwv: Use "backup_mode" sysfs file instead of "wake_up" Geert Uytterhoeven
2018-07-13 20:08   ` Geert Uytterhoeven
2018-07-13 15:47 ` [PATCH v3 2/3] regulator: bd9571mwv: Add support for toggle power switches Geert Uytterhoeven
2018-07-13 15:47 ` [PATCH v3 3/3] regulator: bd9571mwv: Document "backup_mode" sysfs file Geert Uytterhoeven
2018-07-15 16:59   ` Pavel Machek
2018-07-15 16:57 ` [PATCH v3 0/3] regulator: bd9571mwv: Add support for toggle power switches Pavel Machek
2018-07-16  8:58   ` Geert Uytterhoeven

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