diff mbox

[PATCHV2,2/5] OMAP: I2C: Reset support

Message ID 1311246554-22975-3-git-send-email-shubhrajyoti@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shubhrajyoti Datta July 21, 2011, 11:09 a.m. UTC
Under some error conditions the i2c  driver may do a reset
adding support in the platform.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 arch/arm/plat-omap/i2c.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

Comments

Santosh Shilimkar July 21, 2011, 11:19 a.m. UTC | #1
On 7/21/2011 4:39 PM, Shubhrajyoti D wrote:
> Under some error conditions the i2c  driver may do a reset
> adding support in the platform.
>
> Signed-off-by: Shubhrajyoti D<shubhrajyoti@ti.com>
> ---
As commented on 1/5, this one should be folded
with 1/5 unless and until you have some valid reason.

Regards
Santosh
Shubhrajyoti Datta July 21, 2011, 12:02 p.m. UTC | #2
On Thursday 21 July 2011 04:49 PM, Santosh Shilimkar wrote:
> On 7/21/2011 4:39 PM, Shubhrajyoti D wrote:
>> Under some error conditions the i2c  driver may do a reset
>> adding support in the platform.
>>
>> Signed-off-by: Shubhrajyoti D<shubhrajyoti@ti.com>
>> ---
> As commented on 1/5, this one should be folded
> with 1/5 unless and until you have some valid reason.
Thanks for your review.
Will combine the patches and send.
>
> Regards
> Santosh
diff mbox

Patch

diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index 2388b8e..98a97b0 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,7 @@  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);