summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattis fjallstrom <mattis@acm.org>2015-07-17 18:40:17 -0700
committermattis fjallstrom <mattis@acm.org>2015-07-17 18:40:17 -0700
commitdd455b3d69e62139bfe3a1c39121b8697027e0af (patch)
tree777ba41402132da5dd4f6970dc92f084e3f0b06a
parent6ce10676426f47b6592ceffb9a9c3f13f1e7b741 (diff)
downloadolio-linux-3.10-dd455b3d69e62139bfe3a1c39121b8697027e0af.tar.xz
olio-linux-3.10-dd455b3d69e62139bfe3a1c39121b8697027e0af.zip
Refactor fixes for tps65910
Change-Id: I8aee8f4304aa1ef8e9607f4674487d8e32ff5eaa
-rw-r--r--arch/arm/boot/dts/omap3_h1.dts3
-rw-r--r--drivers/mfd/tps65910.c34
-rw-r--r--include/linux/mfd/tps65910.h3
3 files changed, 24 insertions, 16 deletions
diff --git a/arch/arm/boot/dts/omap3_h1.dts b/arch/arm/boot/dts/omap3_h1.dts
index a3e92d76f1f..5673768878d 100644
--- a/arch/arm/boot/dts/omap3_h1.dts
+++ b/arch/arm/boot/dts/omap3_h1.dts
@@ -300,6 +300,9 @@
interrupt-controller;
ti,en-ck32k-xtal;
+ ti,en-dev-slp;
+ ti,sleepsig-pol;
+ ti,clkout32k-keepon;
/* set SR_CTL_I2C_SEL - access to smartreflex registers by control i2c */
ti,system-power-controller;
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index dbf85fc07d2..1e7ef2a2e35 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -363,7 +363,13 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
dev = tps65910->dev;
- /* set polarity of SLLEEPSIG requst ot enter OFF mode */
+ if (!pmic_pdata->en_dev_slp)
+ return 0;
+
+ /*
+ * set polarity of SLLEEPSIG requst to enter OFF mode
+ * before enabling sleep
+ */
ret = tps65910_reg_set_bits(tps65910, TPS65910_DEVCTRL2,
DEVCTRL2_SLEEPSIG_POL_MASK);
if (ret < 0) {
@@ -379,18 +385,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
goto err_sleep_init;
}
- ret = tps65910_reg_set_bits(tps65910, TPS65910_SLEEP_KEEP_RES_ON,
- SLEEP_KEEP_RES_ON_CLKOUT32K_KEEPON_MASK);
- if (ret < 0) {
- dev_err(dev, "set sleep_keep_res_on failed: %d\n", ret);
- goto err_sleep_init;
- }
-
- /* Return if there is no sleep keepon data. */
- if (!pmic_pdata->slp_keepon)
- return 0;
-
- if (pmic_pdata->slp_keepon->therm_keepon) {
+ if (pmic_pdata->slp_keepon.therm_keepon) {
ret = tps65910_reg_set_bits(tps65910,
TPS65910_SLEEP_KEEP_RES_ON,
SLEEP_KEEP_RES_ON_THERM_KEEPON_MASK);
@@ -400,7 +395,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
}
}
- if (pmic_pdata->slp_keepon->clkout32k_keepon) {
+ if (pmic_pdata->slp_keepon.clkout32k_keepon) {
ret = tps65910_reg_set_bits(tps65910,
TPS65910_SLEEP_KEEP_RES_ON,
SLEEP_KEEP_RES_ON_CLKOUT32K_KEEPON_MASK);
@@ -410,7 +405,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
}
}
- if (pmic_pdata->slp_keepon->i2chs_keepon) {
+ if (pmic_pdata->slp_keepon.i2chs_keepon) {
ret = tps65910_reg_set_bits(tps65910,
TPS65910_SLEEP_KEEP_RES_ON,
SLEEP_KEEP_RES_ON_I2CHS_KEEPON_MASK);
@@ -477,6 +472,15 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
prop = of_property_read_bool(np, "ti,en-ck32k-xtal");
board_info->en_ck32k_xtal = prop;
+ prop = of_property_read_bool(np, "ti,en-dev-slp");
+ board_info->en_dev_slp = prop;
+
+ prop = of_property_read_bool(np, "ti,sleepsig-pol");
+ board_info->sleepsig_pol = prop;
+
+ prop = of_property_read_bool(np, "ti,clkout32k-keepon");
+ board_info->slp_keepon.clkout32k_keepon = prop;
+
board_info->irq = client->irq;
board_info->irq_base = -1;
board_info->pm_off = of_property_read_bool(np,
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index 20e433e551e..7f0ec4340a3 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -878,8 +878,9 @@ struct tps65910_board {
int vmbch2_threshold;
bool en_ck32k_xtal;
bool en_dev_slp;
+ bool sleepsig_pol;
bool pm_off;
- struct tps65910_sleep_keepon_data *slp_keepon;
+ struct tps65910_sleep_keepon_data slp_keepon;
bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO];
unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS];
struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS];