aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>2012-02-06 16:37:33 +0200
committerZiyann <jaraidaniel@gmail.com>2014-10-01 12:57:35 +0200
commit0fe5e672ab78a75ca1e35a03bf053476006f74c8 (patch)
treecd51617f2d180729cd4959c8b898d3a39d289195
parent1b5653d1ad664dc35c277e513503618c786d1a62 (diff)
downloadkernel_samsung_tuna-0fe5e672ab78a75ca1e35a03bf053476006f74c8.zip
kernel_samsung_tuna-0fe5e672ab78a75ca1e35a03bf053476006f74c8.tar.gz
kernel_samsung_tuna-0fe5e672ab78a75ca1e35a03bf053476006f74c8.tar.bz2
MFD: TWL: Regulator: Add support for SYSEN
Previously SYSEN pin was configured only for the OMAP4460. SYSEN is added to platform data, so that it can be modelled as an regulator and the state of it can be controlled through drivers and board file. Change-Id: I7ec8d690f94d0143563b904844ef9155eef20a17 Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
-rw-r--r--drivers/mfd/twl-core.c5
-rw-r--r--drivers/regulator/twl-regulator.c26
-rw-r--r--include/linux/i2c/twl.h6
3 files changed, 37 insertions, 0 deletions
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 7451699..8992ee7 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -1046,6 +1046,11 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
pdata->clk32kaudio, features);
if (IS_ERR(child))
return PTR_ERR(child);
+
+ child = add_regulator(TWL6030_REG_SYSEN,
+ pdata->sysen, features);
+ if (IS_ERR(child))
+ return PTR_ERR(child);
}
/* twl6032 regulators */
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index 1632e77..5894487 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -920,6 +920,18 @@ static struct regulator_ops twlsmps_ops = {
.set_suspend_disable = twl6030ldo_suspend_disable,
};
+static struct regulator_ops twl6030_external_control_pin_ops = {
+ .enable = twl6030reg_enable,
+ .disable = twl6030reg_disable,
+ .is_enabled = twl6030reg_is_enabled,
+
+ .set_mode = twl6030reg_set_mode,
+
+ .get_status = twl6030reg_get_status,
+
+ .set_suspend_enable = twl6030ldo_suspend_enable,
+ .set_suspend_disable = twl6030ldo_suspend_disable,
+};
/*----------------------------------------------------------------------*/
#define TWL4030_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \
@@ -1032,6 +1044,18 @@ static struct regulator_ops twlsmps_ops = {
}, \
}
+#define TWL6030_EXTERNAL_CONTROL_PIN(label, offset, turnon_delay) { \
+ .base = offset, \
+ .delay = turnon_delay, \
+ .desc = { \
+ .name = #label, \
+ .id = TWL6030_REG_##label, \
+ .ops = &twl6030_external_control_pin_ops, \
+ .type = REGULATOR_VOLTAGE, \
+ .owner = THIS_MODULE, \
+ }, \
+ }
+
/*
* We list regulators here if systems need some level of
* software control over them after boot.
@@ -1094,6 +1118,8 @@ static struct twlreg_info twl_regs[] = {
TWL6032_ADJUSTABLE_SMPS(SMPS3, 0x34),
TWL6032_ADJUSTABLE_SMPS(SMPS4, 0x10),
TWL6032_ADJUSTABLE_SMPS(VIO, 0x16),
+
+ TWL6030_EXTERNAL_CONTROL_PIN(SYSEN, 0x83, 0),
};
static u8 twl_get_smps_offset(void)
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index bed388f..8717499 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -822,6 +822,9 @@ struct twl4030_platform_data {
struct regulator_init_data *smps3;
struct regulator_init_data *smps4;
struct regulator_init_data *vio6032;
+
+ /* External control pins */
+ struct regulator_init_data *sysen;
};
/*----------------------------------------------------------------------*/
@@ -921,4 +924,7 @@ static inline int twl4030charger_usb_en(int enable) { return 0; }
#define TWL6030_REG_CLK32KAUDIO 61
+/* External control pins */
+#define TWL6030_REG_SYSEN 62
+
#endif /* End of __TWL4030_H */