diff options
author | Tony Lindgren <tony@atomide.com> | 2010-12-07 19:26:55 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-12-07 19:26:55 -0500 |
commit | c2cdaffe0bb32015e84af8e31f73e620ba271165 (patch) | |
tree | 420ae7c0acec63eda182c7b4ceea1e39406bc41b /arch/arm/mach-omap1/board-h3.c | |
parent | 7b045c96cd1405597a6a2e98bc53a4ac01d835b1 (diff) |
omap: Fix gpio_request calls to happen as arch_initcall
Looks like some boards are calling gpio_request from init_irq.
This will make the request_irq fail, as GPIO will be initialized
as postcore_initcall.
Reported-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1/board-h3.c')
-rw-r--r-- | arch/arm/mach-omap1/board-h3.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index 9126e3e37b4a..78719198809e 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c | |||
@@ -264,6 +264,15 @@ static struct platform_device smc91x_device = { | |||
264 | .resource = smc91x_resources, | 264 | .resource = smc91x_resources, |
265 | }; | 265 | }; |
266 | 266 | ||
267 | static void __init h3_init_smc91x(void) | ||
268 | { | ||
269 | omap_cfg_reg(W15_1710_GPIO40); | ||
270 | if (gpio_request(40, "SMC91x irq") < 0) { | ||
271 | printk("Error requesting gpio 40 for smc91x irq\n"); | ||
272 | return; | ||
273 | } | ||
274 | } | ||
275 | |||
267 | #define GPTIMER_BASE 0xFFFB1400 | 276 | #define GPTIMER_BASE 0xFFFB1400 |
268 | #define GPTIMER_REGS(x) (0xFFFB1400 + (x * 0x800)) | 277 | #define GPTIMER_REGS(x) (0xFFFB1400 + (x * 0x800)) |
269 | #define GPTIMER_REGS_SIZE 0x46 | 278 | #define GPTIMER_REGS_SIZE 0x46 |
@@ -376,6 +385,8 @@ static struct i2c_board_info __initdata h3_i2c_board_info[] = { | |||
376 | 385 | ||
377 | static void __init h3_init(void) | 386 | static void __init h3_init(void) |
378 | { | 387 | { |
388 | h3_init_smc91x(); | ||
389 | |||
379 | /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped | 390 | /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped |
380 | * to address 0 by a dip switch), NAND on CS2B. The NAND driver will | 391 | * to address 0 by a dip switch), NAND on CS2B. The NAND driver will |
381 | * notice whether a NAND chip is enabled at probe time. | 392 | * notice whether a NAND chip is enabled at probe time. |
@@ -422,21 +433,11 @@ static void __init h3_init(void) | |||
422 | h3_mmc_init(); | 433 | h3_mmc_init(); |
423 | } | 434 | } |
424 | 435 | ||
425 | static void __init h3_init_smc91x(void) | ||
426 | { | ||
427 | omap_cfg_reg(W15_1710_GPIO40); | ||
428 | if (gpio_request(40, "SMC91x irq") < 0) { | ||
429 | printk("Error requesting gpio 40 for smc91x irq\n"); | ||
430 | return; | ||
431 | } | ||
432 | } | ||
433 | |||
434 | static void __init h3_init_irq(void) | 436 | static void __init h3_init_irq(void) |
435 | { | 437 | { |
436 | omap1_init_common_hw(); | 438 | omap1_init_common_hw(); |
437 | omap_init_irq(); | 439 | omap_init_irq(); |
438 | omap_gpio_init(); | 440 | omap_gpio_init(); |
439 | h3_init_smc91x(); | ||
440 | } | 441 | } |
441 | 442 | ||
442 | static void __init h3_map_io(void) | 443 | static void __init h3_map_io(void) |