summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@nvidia.com>2011-12-01 14:56:47 -0800
committerSimone Willett <swillett@nvidia.com>2012-02-15 16:50:52 -0800
commitd8d1a1ba8b469b1d177015ab2fe87a97a5af1c73 (patch)
treee05922bfd963530dd993794927685ba1514abcbc /drivers/mfd
parent831adda2f1fbf885212a975a39990135473f7143 (diff)
mfd: tps80031: Natively register pm_power_off
Instead of forcing the board files to register this themselves, just add a bool to the platform data to let the board files opt into this. Change-Id: Ia545f23b95f9727932aaf3f3b64a109dae0f2448 Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com> Reviewed-on: http://git-master/r/83592 Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/tps80031.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mfd/tps80031.c b/drivers/mfd/tps80031.c
index e6bfd475f668..fb6ff3bf4d60 100644
--- a/drivers/mfd/tps80031.c
+++ b/drivers/mfd/tps80031.c
@@ -29,6 +29,7 @@
#include <linux/slab.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
+#include <linux/pm.h>
#include <linux/mfd/core.h>
#include <linux/mfd/tps80031.h>
@@ -498,14 +499,14 @@ int tps80031_get_pmu_version(struct device *dev)
EXPORT_SYMBOL_GPL(tps80031_get_pmu_version);
static struct tps80031 *tps80031_dev;
-int tps80031_power_off(void)
+static void tps80031_power_off(void)
{
struct tps80031_client *tps = &tps80031_dev->tps_clients[SLAVE_ID1];
if (!tps->client)
- return -EINVAL;
+ return;
dev_info(&tps->client->dev, "switching off PMU\n");
- return __tps80031_write(tps->client, TPS80031_PHOENIX_DEV_ON, DEVOFF);
+ __tps80031_write(tps->client, TPS80031_PHOENIX_DEV_ON, DEVOFF);
}
static void tps80031_init_ext_control(struct tps80031 *tps80031,
@@ -1210,6 +1211,9 @@ static int __devinit tps80031_i2c_probe(struct i2c_client *client,
tps80031_debuginit(tps80031);
+ if (pdata->use_power_off && !pm_power_off)
+ pm_power_off = tps80031_power_off;
+
tps80031_dev = tps80031;
return 0;