Skip to content
  • Geert Uytterhoeven's avatar
    regulator: bd9571mwv: Add support for backup mode · 6eb0bfae
    Geert Uytterhoeven authored
    
    
    The BD9571MWV PMIC supports backup mode, which keeps one or more DDR
    rails powered while the main SoC is powered down.
    
    Which DDR rails are to be kept powered is board-specific, and controlled
    using the optional "rohm,ddr-backup-power" DT property.  In the absence
    of this property, backup mode is not available.
    
    Backup mode can be enabled or disabled by the user using the standard
    "wakeup" virtual file in sysfs, e.g. to enable:
    
        echo enabled > /sys/devices/platform/soc/e60b0000.i2c/i2c-7/7-0030/bd9571mwv-regulator.2.auto/power/wakeup
    
    When the PMIC is configured for backup mode, the role of the accessory
    power switch changes from a power switch to a wake-up switch.
    Two types of switches (or signals) can be used:
      A. With a momentary power switch (or pulse signal), the PMIC is
         configured for backup mode in the PMIC driver's suspend callback,
         during system suspend.
         Backup mode is enabled by default, as there is no further impact
         during normal system operation.
    
      B. With a toggle power switch (or level signal), the following steps
         must be followed exactly:
           1. Configure PMIC for backup mode,
           2. Switch accessory power switch off, to prepare for system
              suspend, which is a manual step not controlled by software,
           3. Suspend system.
         This mode is not yet supported by the driver.
    
    As the switch type is board-specific, and cannot be determined
    automatically, it is obtained from the presence of one of the
    "rohm,rstbmode-*" properties in DT.
    
    Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
    Acked-by: default avatarLee Jones <lee.jones@linaro.org>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    6eb0bfae