aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r--arch/arm/mach-omap1/Kconfig4
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c314
-rw-r--r--arch/arm/mach-omap1/include/mach/system.h5
-rw-r--r--arch/arm/mach-omap1/pm.c19
4 files changed, 277 insertions, 65 deletions
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index 4f8d66f044e7..4b6a774606cb 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -155,6 +155,10 @@ config MACH_AMS_DELTA
155 bool "Amstrad E3 (Delta)" 155 bool "Amstrad E3 (Delta)"
156 depends on ARCH_OMAP1 && ARCH_OMAP15XX 156 depends on ARCH_OMAP1 && ARCH_OMAP15XX
157 select FIQ 157 select FIQ
158 select GPIO_GENERIC_PLATFORM
159 select LEDS_GPIO_REGISTER
160 select REGULATOR
161 select REGULATOR_FIXED_VOLTAGE
158 help 162 help
159 Support for the Amstrad E3 (codename Delta) videophone. Say Y here 163 Support for the Amstrad E3 (codename Delta) videophone. Say Y here
160 if you have such a device. 164 if you have such a device.
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 88909cc0b254..cb6afe670468 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -11,6 +11,7 @@
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14#include <linux/basic_mmio_gpio.h>
14#include <linux/gpio.h> 15#include <linux/gpio.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
16#include <linux/init.h> 17#include <linux/init.h>
@@ -18,6 +19,9 @@
18#include <linux/interrupt.h> 19#include <linux/interrupt.h>
19#include <linux/leds.h> 20#include <linux/leds.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/regulator/consumer.h>
23#include <linux/regulator/fixed.h>
24#include <linux/regulator/machine.h>
21#include <linux/serial_8250.h> 25#include <linux/serial_8250.h>
22#include <linux/export.h> 26#include <linux/export.h>
23 27
@@ -40,9 +44,6 @@
40 44
41#include <mach/ams-delta-fiq.h> 45#include <mach/ams-delta-fiq.h>
42 46
43static u8 ams_delta_latch1_reg;
44static u16 ams_delta_latch2_reg;
45
46static const unsigned int ams_delta_keymap[] = { 47static const unsigned int ams_delta_keymap[] = {
47 KEY(0, 0, KEY_F1), /* Advert */ 48 KEY(0, 0, KEY_F1), /* Advert */
48 49
@@ -121,49 +122,42 @@ static const unsigned int ams_delta_keymap[] = {
121 KEY(7, 3, KEY_LEFTCTRL), /* Vol down */ 122 KEY(7, 3, KEY_LEFTCTRL), /* Vol down */
122}; 123};
123 124
124void ams_delta_latch1_write(u8 mask, u8 value) 125#define LATCH1_PHYS 0x01000000
125{ 126#define LATCH1_VIRT 0xEA000000
126 ams_delta_latch1_reg &= ~mask; 127#define MODEM_PHYS 0x04000000
127 ams_delta_latch1_reg |= value; 128#define MODEM_VIRT 0xEB000000
128 *(volatile __u8 *) AMS_DELTA_LATCH1_VIRT = ams_delta_latch1_reg; 129#define LATCH2_PHYS 0x08000000
129} 130#define LATCH2_VIRT 0xEC000000
130
131void ams_delta_latch2_write(u16 mask, u16 value)
132{
133 ams_delta_latch2_reg &= ~mask;
134 ams_delta_latch2_reg |= value;
135 *(volatile __u16 *) AMS_DELTA_LATCH2_VIRT = ams_delta_latch2_reg;
136}
137 131
138static struct map_desc ams_delta_io_desc[] __initdata = { 132static struct map_desc ams_delta_io_desc[] __initdata = {
139 /* AMS_DELTA_LATCH1 */ 133 /* AMS_DELTA_LATCH1 */
140 { 134 {
141 .virtual = AMS_DELTA_LATCH1_VIRT, 135 .virtual = LATCH1_VIRT,
142 .pfn = __phys_to_pfn(AMS_DELTA_LATCH1_PHYS), 136 .pfn = __phys_to_pfn(LATCH1_PHYS),
143 .length = 0x01000000, 137 .length = 0x01000000,
144 .type = MT_DEVICE 138 .type = MT_DEVICE
145 }, 139 },
146 /* AMS_DELTA_LATCH2 */ 140 /* AMS_DELTA_LATCH2 */
147 { 141 {
148 .virtual = AMS_DELTA_LATCH2_VIRT, 142 .virtual = LATCH2_VIRT,
149 .pfn = __phys_to_pfn(AMS_DELTA_LATCH2_PHYS), 143 .pfn = __phys_to_pfn(LATCH2_PHYS),
150 .length = 0x01000000, 144 .length = 0x01000000,
151 .type = MT_DEVICE 145 .type = MT_DEVICE
152 }, 146 },
153 /* AMS_DELTA_MODEM */ 147 /* AMS_DELTA_MODEM */
154 { 148 {
155 .virtual = AMS_DELTA_MODEM_VIRT, 149 .virtual = MODEM_VIRT,
156 .pfn = __phys_to_pfn(AMS_DELTA_MODEM_PHYS), 150 .pfn = __phys_to_pfn(MODEM_PHYS),
157 .length = 0x01000000, 151 .length = 0x01000000,
158 .type = MT_DEVICE 152 .type = MT_DEVICE
159 } 153 }
160}; 154};
161 155
162static struct omap_lcd_config ams_delta_lcd_config = { 156static struct omap_lcd_config ams_delta_lcd_config __initdata = {
163 .ctrl_name = "internal", 157 .ctrl_name = "internal",
164}; 158};
165 159
166static struct omap_usb_config ams_delta_usb_config __initdata = { 160static struct omap_usb_config ams_delta_usb_config = {
167 .register_host = 1, 161 .register_host = 1,
168 .hmc_mode = 16, 162 .hmc_mode = 16,
169 .pins[0] = 2, 163 .pins[0] = 2,
@@ -173,6 +167,147 @@ static struct omap_board_config_kernel ams_delta_config[] __initdata = {
173 { OMAP_TAG_LCD, &ams_delta_lcd_config }, 167 { OMAP_TAG_LCD, &ams_delta_lcd_config },
174}; 168};
175 169
170#define LATCH1_GPIO_BASE 232
171#define LATCH1_NGPIO 8
172
173static struct resource latch1_resources[] = {
174 [0] = {
175 .name = "dat",
176 .start = LATCH1_PHYS,
177 .end = LATCH1_PHYS + (LATCH1_NGPIO - 1) / 8,
178 .flags = IORESOURCE_MEM,
179 },
180};
181
182static struct bgpio_pdata latch1_pdata = {
183 .base = LATCH1_GPIO_BASE,
184 .ngpio = LATCH1_NGPIO,
185};
186
187static struct platform_device latch1_gpio_device = {
188 .name = "basic-mmio-gpio",
189 .id = 0,
190 .resource = latch1_resources,
191 .num_resources = ARRAY_SIZE(latch1_resources),
192 .dev = {
193 .platform_data = &latch1_pdata,
194 },
195};
196
197static struct resource latch2_resources[] = {
198 [0] = {
199 .name = "dat",
200 .start = LATCH2_PHYS,
201 .end = LATCH2_PHYS + (AMS_DELTA_LATCH2_NGPIO - 1) / 8,
202 .flags = IORESOURCE_MEM,
203 },
204};
205
206static struct bgpio_pdata latch2_pdata = {
207 .base = AMS_DELTA_LATCH2_GPIO_BASE,
208 .ngpio = AMS_DELTA_LATCH2_NGPIO,
209};
210
211static struct platform_device latch2_gpio_device = {
212 .name = "basic-mmio-gpio",
213 .id = 1,
214 .resource = latch2_resources,
215 .num_resources = ARRAY_SIZE(latch2_resources),
216 .dev = {
217 .platform_data = &latch2_pdata,
218 },
219};
220
221static const struct gpio latch_gpios[] __initconst = {
222 {
223 .gpio = LATCH1_GPIO_BASE + 6,
224 .flags = GPIOF_OUT_INIT_LOW,
225 .label = "dockit1",
226 },
227 {
228 .gpio = LATCH1_GPIO_BASE + 7,
229 .flags = GPIOF_OUT_INIT_LOW,
230 .label = "dockit2",
231 },
232 {
233 .gpio = AMS_DELTA_GPIO_PIN_SCARD_RSTIN,
234 .flags = GPIOF_OUT_INIT_LOW,
235 .label = "scard_rstin",
236 },
237 {
238 .gpio = AMS_DELTA_GPIO_PIN_SCARD_CMDVCC,
239 .flags = GPIOF_OUT_INIT_LOW,
240 .label = "scard_cmdvcc",
241 },
242 {
243 .gpio = AMS_DELTA_GPIO_PIN_MODEM_CODEC,
244 .flags = GPIOF_OUT_INIT_LOW,
245 .label = "modem_codec",
246 },
247 {
248 .gpio = AMS_DELTA_LATCH2_GPIO_BASE + 14,
249 .flags = GPIOF_OUT_INIT_LOW,
250 .label = "hookflash1",
251 },
252 {
253 .gpio = AMS_DELTA_LATCH2_GPIO_BASE + 15,
254 .flags = GPIOF_OUT_INIT_LOW,
255 .label = "hookflash2",
256 },
257};
258
259static struct regulator_consumer_supply modem_nreset_consumers[] = {
260 REGULATOR_SUPPLY("RESET#", "serial8250.1"),
261 REGULATOR_SUPPLY("POR", "cx20442-codec"),
262};
263
264static struct regulator_init_data modem_nreset_data = {
265 .constraints = {
266 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
267 .boot_on = 1,
268 },
269 .num_consumer_supplies = ARRAY_SIZE(modem_nreset_consumers),
270 .consumer_supplies = modem_nreset_consumers,
271};
272
273static struct fixed_voltage_config modem_nreset_config = {
274 .supply_name = "modem_nreset",
275 .microvolts = 3300000,
276 .gpio = AMS_DELTA_GPIO_PIN_MODEM_NRESET,
277 .startup_delay = 25000,
278 .enable_high = 1,
279 .enabled_at_boot = 1,
280 .init_data = &modem_nreset_data,
281};
282
283static struct platform_device modem_nreset_device = {
284 .name = "reg-fixed-voltage",
285 .id = -1,
286 .dev = {
287 .platform_data = &modem_nreset_config,
288 },
289};
290
291struct modem_private_data {
292 struct regulator *regulator;
293};
294
295static struct modem_private_data modem_priv;
296
297void ams_delta_latch_write(int base, int ngpio, u16 mask, u16 value)
298{
299 int bit = 0;
300 u16 bitpos = 1 << bit;
301
302 for (; bit < ngpio; bit++, bitpos = bitpos << 1) {
303 if (!(mask & bitpos))
304 continue;
305 else
306 gpio_set_value(base + bit, (value & bitpos) != 0);
307 }
308}
309EXPORT_SYMBOL(ams_delta_latch_write);
310
176static struct resource ams_delta_nand_resources[] = { 311static struct resource ams_delta_nand_resources[] = {
177 [0] = { 312 [0] = {
178 .start = OMAP1_MPUIO_BASE, 313 .start = OMAP1_MPUIO_BASE,
@@ -202,7 +337,7 @@ static const struct matrix_keymap_data ams_delta_keymap_data = {
202 .keymap_size = ARRAY_SIZE(ams_delta_keymap), 337 .keymap_size = ARRAY_SIZE(ams_delta_keymap),
203}; 338};
204 339
205static struct omap_kp_platform_data ams_delta_kp_data __initdata = { 340static struct omap_kp_platform_data ams_delta_kp_data = {
206 .rows = 8, 341 .rows = 8,
207 .cols = 8, 342 .cols = 8,
208 .keymap_data = &ams_delta_keymap_data, 343 .keymap_data = &ams_delta_keymap_data,
@@ -224,9 +359,45 @@ static struct platform_device ams_delta_lcd_device = {
224 .id = -1, 359 .id = -1,
225}; 360};
226 361
227static struct platform_device ams_delta_led_device = { 362static const struct gpio_led gpio_leds[] __initconst = {
228 .name = "ams-delta-led", 363 {
229 .id = -1 364 .name = "camera",
365 .gpio = LATCH1_GPIO_BASE + 0,
366 .default_state = LEDS_GPIO_DEFSTATE_OFF,
367#ifdef CONFIG_LEDS_TRIGGERS
368 .default_trigger = "ams_delta_camera",
369#endif
370 },
371 {
372 .name = "advert",
373 .gpio = LATCH1_GPIO_BASE + 1,
374 .default_state = LEDS_GPIO_DEFSTATE_OFF,
375 },
376 {
377 .name = "email",
378 .gpio = LATCH1_GPIO_BASE + 2,
379 .default_state = LEDS_GPIO_DEFSTATE_OFF,
380 },
381 {
382 .name = "handsfree",
383 .gpio = LATCH1_GPIO_BASE + 3,
384 .default_state = LEDS_GPIO_DEFSTATE_OFF,
385 },
386 {
387 .name = "voicemail",
388 .gpio = LATCH1_GPIO_BASE + 4,
389 .default_state = LEDS_GPIO_DEFSTATE_OFF,
390 },
391 {
392 .name = "voice",
393 .gpio = LATCH1_GPIO_BASE + 5,
394 .default_state = LEDS_GPIO_DEFSTATE_OFF,
395 },
396};
397
398static const struct gpio_led_platform_data leds_pdata __initconst = {
399 .leds = gpio_leds,
400 .num_leds = ARRAY_SIZE(gpio_leds),
230}; 401};
231 402
232static struct i2c_board_info ams_delta_camera_board_info[] = { 403static struct i2c_board_info ams_delta_camera_board_info[] = {
@@ -275,13 +446,17 @@ static struct omap1_cam_platform_data ams_delta_camera_platform_data = {
275}; 446};
276 447
277static struct platform_device *ams_delta_devices[] __initdata = { 448static struct platform_device *ams_delta_devices[] __initdata = {
278 &ams_delta_nand_device, 449 &latch1_gpio_device,
450 &latch2_gpio_device,
279 &ams_delta_kp_device, 451 &ams_delta_kp_device,
280 &ams_delta_lcd_device,
281 &ams_delta_led_device,
282 &ams_delta_camera_device, 452 &ams_delta_camera_device,
283}; 453};
284 454
455static struct platform_device *late_devices[] __initdata = {
456 &ams_delta_nand_device,
457 &ams_delta_lcd_device,
458};
459
285static void __init ams_delta_init(void) 460static void __init ams_delta_init(void)
286{ 461{
287 /* mux pins for uarts */ 462 /* mux pins for uarts */
@@ -307,15 +482,13 @@ static void __init ams_delta_init(void)
307 omap_serial_init(); 482 omap_serial_init();
308 omap_register_i2c_bus(1, 100, NULL, 0); 483 omap_register_i2c_bus(1, 100, NULL, 0);
309 484
310 /* Clear latch2 (NAND, LCD, modem enable) */
311 ams_delta_latch2_write(~0, 0);
312
313 omap1_usb_init(&ams_delta_usb_config); 485 omap1_usb_init(&ams_delta_usb_config);
314 omap1_set_camera_info(&ams_delta_camera_platform_data); 486 omap1_set_camera_info(&ams_delta_camera_platform_data);
315#ifdef CONFIG_LEDS_TRIGGERS 487#ifdef CONFIG_LEDS_TRIGGERS
316 led_trigger_register_simple("ams_delta_camera", 488 led_trigger_register_simple("ams_delta_camera",
317 &ams_delta_camera_led_trigger); 489 &ams_delta_camera_led_trigger);
318#endif 490#endif
491 gpio_led_register_device(-1, &leds_pdata);
319 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices)); 492 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
320 493
321 ams_delta_init_fiq(); 494 ams_delta_init_fiq();
@@ -323,16 +496,34 @@ static void __init ams_delta_init(void)
323 omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1); 496 omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1);
324} 497}
325 498
499static void modem_pm(struct uart_port *port, unsigned int state, unsigned old)
500{
501 struct modem_private_data *priv = port->private_data;
502
503 if (IS_ERR(priv->regulator))
504 return;
505
506 if (state == old)
507 return;
508
509 if (state == 0)
510 regulator_enable(priv->regulator);
511 else if (old == 0)
512 regulator_disable(priv->regulator);
513}
514
326static struct plat_serial8250_port ams_delta_modem_ports[] = { 515static struct plat_serial8250_port ams_delta_modem_ports[] = {
327 { 516 {
328 .membase = IOMEM(AMS_DELTA_MODEM_VIRT), 517 .membase = IOMEM(MODEM_VIRT),
329 .mapbase = AMS_DELTA_MODEM_PHYS, 518 .mapbase = MODEM_PHYS,
330 .irq = -EINVAL, /* changed later */ 519 .irq = -EINVAL, /* changed later */
331 .flags = UPF_BOOT_AUTOCONF, 520 .flags = UPF_BOOT_AUTOCONF,
332 .irqflags = IRQF_TRIGGER_RISING, 521 .irqflags = IRQF_TRIGGER_RISING,
333 .iotype = UPIO_MEM, 522 .iotype = UPIO_MEM,
334 .regshift = 1, 523 .regshift = 1,
335 .uartclk = BASE_BAUD * 16, 524 .uartclk = BASE_BAUD * 16,
525 .pm = modem_pm,
526 .private_data = &modem_priv,
336 }, 527 },
337 { }, 528 { },
338}; 529};
@@ -345,13 +536,27 @@ static struct platform_device ams_delta_modem_device = {
345 }, 536 },
346}; 537};
347 538
348static int __init ams_delta_modem_init(void) 539static int __init late_init(void)
349{ 540{
350 int err; 541 int err;
351 542
352 if (!machine_is_ams_delta()) 543 if (!machine_is_ams_delta())
353 return -ENODEV; 544 return -ENODEV;
354 545
546 err = gpio_request_array(latch_gpios, ARRAY_SIZE(latch_gpios));
547 if (err) {
548 pr_err("Couldn't take over latch1/latch2 GPIO pins\n");
549 return err;
550 }
551
552 platform_add_devices(late_devices, ARRAY_SIZE(late_devices));
553
554 err = platform_device_register(&modem_nreset_device);
555 if (err) {
556 pr_err("Couldn't register the modem regulator device\n");
557 return err;
558 }
559
355 omap_cfg_reg(M14_1510_GPIO2); 560 omap_cfg_reg(M14_1510_GPIO2);
356 ams_delta_modem_ports[0].irq = 561 ams_delta_modem_ports[0].irq =
357 gpio_to_irq(AMS_DELTA_GPIO_PIN_MODEM_IRQ); 562 gpio_to_irq(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
@@ -363,13 +568,35 @@ static int __init ams_delta_modem_init(void)
363 } 568 }
364 gpio_direction_input(AMS_DELTA_GPIO_PIN_MODEM_IRQ); 569 gpio_direction_input(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
365 570
366 ams_delta_latch2_write( 571 /* Initialize the modem_nreset regulator consumer before use */
367 AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC, 572 modem_priv.regulator = ERR_PTR(-ENODEV);
368 AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC); 573
574 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_CODEC,
575 AMS_DELTA_LATCH2_MODEM_CODEC);
576
577 err = platform_device_register(&ams_delta_modem_device);
578 if (err)
579 goto gpio_free;
369 580
370 return platform_device_register(&ams_delta_modem_device); 581 /*
582 * Once the modem device is registered, the modem_nreset
583 * regulator can be requested on behalf of that device.
584 */
585 modem_priv.regulator = regulator_get(&ams_delta_modem_device.dev,
586 "RESET#");
587 if (IS_ERR(modem_priv.regulator)) {
588 err = PTR_ERR(modem_priv.regulator);
589 goto unregister;
590 }
591 return 0;
592
593unregister:
594 platform_device_unregister(&ams_delta_modem_device);
595gpio_free:
596 gpio_free(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
597 return err;
371} 598}
372arch_initcall(ams_delta_modem_init); 599late_initcall(late_init);
373 600
374static void __init ams_delta_map_io(void) 601static void __init ams_delta_map_io(void)
375{ 602{
@@ -388,6 +615,3 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
388 .timer = &omap1_timer, 615 .timer = &omap1_timer,
389 .restart = omap1_restart, 616 .restart = omap1_restart,
390MACHINE_END 617MACHINE_END
391
392EXPORT_SYMBOL(ams_delta_latch1_write);
393EXPORT_SYMBOL(ams_delta_latch2_write);
diff --git a/arch/arm/mach-omap1/include/mach/system.h b/arch/arm/mach-omap1/include/mach/system.h
deleted file mode 100644
index a6c1b3a16dfc..000000000000
--- a/arch/arm/mach-omap1/include/mach/system.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-omap1/include/mach/system.h
3 */
4
5#include <plat/system.h>
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index 89ea20ca0ccc..0c2c3669d594 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -42,9 +42,9 @@
42#include <linux/sysfs.h> 42#include <linux/sysfs.h>
43#include <linux/module.h> 43#include <linux/module.h>
44#include <linux/io.h> 44#include <linux/io.h>
45#include <linux/atomic.h>
45 46
46#include <asm/irq.h> 47#include <asm/irq.h>
47#include <linux/atomic.h>
48#include <asm/mach/time.h> 48#include <asm/mach/time.h>
49#include <asm/mach/irq.h> 49#include <asm/mach/irq.h>
50 50
@@ -108,13 +108,7 @@ void omap1_pm_idle(void)
108 __u32 use_idlect1 = arm_idlect1_mask; 108 __u32 use_idlect1 = arm_idlect1_mask;
109 int do_sleep = 0; 109 int do_sleep = 0;
110 110
111 local_irq_disable();
112 local_fiq_disable(); 111 local_fiq_disable();
113 if (need_resched()) {
114 local_fiq_enable();
115 local_irq_enable();
116 return;
117 }
118 112
119#if defined(CONFIG_OMAP_MPU_TIMER) && !defined(CONFIG_OMAP_DM_TIMER) 113#if defined(CONFIG_OMAP_MPU_TIMER) && !defined(CONFIG_OMAP_DM_TIMER)
120#warning Enable 32kHz OS timer in order to allow sleep states in idle 114#warning Enable 32kHz OS timer in order to allow sleep states in idle
@@ -157,14 +151,12 @@ void omap1_pm_idle(void)
157 omap_writel(saved_idlect1, ARM_IDLECT1); 151 omap_writel(saved_idlect1, ARM_IDLECT1);
158 152
159 local_fiq_enable(); 153 local_fiq_enable();
160 local_irq_enable();
161 return; 154 return;
162 } 155 }
163 omap_sram_suspend(omap_readl(ARM_IDLECT1), 156 omap_sram_suspend(omap_readl(ARM_IDLECT1),
164 omap_readl(ARM_IDLECT2)); 157 omap_readl(ARM_IDLECT2));
165 158
166 local_fiq_enable(); 159 local_fiq_enable();
167 local_irq_enable();
168} 160}
169 161
170/* 162/*
@@ -583,8 +575,6 @@ static void omap_pm_init_proc(void)
583 575
584#endif /* DEBUG && CONFIG_PROC_FS */ 576#endif /* DEBUG && CONFIG_PROC_FS */
585 577
586static void (*saved_idle)(void) = NULL;
587
588/* 578/*
589 * omap_pm_prepare - Do preliminary suspend work. 579 * omap_pm_prepare - Do preliminary suspend work.
590 * 580 *
@@ -592,8 +582,7 @@ static void (*saved_idle)(void) = NULL;
592static int omap_pm_prepare(void) 582static int omap_pm_prepare(void)
593{ 583{
594 /* We cannot sleep in idle until we have resumed */ 584 /* We cannot sleep in idle until we have resumed */
595 saved_idle = pm_idle; 585 disable_hlt();
596 pm_idle = NULL;
597 586
598 return 0; 587 return 0;
599} 588}
@@ -630,7 +619,7 @@ static int omap_pm_enter(suspend_state_t state)
630 619
631static void omap_pm_finish(void) 620static void omap_pm_finish(void)
632{ 621{
633 pm_idle = saved_idle; 622 enable_hlt();
634} 623}
635 624
636 625
@@ -687,7 +676,7 @@ static int __init omap_pm_init(void)
687 return -ENODEV; 676 return -ENODEV;
688 } 677 }
689 678
690 pm_idle = omap1_pm_idle; 679 arm_pm_idle = omap1_pm_idle;
691 680
692 if (cpu_is_omap7xx()) 681 if (cpu_is_omap7xx())
693 setup_irq(INT_7XX_WAKE_UP_REQ, &omap_wakeup_irq); 682 setup_irq(INT_7XX_WAKE_UP_REQ, &omap_wakeup_irq);