]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mfd: sec-core: Prepare regulators for suspend state to reduce power-consumption
authorChanwoo Choi <cw00.choi@samsung.com>
Wed, 25 Jun 2014 07:14:47 +0000 (16:14 +0900)
committerLee Jones <lee.jones@linaro.org>
Wed, 9 Jul 2014 13:58:12 +0000 (14:58 +0100)
This patch use regulator_suspend_prepare() function to prepare the proper state
of regulators for suspend state to remove un-necessary leakage power-consumption.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/Kconfig
drivers/mfd/sec-core.c

index defe58d6594096e12d7fad39650da690cde1ff37..b8d9ca0b68e22668b07b6e28a8623db80e209da4 100644 (file)
@@ -587,6 +587,7 @@ config MFD_SEC_CORE
        select MFD_CORE
        select REGMAP_I2C
        select REGMAP_IRQ
+       select REGULATOR
        help
         Support for the Samsung Electronics MFD series.
         This driver provides common support for accessing the device,
index 2621328851ba1e18e8c52a45b7f2fe3969f1195b..fb8ba6438268dd2e6f47e32a837b9f6e39d7b4d4 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/mfd/samsung/s2mpu02.h>
 #include <linux/mfd/samsung/s5m8763.h>
 #include <linux/mfd/samsung/s5m8767.h>
+#include <linux/regulator/machine.h>
 #include <linux/regmap.h>
 
 static const struct mfd_cell s5m8751_devs[] = {
@@ -430,6 +431,15 @@ static int sec_pmic_suspend(struct device *dev)
         */
        disable_irq(sec_pmic->irq);
 
+       switch (sec_pmic->device_type) {
+       case S2MPS14X:
+       case S2MPU02:
+               regulator_suspend_prepare(PM_SUSPEND_MEM);
+               break;
+       default:
+               break;
+       }
+
        return 0;
 }