public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Thara Gopinath <thara@ti.com>
To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: khilman@deeprootsystems.com, paul@pwsan.com, b-cousson@ti.com,
	vishwanath.bs@ti.com, sawant@ti.com, nm@ti.com,
	Thara Gopinath <thara@ti.com>
Subject: [PATCH v6 07/10] OMAP3: PM: Adding T2 enabling of smartreflex support
Date: Mon, 20 Dec 2010 22:29:14 +0530	[thread overview]
Message-ID: <1292864357-13939-8-git-send-email-thara@ti.com> (raw)
In-Reply-To: <1292864357-13939-1-git-send-email-thara@ti.com>

This patch adds support in the twl4030 driver to enable smartreflex.
The smartreflex bit on twl4030 needs to be enabled by default irrespective
of whether smartreflex module is enabled on the OMAP side or not.
This is because without this bit enabled the voltage scaling through
vp forceupdate does not function properly.

Signed-off-by: Thara Gopinath <thara@ti.com>
---
 drivers/mfd/twl-core.c  |   13 +++++++++++++
 include/linux/i2c/twl.h |   11 +++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 35275ba..b895ceb 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -1046,6 +1046,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
 	/* Disable TWL4030/TWL5030 I2C Pull-up on I2C1 and I2C4(SR) interface.
 	 * Program I2C_SCL_CTRL_PU(bit 0)=0, I2C_SDA_CTRL_PU (bit 2)=0,
 	 * SR_I2C_SCL_CTRL_PU(bit 4)=0 and SR_I2C_SDA_CTRL_PU(bit 6)=0.
+	 * Also enable the smartreflex I2S bit.
 	 */
 
 	if (twl_class_is_4030()) {
@@ -1053,6 +1054,18 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
 		temp &= ~(SR_I2C_SDA_CTRL_PU | SR_I2C_SCL_CTRL_PU | \
 		I2C_SDA_CTRL_PU | I2C_SCL_CTRL_PU);
 		twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1);
+
+		/* The smartreflex bit on twl4030 needs to be enabled by
+		 * default irrespective of whether smartreflex module is
+		 * enabled on the OMAP side or not. This is because without
+		 * this bit enabled the voltage scaling through
+		 * vp forceupdate does not function properly.
+		 */
+		twl_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &temp,
+			TWL4030_PM_RECEIVER_DCDC_GLOBAL_CFG);
+		temp |= SMARTREFLEX_ENABLE;
+		twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, temp,
+			TWL4030_PM_RECEIVER_DCDC_GLOBAL_CFG);
 	}
 
 	status = add_children(pdata, id->driver_data);
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index c760991..d392f06 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -434,6 +434,17 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot)
 
 /*----------------------------------------------------------------------*/
 
+/*
+ * PM Receiver module register offsets (use TWL4030_MODULE_PM_RECEIVER)
+ */
+
+#define TWL4030_PM_RECEIVER_DCDC_GLOBAL_CFG	0x06
+
+/* Smartreflex I2S bus enable/ vmode enable bit */
+#define SMARTREFLEX_ENABLE			BIT(3)
+
+/*----------------------------------------------------------------------*/
+
 /* Power bus message definitions */
 
 /* The TWL4030/5030 splits its power-management resources (the various
-- 
1.7.0.4


  parent reply	other threads:[~2010-12-20 16:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-20 16:59 [PATCH v6 00/10] OMAP: Adding Smartreflex and Voltage driver support Thara Gopinath
2010-12-20 16:59 ` [PATCH v6 01/10] OMAP3: PM: Adding voltage " Thara Gopinath
2010-12-22 22:29   ` Kevin Hilman
2010-12-28 16:17   ` Anand Sawant
2010-12-20 16:59 ` [PATCH v6 02/10] OMAP: Introduce voltage domain information in the hwmod structures Thara Gopinath
2010-12-20 16:59 ` [PATCH v6 03/10] OMAP3: PM: Adding smartreflex driver support Thara Gopinath
2010-12-20 16:59 ` [PATCH v6 04/10] OMAP3: PM: Adding smartreflex device file Thara Gopinath
2010-12-20 16:59 ` [PATCH v6 05/10] OMAP3: PM: Adding smartreflex hwmod data Thara Gopinath
2010-12-20 16:59 ` [PATCH v6 06/10] OMAP3: PM: Adding smartreflex class3 driver Thara Gopinath
2010-12-20 16:59 ` Thara Gopinath [this message]
2010-12-22 20:30   ` [PATCH v6 07/10] OMAP3: PM: Adding T2 enabling of smartreflex support Kevin Hilman
2010-12-31  8:01     ` Gopinath, Thara
2011-01-02 14:28       ` Woodruff, Richard
2010-12-20 16:59 ` [PATCH v6 08/10] OMAP3: PM: Register TWL4030 pmic info with the voltage driver Thara Gopinath
2010-12-20 16:59 ` [PATCH v6 09/10] OMAP3: PM: Adding debug support to Voltage and Smartreflex drivers Thara Gopinath
2010-12-28 17:07   ` Anand Sawant
2010-12-20 16:59 ` [PATCH v6 10/10] OMAP3: PM: Program correct init voltages for VDD1 and VDD2 Thara Gopinath
2010-12-21  1:05 ` [PATCH v6 00/10] OMAP: Adding Smartreflex and Voltage driver support Kevin Hilman
2010-12-21  2:23   ` Tony Lindgren
2010-12-21  3:18     ` Tony Lindgren
2010-12-21 16:17     ` Kevin Hilman
2010-12-21 18:55       ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1292864357-13939-8-git-send-email-thara@ti.com \
    --to=thara@ti.com \
    --cc=b-cousson@ti.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=paul@pwsan.com \
    --cc=sawant@ti.com \
    --cc=vishwanath.bs@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox