From: paul@pwsan•com (Paul Walmsley)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 3/3] ARM: OMAP2420: hwmod data/PM: use hwmod to block WFI when I2C active
Date: Sun, 30 Dec 2012 11:28:31 -0700 [thread overview]
Message-ID: <20121230182830.30526.5466.stgit@dusk.lan> (raw)
In-Reply-To: <20121230182745.30526.47072.stgit@dusk.lan>
Use the HWMOD_BLOCK_WFI flag in the hwmod data to prevent the MPU from
entering WFI when the I2C devices are active. No idea why this is needed;
this could certainly bear further investigation if anyone is interested.
The objective here is to remove some custom code from the OMAP24xx PM
code.
Signed-off-by: Paul Walmsley <paul@pwsan•com>
Cc: Kevin Hilman <khilman@deeprootsystems•com>
---
arch/arm/mach-omap2/omap_hwmod_2420_data.c | 7 ++++++-
arch/arm/mach-omap2/pm24xx.c | 13 -------------
2 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index b5efe58..6a764af 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -121,7 +121,12 @@ static struct omap_hwmod omap2420_i2c1_hwmod = {
},
.class = &i2c_class,
.dev_attr = &i2c_dev_attr,
- .flags = HWMOD_16BIT_REG,
+ /*
+ * From mach-omap2/pm24xx.c: "Putting MPU into the WFI state
+ * while a transfer is active seems to cause the I2C block to
+ * timeout. Why? Good question."
+ */
+ .flags = (HWMOD_16BIT_REG | HWMOD_BLOCK_WFI),
};
/* I2C2 */
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index 659a2f5..f69c701 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -139,14 +139,6 @@ no_sleep:
return 0;
}
-static int omap2_i2c_active(void)
-{
- u32 l;
-
- l = omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
- return l & (OMAP2420_EN_I2C2_MASK | OMAP2420_EN_I2C1_MASK);
-}
-
static int sti_console_enabled;
static int omap2_allow_mpu_retention(void)
@@ -171,11 +163,6 @@ static int omap2_allow_mpu_retention(void)
static void omap2_enter_mpu_retention(void)
{
- /* Putting MPU into the WFI state while a transfer is active
- * seems to cause the I2C block to timeout. Why? Good question. */
- if (omap2_i2c_active())
- return;
-
/* The peripherals seem not to be able to wake up the MPU when
* it is in retention mode. */
if (omap2_allow_mpu_retention()) {
prev parent reply other threads:[~2012-12-30 18:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-30 18:28 [PATCH 0/3] ARM: OMAP2+: PM/hwmod: clean up some WFI-related code Paul Walmsley
2012-12-30 18:28 ` [PATCH 1/3] ARM: OMAP2xxx: PM: enter WFI via inline asm if CORE stays active Paul Walmsley
2012-12-31 8:27 ` Santosh Shilimkar
2013-02-06 21:21 ` Paul Walmsley
2013-02-12 15:28 ` Kevin Hilman
2012-12-30 18:28 ` [PATCH 2/3] ARM: OMAP2+: hwmod: add support for blocking WFI when a device is active Paul Walmsley
2012-12-31 8:25 ` Santosh Shilimkar
2012-12-31 12:56 ` Paul Walmsley
2012-12-31 13:10 ` Santosh Shilimkar
2012-12-30 18:28 ` Paul Walmsley [this message]
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=20121230182830.30526.5466.stgit@dusk.lan \
--to=paul@pwsan$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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