]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
power: reset: palmas: configure system for reset before issuing reset
authorwahsu <wahsu@nvidia.com>
Mon, 21 Apr 2014 14:39:58 +0000 (20:09 +0530)
committerSimone Willett <swillett@nvidia.com>
Tue, 22 Apr 2014 22:01:40 +0000 (15:01 -0700)
Configure the Palmas for SW cold reset before issuing the COLDRST_SW.

bug 1483874

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

drivers/power/reset/palmas-poweroff.c

index aa55882f2d5883ffd9763e4f0e643c70b78cd07a..6108d1a72c9df609f4d465cd1703fd1217962bde 100644 (file)
@@ -204,6 +204,15 @@ static void palmas_power_reset(void *drv_data)
                        goto reset_direct;
                }
 
+               ret = palmas_update_bits(palmas, PALMAS_PMU_CONTROL_BASE,
+                               PALMAS_SWOFF_COLDRST, PALMAS_SWOFF_COLDRST_SW_RST,
+                                       PALMAS_SWOFF_COLDRST_SW_RST);
+               if (ret < 0) {
+                       dev_err(palmas_pm->dev,
+                               "SWOFF_COLDRST update failed: %d\n", ret);
+                       goto reset_direct;
+               }
+
                ret = palmas_update_bits(palmas, PALMAS_PMU_CONTROL_BASE,
                                PALMAS_DEV_CTRL, PALMAS_DEV_CTRL_SW_RST,
                                PALMAS_DEV_CTRL_SW_RST);
@@ -217,6 +226,9 @@ static void palmas_power_reset(void *drv_data)
 
 reset_direct:
        dev_info(palmas_pm->dev, "Power reset the device\n");
+       palmas_update_bits(palmas, PALMAS_PMU_CONTROL_BASE,
+                       PALMAS_SWOFF_COLDRST, PALMAS_SWOFF_COLDRST_SW_RST,
+                       PALMAS_SWOFF_COLDRST_SW_RST);
        palmas_update_bits(palmas, PALMAS_PMU_CONTROL_BASE,
                                PALMAS_DEV_CTRL, 0x2, 0x2);
 }