summaryrefslogtreecommitdiff
path: root/drivers/misc/c55_ctrl.c
diff options
context:
space:
mode:
authorw20740 <w20740@motorola.com>2014-01-13 19:04:58 -0600
committerJames Wylder <jwylder@motorola.com>2014-03-05 17:47:04 -0600
commit7a54560f9e68174afc12c3b49cb0b75624d3090c (patch)
treee309b1057fb836a85650f1d2a8aff88040174257 /drivers/misc/c55_ctrl.c
parent3ed2387a28b941fb73dcd87d260c44fa54f9501b (diff)
downloadolio-linux-3.10-7a54560f9e68174afc12c3b49cb0b75624d3090c.tar.xz
olio-linux-3.10-7a54560f9e68174afc12c3b49cb0b75624d3090c.zip
IKXCLOCK-79 Enable regulator when C55 initialized and enable loadswitch when LDO9 is turned on
Author: Jee Su Chang - w20740 Change-Id: I5376c4da70385fccf9cc576df66775f7d25a0ec0 Reviewed-on: http://gerrit.pcs.mot.com/603308 SLTApproved: Slta Waiver <sltawvr@motorola.com> Tested-by: Jira Key <jirakey@motorola.com> Reviewed-by: Douglas Zobel <dzobel1@motorola.com> Reviewed-by: Viditha Hanumanthareddy <ngjq36@motorola.com> Submit-Approved: Jira Key <jirakey@motorola.com>
Diffstat (limited to 'drivers/misc/c55_ctrl.c')
-rw-r--r--drivers/misc/c55_ctrl.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/misc/c55_ctrl.c b/drivers/misc/c55_ctrl.c
index 04f29d3ff9a..3c116987e3d 100644
--- a/drivers/misc/c55_ctrl.c
+++ b/drivers/misc/c55_ctrl.c
@@ -17,6 +17,7 @@
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/platform_device.h>
+#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/wakelock.h>
#include <linux/of.h>
@@ -26,6 +27,7 @@
struct c55_ctrl_data {
int int_gpio;
struct wake_lock wake_lock;
+ struct regulator *reg;
};
#define NUM_GPIOS 3
@@ -138,6 +140,17 @@ static int c55_ctrl_probe(struct platform_device *pdev)
return ret;
}
+ cdata->reg = regulator_get(&pdev->dev, "c55-ctrl");
+ if (IS_ERR(cdata->reg)) {
+ return PTR_ERR(cdata->reg);
+ }
+ ret = regulator_enable(cdata->reg);
+ if (ret) {
+ dev_err(&pdev->dev, "%s: c55_ctrl regulator_enable failed.\n", __func__);
+ regulator_put(cdata->reg);
+ return ret;
+ }
+
wake_lock_init(&cdata->wake_lock, WAKE_LOCK_SUSPEND, "c55_ctrl");
platform_set_drvdata(pdev, cdata);
@@ -146,6 +159,9 @@ static int c55_ctrl_probe(struct platform_device *pdev)
static int c55_ctrl_remove(struct platform_device *pdev)
{
+ struct c55_ctrl_data *cdata = platform_get_drvdata(pdev);
+
+ regulator_put(cdata->reg);
return 0;
}