From patchwork Wed Feb 17 00:57:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sonasath, Moiz" X-Patchwork-Id: 79815 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1H0l8Ho032337 for ; Wed, 17 Feb 2010 00:47:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933806Ab0BQArH (ORCPT ); Tue, 16 Feb 2010 19:47:07 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:47366 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933760Ab0BQArB (ORCPT ); Tue, 16 Feb 2010 19:47:01 -0500 Received: from dlep36.itg.ti.com ([157.170.170.91]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o1H0l0Mw008747 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Feb 2010 18:47:00 -0600 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id o1H0kvQ2029616; Tue, 16 Feb 2010 18:46:57 -0600 (CST) Received: from lina0132712 (lina0132712.am.dhcp.ti.com [128.247.79.146]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o1H0kvZ00573; Tue, 16 Feb 2010 18:46:57 -0600 (CST) Received: by lina0132712 (Postfix, from userid 1000) id 1B0279D727; Tue, 16 Feb 2010 18:57:21 -0600 (CST) From: Moiz Sonasath To: linux-omap@vger.kernel.org Cc: sameo@linux.intel.com, tony@atomide.com, Moiz Sonasath , Allen Pais Subject: [PATCH 1/2] omap: Disable TWL4030/5030 I2C1/I2C4 internal pull-ups Date: Tue, 16 Feb 2010 18:57:21 -0600 Message-Id: <1266368241-10459-2-git-send-email-m-sonasath@ti.com> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <1266368241-10459-1-git-send-email-m-sonasath@ti.com> References: <1266368241-10459-1-git-send-email-m-sonasath@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 (demeter.kernel.org [140.211.167.41]); Wed, 17 Feb 2010 00:47:08 +0000 (UTC) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 2a76065..35ae2ee 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -965,6 +965,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) int status; unsigned i; struct twl4030_platform_data *pdata = client->dev.platform_data; + u8 temp; if (!pdata) { dev_dbg(&client->dev, "no platform data?\n"); @@ -1032,6 +1033,18 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) goto fail; } + /* 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. + */ + + if (twl_class_is_4030()) { + twl_i2c_read_u8(TWL4030_MODULE_INTBR, &temp, REG_GPPUPDCTR1); + 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); + } + status = add_children(pdata, id->driver_data); fail: if (status < 0) diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index bf1c5be..fd95eca 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h @@ -239,6 +239,21 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset); /*----------------------------------------------------------------------*/ +/*Interface Bit Register (INTBR) offsets + *(Use TWL_4030_MODULE_INTBR) + */ + +#define REG_GPPUPDCTR1 0x0F + +/*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */ + +#define I2C_SCL_CTRL_PU BIT(0) +#define I2C_SDA_CTRL_PU BIT(2) +#define SR_I2C_SCL_CTRL_PU BIT(4) +#define SR_I2C_SDA_CTRL_PU BIT(6) + +/*----------------------------------------------------------------------*/ + /* * Keypad register offsets (use TWL4030_MODULE_KEYPAD) * ... SIH/interrupt only