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-fsample.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-fsample.c')
-rw-r--r-- | arch/arm/mach-omap1/board-fsample.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c index 149fdd32e127..295ab6713670 100644 --- a/arch/arm/mach-omap1/board-fsample.c +++ b/arch/arm/mach-omap1/board-fsample.c | |||
@@ -120,6 +120,15 @@ static struct resource smc91x_resources[] = { | |||
120 | }, | 120 | }, |
121 | }; | 121 | }; |
122 | 122 | ||
123 | static void __init fsample_init_smc91x(void) | ||
124 | { | ||
125 | fpga_write(1, H2P2_DBG_FPGA_LAN_RESET); | ||
126 | mdelay(50); | ||
127 | fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1, | ||
128 | H2P2_DBG_FPGA_LAN_RESET); | ||
129 | mdelay(50); | ||
130 | } | ||
131 | |||
123 | static struct mtd_partition nor_partitions[] = { | 132 | static struct mtd_partition nor_partitions[] = { |
124 | /* bootloader (U-Boot, etc) in first sector */ | 133 | /* bootloader (U-Boot, etc) in first sector */ |
125 | { | 134 | { |
@@ -285,6 +294,8 @@ static struct omap_board_config_kernel fsample_config[] = { | |||
285 | 294 | ||
286 | static void __init omap_fsample_init(void) | 295 | static void __init omap_fsample_init(void) |
287 | { | 296 | { |
297 | fsample_init_smc91x(); | ||
298 | |||
288 | if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0) | 299 | if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0) |
289 | BUG(); | 300 | BUG(); |
290 | gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN); | 301 | gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN); |
@@ -312,21 +323,11 @@ static void __init omap_fsample_init(void) | |||
312 | omap_register_i2c_bus(1, 100, NULL, 0); | 323 | omap_register_i2c_bus(1, 100, NULL, 0); |
313 | } | 324 | } |
314 | 325 | ||
315 | static void __init fsample_init_smc91x(void) | ||
316 | { | ||
317 | fpga_write(1, H2P2_DBG_FPGA_LAN_RESET); | ||
318 | mdelay(50); | ||
319 | fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1, | ||
320 | H2P2_DBG_FPGA_LAN_RESET); | ||
321 | mdelay(50); | ||
322 | } | ||
323 | |||
324 | static void __init omap_fsample_init_irq(void) | 326 | static void __init omap_fsample_init_irq(void) |
325 | { | 327 | { |
326 | omap1_init_common_hw(); | 328 | omap1_init_common_hw(); |
327 | omap_init_irq(); | 329 | omap_init_irq(); |
328 | omap_gpio_init(); | 330 | omap_gpio_init(); |
329 | fsample_init_smc91x(); | ||
330 | } | 331 | } |
331 | 332 | ||
332 | /* Only FPGA needs to be mapped here. All others are done with ioremap */ | 333 | /* Only FPGA needs to be mapped here. All others are done with ioremap */ |