diff options
author | Paul Walmsley <paul@pwsan.com> | 2012-12-30 12:31:52 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2013-02-06 15:48:14 -0500 |
commit | 1e3d8fe771881de323396aaa1efd20243fa974cb (patch) | |
tree | 807c1087c8fbe7c9ebad721d1fabb40147613f16 | |
parent | db27c0c0d05cafc0eb0bed4d58daea65ed5e6839 (diff) |
ARM: OMAP2420: hwmod data/PM: use hwmod to block WFI when I2C active
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>
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_2420_data.c | 7 | ||||
-rw-r--r-- | 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 b5efe58c0be0..6a764af6c6d3 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 = { | |||
121 | }, | 121 | }, |
122 | .class = &i2c_class, | 122 | .class = &i2c_class, |
123 | .dev_attr = &i2c_dev_attr, | 123 | .dev_attr = &i2c_dev_attr, |
124 | .flags = HWMOD_16BIT_REG, | 124 | /* |
125 | * From mach-omap2/pm24xx.c: "Putting MPU into the WFI state | ||
126 | * while a transfer is active seems to cause the I2C block to | ||
127 | * timeout. Why? Good question." | ||
128 | */ | ||
129 | .flags = (HWMOD_16BIT_REG | HWMOD_BLOCK_WFI), | ||
125 | }; | 130 | }; |
126 | 131 | ||
127 | /* I2C2 */ | 132 | /* I2C2 */ |
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index 8914b9e32ee7..bc44bcd64451 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c | |||
@@ -139,14 +139,6 @@ no_sleep: | |||
139 | return 0; | 139 | return 0; |
140 | } | 140 | } |
141 | 141 | ||
142 | static int omap2_i2c_active(void) | ||
143 | { | ||
144 | u32 l; | ||
145 | |||
146 | l = omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1); | ||
147 | return l & (OMAP2420_EN_I2C2_MASK | OMAP2420_EN_I2C1_MASK); | ||
148 | } | ||
149 | |||
150 | static int sti_console_enabled; | 142 | static int sti_console_enabled; |
151 | 143 | ||
152 | static int omap2_allow_mpu_retention(void) | 144 | static int omap2_allow_mpu_retention(void) |
@@ -173,11 +165,6 @@ static void omap2_enter_mpu_retention(void) | |||
173 | { | 165 | { |
174 | const int zero = 0; | 166 | const int zero = 0; |
175 | 167 | ||
176 | /* Putting MPU into the WFI state while a transfer is active | ||
177 | * seems to cause the I2C block to timeout. Why? Good question. */ | ||
178 | if (omap2_i2c_active()) | ||
179 | return; | ||
180 | |||
181 | /* The peripherals seem not to be able to wake up the MPU when | 168 | /* The peripherals seem not to be able to wake up the MPU when |
182 | * it is in retention mode. */ | 169 | * it is in retention mode. */ |
183 | if (omap2_allow_mpu_retention()) { | 170 | if (omap2_allow_mpu_retention()) { |