From patchwork Mon Dec 20 16:59:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 421601 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBKGxY5x009219 for ; Mon, 20 Dec 2010 16:59:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932890Ab0LTQ7j (ORCPT ); Mon, 20 Dec 2010 11:59:39 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:52041 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932876Ab0LTQ7h (ORCPT ); Mon, 20 Dec 2010 11:59:37 -0500 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id oBKGxQle023154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Dec 2010 10:59:28 -0600 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id oBKGxJub025246; Mon, 20 Dec 2010 22:29:24 +0530 (IST) From: Thara Gopinath 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 Subject: [PATCH v6 07/10] OMAP3: PM: Adding T2 enabling of smartreflex support Date: Mon, 20 Dec 2010 22:29:14 +0530 Message-Id: <1292864357-13939-8-git-send-email-thara@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1292864357-13939-1-git-send-email-thara@ti.com> References: <1292864357-13939-1-git-send-email-thara@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 20 Dec 2010 16:59:43 +0000 (UTC) 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