diff options
author | Shubhrajyoti D <shubhrajyoti@ti.com> | 2011-12-02 14:51:12 +0530 |
---|---|---|
committer | Dan Murphy <dmurphy@ti.com> | 2011-12-15 07:44:58 -0600 |
commit | 38a874b5e526dd965029227aba4176b2d66a6288 (patch) | |
tree | d8fe03f66a36545745b06457bceae1fd2e0c0586 | |
parent | 8905581a83b31900ca7f8a10f31402cf46423153 (diff) | |
download | kernel_samsung_espresso10-38a874b5e526dd965029227aba4176b2d66a6288.zip kernel_samsung_espresso10-38a874b5e526dd965029227aba4176b2d66a6288.tar.gz kernel_samsung_espresso10-38a874b5e526dd965029227aba4176b2d66a6288.tar.bz2 |
OMAP: I2C: Reset support
Under some error conditions the i2c driver may do a reset.
Adding a reset field and support in the device-specific code.
Change-Id: I1093774aa6ba419da92047f28a087b2d29ff6750
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
-rw-r--r-- | arch/arm/plat-omap/i2c.c | 19 | ||||
-rw-r--r-- | include/linux/i2c-omap.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c index f25b240..23b7d83 100644 --- a/arch/arm/plat-omap/i2c.c +++ b/arch/arm/plat-omap/i2c.c @@ -75,6 +75,22 @@ static struct omap_i2c_bus_platform_data i2c_pdata[OMAP_I2C_MAX_CONTROLLERS]; static struct platform_device omap_i2c_devices[] = { I2C_DEV_BUILDER(1, i2c_resources[0], &i2c_pdata[0]), }; +/** + * 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; +} #define OMAP_I2C_CMDLINE_SETUP (BIT(31)) @@ -151,6 +167,9 @@ static inline int omap2_i2c_add_bus(int bus_id) */ if (cpu_is_omap34xx() || cpu_is_omap44xx()) pdata->needs_wakeup_latency = true; + + 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); diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h index 0eb4439..9dc3569 100644 --- a/include/linux/i2c-omap.h +++ b/include/linux/i2c-omap.h @@ -21,6 +21,7 @@ struct omap_i2c_bus_platform_data { int (*device_enable) (struct platform_device *pdev); int (*device_shutdown) (struct platform_device *pdev); int (*device_idle) (struct platform_device *pdev); + int (*device_reset) (struct device *dev); struct hwspinlock *handle; int (*hwspin_lock_timeout)(struct hwspinlock *hwlock, unsigned int to); |