summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorDanny Nold <dannynold@freescale.com>2011-11-03 13:05:36 -0500
committerJason Liu <r64343@freescale.com>2012-01-09 21:06:15 +0800
commit2e5731626d19f95480ad0a368fbd68d2b3f3ebca (patch)
tree861e24c0ee5ae9bc9e08b2757d41513f02683472 /drivers/regulator
parentda7e5127af69c075bce2047228a03d209c0022c2 (diff)
ENGR00143921-1 - EPDC/MAX17135: Add controls for V3P3 regulator
- Added V3P3 regulator to max17135 - Added calls to enable/disable V3P3 regulator from EPDC driver - Improved Kconfig detail for max17135 MFD and HWMON entries Signed-off-by: Danny Nold <dannynold@freescale.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/max17135-regulator.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/regulator/max17135-regulator.c b/drivers/regulator/max17135-regulator.c
index 97bf2aff8b3f..45d4501ef7a5 100644
--- a/drivers/regulator/max17135-regulator.c
+++ b/drivers/regulator/max17135-regulator.c
@@ -354,6 +354,33 @@ static int max17135_display_is_enabled(struct regulator_dev *reg)
return 1;
}
+static int max17135_v3p3_enable(struct regulator_dev *reg)
+{
+ struct max17135 *max17135 = rdev_get_drvdata(reg);
+
+ gpio_set_value(max17135->gpio_pmic_v3p3, 1);
+ return 0;
+}
+
+static int max17135_v3p3_disable(struct regulator_dev *reg)
+{
+ struct max17135 *max17135 = rdev_get_drvdata(reg);
+
+ gpio_set_value(max17135->gpio_pmic_v3p3, 0);
+ return 0;
+}
+
+static int max17135_v3p3_is_enabled(struct regulator_dev *reg)
+{
+ struct max17135 *max17135 = rdev_get_drvdata(reg);
+ int gpio = gpio_get_value(max17135->gpio_pmic_v3p3);
+
+ if (gpio == 0)
+ return 0;
+ else
+ return 1;
+}
+
/*
* Regulator operations
*/
@@ -394,6 +421,13 @@ static struct regulator_ops max17135_vneg_ops = {
static struct regulator_ops max17135_vpos_ops = {
};
+static struct regulator_ops max17135_v3p3_ops = {
+ .enable = max17135_v3p3_enable,
+ .disable = max17135_v3p3_disable,
+ .is_enabled = max17135_v3p3_is_enabled,
+};
+
+
/*
* Regulator descriptors
*/
@@ -454,6 +488,13 @@ static struct regulator_desc max17135_reg[MAX17135_NUM_REGULATORS] = {
.type = REGULATOR_VOLTAGE,
.owner = THIS_MODULE,
},
+{
+ .name = "V3P3",
+ .id = MAX17135_V3P3,
+ .ops = &max17135_v3p3_ops,
+ .type = REGULATOR_VOLTAGE,
+ .owner = THIS_MODULE,
+},
};
static void max17135_setup_timings(struct max17135 *max17135)