From patchwork Mon Jul 11 09:55:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 963882 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6B9tXNB020311 for ; Mon, 11 Jul 2011 09:55:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753064Ab1GKJzd (ORCPT ); Mon, 11 Jul 2011 05:55:33 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:47747 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753052Ab1GKJzc (ORCPT ); Mon, 11 Jul 2011 05:55:32 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p6B9tTB9011065 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 11 Jul 2011 04:55:31 -0500 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p6B9tSYA019098 for ; Mon, 11 Jul 2011 15:25:28 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 8.3.106.1; Mon, 11 Jul 2011 15:25:28 +0530 Received: from a0393217ubnlt.india.ti.com ([172.24.190.144]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p6B9tJr2011365; Mon, 11 Jul 2011 15:25:26 +0530 (IST) From: Shubhrajyoti D To: CC: Shubhrajyoti D Subject: [PATCH 2/2] OMAP: I2C: Reset support Date: Mon, 11 Jul 2011 15:25:13 +0530 Message-ID: <1310378113-28098-2-git-send-email-shubhrajyoti@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1310378113-28098-1-git-send-email-shubhrajyoti@ti.com> References: <1310378113-28098-1-git-send-email-shubhrajyoti@ti.com> MIME-Version: 1.0 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.6 (demeter2.kernel.org [140.211.167.43]); Mon, 11 Jul 2011 09:55:34 +0000 (UTC) Under some error conditions the i2c driver may do a reset adding support in the platform. Signed-off-by: Shubhrajyoti D --- arch/arm/plat-omap/i2c.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c index 2388b8e..3d144d1 100644 --- a/arch/arm/plat-omap/i2c.c +++ b/arch/arm/plat-omap/i2c.c @@ -146,6 +146,22 @@ static struct omap_device_pm_latency omap_i2c_latency[] = { .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, }, }; +/** + * omap2_i2c_reset - reset the omap i2c module. + * @dev: struct device* + */ + +static int omap2_i2c_reset(struct device *dev) +{ + int r = 0; + struct platform_device *pdev = to_platform_device(dev); + struct omap_device *odev = to_omap_device(pdev); + struct omap_hwmod *oh; + + oh = odev->hwmods[0]; + r = omap_hwmod_reset(oh); + return r; +} static inline int omap2_i2c_add_bus(int bus_id) { @@ -187,6 +203,8 @@ static inline int omap2_i2c_add_bus(int bus_id) */ if (cpu_is_omap34xx()) pdata->set_mpu_wkup_lat = omap_pm_set_max_mpu_wakeup_lat_compat; + + pdata->device_reset = omap2_i2c_reset; od = omap_device_build(name, bus_id, oh, pdata, sizeof(struct omap_i2c_bus_platform_data), omap_i2c_latency, ARRAY_SIZE(omap_i2c_latency), 0);