From: Shubhrajyoti D <shubhrajyoti@ti.com>
To: linux-omap@vger.kernel.org
Cc: khilman@ti.com, balajitk@ti.com, rnayak@ti.com,
santosh.shilimkar@ti.com, linux-i2c@vger.kernel.org,
Shubhrajyoti D <shubhrajyoti@ti.com>,
linux-arm-kernel@lists.infradead.org
Subject: [PATCHV3 1/4] OMAP: I2C: Reset support
Date: Thu, 21 Jul 2011 19:22:58 +0530 [thread overview]
Message-ID: <1311256381-25548-2-git-send-email-shubhrajyoti@ti.com> (raw)
In-Reply-To: <1311256381-25548-1-git-send-email-shubhrajyoti@ti.com>
Under some error conditions the i2c driver may do a reset.
Adding a reset field and support in the platform.
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
arch/arm/plat-omap/i2c.c | 17 +++++++++++++++++
include/linux/i2c-omap.h | 1 +
2 files changed, 18 insertions(+), 0 deletions(-)
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);
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
index 98ae49b..8aa91b6 100644
--- a/include/linux/i2c-omap.h
+++ b/include/linux/i2c-omap.h
@@ -38,6 +38,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);
};
#endif
--
1.7.1
next prev parent reply other threads:[~2011-07-21 13:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-21 13:52 [PATCHV3 0/4] The series attempts to do the following Shubhrajyoti D
2011-07-21 13:52 ` Shubhrajyoti D [this message]
2011-07-21 13:52 ` [PATCHV3 2/4] OMAP: I2C: Remove the reset in the init path Shubhrajyoti D
2011-07-21 13:59 ` Felipe Balbi
2011-07-21 15:24 ` Shubhrajyoti
2011-07-21 15:30 ` Kevin Hilman
2011-07-21 13:53 ` [PATCHV3 3/4] OMAP: I2C: Remove the SYSC register definition Shubhrajyoti D
[not found] ` <1311256381-25548-1-git-send-email-shubhrajyoti-l0cyMroinI0@public.gmane.org>
2011-07-21 13:53 ` [PATCHV3 4/4] OMAP: I2C: I2C register restore only if context is lost Shubhrajyoti D
2011-07-21 15:32 ` [PATCHV3 0/4] The series attempts to do the following Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1311256381-25548-2-git-send-email-shubhrajyoti@ti.com \
--to=shubhrajyoti@ti.com \
--cc=balajitk@ti.com \
--cc=khilman@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=rnayak@ti.com \
--cc=santosh.shilimkar@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox