summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd')
-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);