]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
power: reset: max77620: add support to ignore final power off commands
authorLaxman Dewangan <ldewangan@nvidia.com>
Fri, 6 Nov 2015 14:23:38 +0000 (19:53 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Tue, 10 Nov 2015 23:01:30 +0000 (15:01 -0800)
Add support to not issue final power off commands for PMIC if there
is soc specific power off sequence is available.

This is required to do the power off sequence by SoC per their system
requirements.

bug 200146310

Change-Id: I932c2044d4f2942dd7e234185b88720ebcd676ee
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/829396
GVS: Gerrit_Virtual_Submit

drivers/power/reset/max77620-poweroff.c

index abfb2d442527dd6b661c0b7c6e946aef461d66a6..02e05ca59f4171afae61ae98f5f6f2b8cd5162bd 100644 (file)
@@ -134,6 +134,9 @@ static void max77620_auto_power_on(struct max77620_poweroff *max77620_poweroff)
        usleep_range(16000, 16000);
        max77620_allow_atomic_xfer(max77620_poweroff->max77620);
 
+       if (soc_specific_power_off)
+               return;
+
        ret = max77620_reg_update(max77620_poweroff->max77620->dev,
                MAX77620_PWR_SLAVE, MAX77620_REG_ONOFFCNFG2,
                MAX77620_ONOFFCNFG2_SFT_RST_WK, 0);
@@ -233,8 +236,13 @@ static void max77620_pm_power_off(void *drv_data)
 
        _max77620_prepare_system_power_off(max77620_poweroff);
 
-       if (max77620_poweroff->need_rtc_power_on)
+       if (max77620_poweroff->need_rtc_power_on) {
                max77620_auto_power_on(max77620_poweroff);
+               return;
+       }
+
+       if (soc_specific_power_off)
+               return;
 
        ret = max77620_reg_update(max77620_poweroff->max77620->dev,
                MAX77620_PWR_SLAVE, MAX77620_REG_ONOFFCNFG2,