linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V1 1/2] mfd: tps65910: Use correct variable name for regmap config
@ 2012-03-07 13:16 Laxman Dewangan
  2012-03-07 13:16 ` [PATCH V2 2/2] mfd: tps65910: Add support for device sleep Laxman Dewangan
  2012-03-16 17:53 ` [PATCH V1 1/2] mfd: tps65910: Use correct variable name for regmap config Samuel Ortiz
  0 siblings, 2 replies; 4+ messages in thread
From: Laxman Dewangan @ 2012-03-07 13:16 UTC (permalink / raw)
  To: sameo, broonie, jedu, lrg; +Cc: linux-kernel, linux-tegra, ldewangan

This was the copy-paste issue in reg cache support code where
variable name for regmap config was not really starting from
the device name, it was starting from some other device name.
Fixing this so that variable name contains actual device name.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
This is just variable name change.

 drivers/mfd/tps65910.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index 1c4f53e..bf2b25e 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -81,7 +81,7 @@ static bool is_volatile_reg(struct device *dev, unsigned int reg)
 	return true;
 }
 
-static const struct regmap_config rc5t583_regmap_config = {
+static const struct regmap_config tps65910_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
 	.volatile_reg = is_volatile_reg,
@@ -120,7 +120,7 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
 	tps65910->write = tps65910_i2c_write;
 	mutex_init(&tps65910->io_mutex);
 
-	tps65910->regmap = regmap_init_i2c(i2c, &rc5t583_regmap_config);
+	tps65910->regmap = regmap_init_i2c(i2c, &tps65910_regmap_config);
 	if (IS_ERR(tps65910->regmap)) {
 		ret = PTR_ERR(tps65910->regmap);
 		dev_err(&i2c->dev, "regmap initialization failed: %d\n", ret);
-- 
1.7.1.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH V2 2/2] mfd: tps65910: Add support for device sleep
  2012-03-07 13:16 [PATCH V1 1/2] mfd: tps65910: Use correct variable name for regmap config Laxman Dewangan
@ 2012-03-07 13:16 ` Laxman Dewangan
  2012-03-16 17:55   ` Samuel Ortiz
  2012-03-16 17:53 ` [PATCH V1 1/2] mfd: tps65910: Use correct variable name for regmap config Samuel Ortiz
  1 sibling, 1 reply; 4+ messages in thread
From: Laxman Dewangan @ 2012-03-07 13:16 UTC (permalink / raw)
  To: sameo, broonie, jedu, lrg; +Cc: linux-kernel, linux-tegra, ldewangan

Adding support for device sleep through the external
input control signal "SLEEP".
Changing the SLEEP signal state can switch the device
into SLEEP and ACTIVE state.
Also adding sleep configuration for different resources
so that they should be keep on during sleep state of
device.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
 drivers/mfd/tps65910.c       |   62 ++++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/tps65910.h |   14 +++++++++
 2 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index bf2b25e..ae7f47b 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -90,6 +90,66 @@ static const struct regmap_config tps65910_regmap_config = {
 	.cache_type = REGCACHE_RBTREE,
 };
 
+static int __init tps65910_sleepinit(struct tps65910 *tps65910,
+		struct tps65910_board *pmic_pdata)
+{
+	struct device *dev = NULL;
+	int ret = 0;
+
+	dev = tps65910->dev;
+
+	if (!pmic_pdata->en_dev_slp)
+		return 0;
+
+	/* enabling SLEEP device state */
+	ret = tps65910_set_bits(tps65910, TPS65910_DEVCTRL,
+				DEVCTRL_DEV_SLP_MASK);
+	if (ret < 0) {
+		dev_err(dev, "set dev_slp 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) {
+		ret = tps65910_set_bits(tps65910, TPS65910_SLEEP_KEEP_RES_ON,
+				SLEEP_KEEP_RES_ON_THERM_KEEPON_MASK);
+		if (ret < 0) {
+			dev_err(dev, "set therm_keepon failed: %d\n", ret);
+			goto disable_dev_slp;
+		}
+	}
+
+	if (pmic_pdata->slp_keepon->clkout32k_keepon) {
+		ret = tps65910_set_bits(tps65910, TPS65910_SLEEP_KEEP_RES_ON,
+				SLEEP_KEEP_RES_ON_CLKOUT32K_KEEPON_MASK);
+		if (ret < 0) {
+			dev_err(dev, "set clkout32k_keepon failed: %d\n", ret);
+			goto disable_dev_slp;
+		}
+	}
+
+	if (pmic_pdata->slp_keepon->i2chs_keepon) {
+		ret = tps65910_set_bits(tps65910, TPS65910_SLEEP_KEEP_RES_ON,
+				SLEEP_KEEP_RES_ON_I2CHS_KEEPON_MASK);
+		if (ret < 0) {
+			dev_err(dev, "set i2chs_keepon failed: %d\n", ret);
+			goto disable_dev_slp;
+		}
+	}
+
+	return 0;
+
+disable_dev_slp:
+	tps65910_clear_bits(tps65910, TPS65910_DEVCTRL, DEVCTRL_DEV_SLP_MASK);
+
+err_sleep_init:
+	return ret;
+}
+
+
 static int tps65910_i2c_probe(struct i2c_client *i2c,
 			    const struct i2c_device_id *id)
 {
@@ -140,6 +200,8 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
 
 	tps65910_irq_init(tps65910, init_data->irq, init_data);
 
+	tps65910_sleepinit(tps65910, pmic_plat_data);
+
 	kfree(init_data);
 	return ret;
 
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index 06a4cd6..3c87d40 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -782,6 +782,18 @@
 /* TPS65911 names the EN3 signal as SLEEP */
 #define TPS65911_SLEEP_CONTROL_EXT_INPUT_SLEEP		0x4
 
+/*
+ * Sleep keepon data: Maintains the state in sleep mode
+ * @therm_keepon: Keep on the thermal monitoring in sleep state.
+ * @clkout32k_keepon: Keep on the 32KHz clock output in sleep state.
+ * @i2chs_keepon: Keep on high speed internal clock in sleep state.
+ */
+struct tps65910_sleep_keepon_data {
+	unsigned therm_keepon:1;
+	unsigned clkout32k_keepon:1;
+	unsigned i2chs_keepon:1;
+};
+
 /**
  * struct tps65910_board
  * Board platform data may be used to initialize regulators.
@@ -793,6 +805,8 @@ struct tps65910_board {
 	int irq_base;
 	int vmbch_threshold;
 	int vmbch2_threshold;
+	bool en_dev_slp;
+	struct tps65910_sleep_keepon_data *slp_keepon;
 	unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS];
 	bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO];
 	struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS];
-- 
1.7.1.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH V1 1/2] mfd: tps65910: Use correct variable name for regmap config
  2012-03-07 13:16 [PATCH V1 1/2] mfd: tps65910: Use correct variable name for regmap config Laxman Dewangan
  2012-03-07 13:16 ` [PATCH V2 2/2] mfd: tps65910: Add support for device sleep Laxman Dewangan
@ 2012-03-16 17:53 ` Samuel Ortiz
  1 sibling, 0 replies; 4+ messages in thread
From: Samuel Ortiz @ 2012-03-16 17:53 UTC (permalink / raw)
  To: Laxman Dewangan; +Cc: broonie, jedu, lrg, linux-kernel, linux-tegra

Hi Laxman,

On Wed, Mar 07, 2012 at 06:46:05PM +0530, Laxman Dewangan wrote:
> This was the copy-paste issue in reg cache support code where
> variable name for regmap config was not really starting from
> the device name, it was starting from some other device name.
> Fixing this so that variable name contains actual device name.
Patch applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V2 2/2] mfd: tps65910: Add support for device sleep
  2012-03-07 13:16 ` [PATCH V2 2/2] mfd: tps65910: Add support for device sleep Laxman Dewangan
@ 2012-03-16 17:55   ` Samuel Ortiz
  0 siblings, 0 replies; 4+ messages in thread
From: Samuel Ortiz @ 2012-03-16 17:55 UTC (permalink / raw)
  To: Laxman Dewangan; +Cc: broonie, jedu, lrg, linux-kernel, linux-tegra

Hi Laxman,

On Wed, Mar 07, 2012 at 06:46:06PM +0530, Laxman Dewangan wrote:
> Adding support for device sleep through the external
> input control signal "SLEEP".
> Changing the SLEEP signal state can switch the device
> into SLEEP and ACTIVE state.
> Also adding sleep configuration for different resources
> so that they should be keep on during sleep state of
> device.

This one doesn't apply against my for-next branch. Could you please rebase it?

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-16 17:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-07 13:16 [PATCH V1 1/2] mfd: tps65910: Use correct variable name for regmap config Laxman Dewangan
2012-03-07 13:16 ` [PATCH V2 2/2] mfd: tps65910: Add support for device sleep Laxman Dewangan
2012-03-16 17:55   ` Samuel Ortiz
2012-03-16 17:53 ` [PATCH V1 1/2] mfd: tps65910: Use correct variable name for regmap config Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).