summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPrashant Gaikwad <pgaikwad@nvidia.com>2011-03-10 16:23:37 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-03-10 21:42:10 -0800
commit8bb77ffa20e159e611ac3c629cce6fdc3db26f00 (patch)
tree0b933d4997f5d38b1ce2217eb72ad9c1bd4c0a71 /drivers
parenta8dbfda58a6980976de60ba46f22a5f0b2ecab5f (diff)
mfd: max8907c: Add api to power off max8907c
Add an api to power off max8907c by setting power off bit in RESET_CNFG reg. Bug 799957 Bug 800602 (Cold boot) Change-Id: Ie0206d684a86fecc75273c1d3b087bb2d47b4c56 Reviewed-on: http://git-master/r/22385 Tested-by: Prashant Gaikwad <pgaikwad@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/max8907c.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mfd/max8907c.c b/drivers/mfd/max8907c.c
index 8475c4be50e9..8bf47822f5c3 100644
--- a/drivers/mfd/max8907c.c
+++ b/drivers/mfd/max8907c.c
@@ -151,6 +151,16 @@ int max8907c_set_bits(struct i2c_client *i2c, u8 reg, u8 mask, u8 val)
}
EXPORT_SYMBOL_GPL(max8907c_set_bits);
+static struct i2c_client *max8907c_client = NULL;
+int max8907c_power_off(void)
+{
+ if (!max8907c_client)
+ return -EINVAL;
+
+ return max8907c_set_bits(max8907c_client, MAX8907C_REG_RESET_CNFG,
+ MAX8907C_MASK_POWER_OFF, 0x40);
+}
+
static int max8907c_remove_subdev(struct device *dev, void *unused)
{
platform_device_unregister(to_platform_device(dev));
@@ -222,6 +232,8 @@ static int max8907c_i2c_probe(struct i2c_client *i2c,
return ret;
}
+ max8907c_client = i2c;
+
max8907c_irq_init(max8907c, i2c->irq, pdata->irq_base);
ret = max8097c_add_subdevs(max8907c, pdata);