diff options
author | David Brownell <david-b@pacbell.net> | 2008-02-26 03:01:23 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-04-14 12:57:06 -0400 |
commit | ac37a0b0ba7e8a6afce8db3f6c3367a3cfedad26 (patch) | |
tree | 18277a64c2662334c1ada7c721dc9daa2f6f4fbf /arch/arm | |
parent | 52e3134423c3af4431fedb34f77e31cfff91e0c3 (diff) |
ARM: OMAP: 5912 OSK GPIO updates
Start cleaning up GPIO handling for OMAP5912 OSK board:
- Initialize GPIOs using the cross-platform calls, not the old
OMAP-private ones.
- Move touchscreen setup out of ads7846 code into board-specfic
setup code, where it belongs.
This doesn't depend on the patches to update OMAP to use the
gpiolib implementation framework.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap1/board-osk.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c index 5279e35a8aec..dd9ece8f409f 100644 --- a/arch/arm/mach-omap1/board-osk.c +++ b/arch/arm/mach-omap1/board-osk.c | |||
@@ -198,7 +198,7 @@ static struct i2c_board_info __initdata osk_i2c_board_info[] = { | |||
198 | 198 | ||
199 | static void __init osk_init_smc91x(void) | 199 | static void __init osk_init_smc91x(void) |
200 | { | 200 | { |
201 | if ((omap_request_gpio(0)) < 0) { | 201 | if ((gpio_request(0, "smc_irq")) < 0) { |
202 | printk("Error requesting gpio 0 for smc91x irq\n"); | 202 | printk("Error requesting gpio 0 for smc91x irq\n"); |
203 | return; | 203 | return; |
204 | } | 204 | } |
@@ -210,7 +210,7 @@ static void __init osk_init_smc91x(void) | |||
210 | static void __init osk_init_cf(void) | 210 | static void __init osk_init_cf(void) |
211 | { | 211 | { |
212 | omap_cfg_reg(M7_1610_GPIO62); | 212 | omap_cfg_reg(M7_1610_GPIO62); |
213 | if ((omap_request_gpio(62)) < 0) { | 213 | if ((gpio_request(62, "cf_irq")) < 0) { |
214 | printk("Error requesting gpio 62 for CF irq\n"); | 214 | printk("Error requesting gpio 62 for CF irq\n"); |
215 | return; | 215 | return; |
216 | } | 216 | } |
@@ -334,7 +334,7 @@ static struct platform_device *mistral_devices[] __initdata = { | |||
334 | 334 | ||
335 | static int mistral_get_pendown_state(void) | 335 | static int mistral_get_pendown_state(void) |
336 | { | 336 | { |
337 | return !omap_get_gpio_datain(4); | 337 | return !gpio_get_value(4); |
338 | } | 338 | } |
339 | 339 | ||
340 | static const struct ads7846_platform_data mistral_ts_info = { | 340 | static const struct ads7846_platform_data mistral_ts_info = { |
@@ -396,25 +396,31 @@ static void __init osk_mistral_init(void) | |||
396 | omap_cfg_reg(W14_1610_CCP_DATAP); | 396 | omap_cfg_reg(W14_1610_CCP_DATAP); |
397 | 397 | ||
398 | /* CAM_PWDN */ | 398 | /* CAM_PWDN */ |
399 | if (omap_request_gpio(11) == 0) { | 399 | if (gpio_request(11, "cam_pwdn") == 0) { |
400 | omap_cfg_reg(N20_1610_GPIO11); | 400 | omap_cfg_reg(N20_1610_GPIO11); |
401 | omap_set_gpio_direction(11, 0 /* out */); | 401 | gpio_direction_output(11, 0); |
402 | omap_set_gpio_dataout(11, 0 /* off */); | ||
403 | } else | 402 | } else |
404 | pr_debug("OSK+Mistral: CAM_PWDN is awol\n"); | 403 | pr_debug("OSK+Mistral: CAM_PWDN is awol\n"); |
405 | 404 | ||
406 | 405 | ||
407 | /* omap_cfg_reg(P19_1610_GPIO6); */ /* BUSY */ | 406 | /* omap_cfg_reg(P19_1610_GPIO6); */ /* BUSY */ |
407 | gpio_request(6, "ts_busy"); | ||
408 | gpio_direction_input(6); | ||
409 | |||
408 | omap_cfg_reg(P20_1610_GPIO4); /* PENIRQ */ | 410 | omap_cfg_reg(P20_1610_GPIO4); /* PENIRQ */ |
411 | gpio_request(4, "ts_int"); | ||
412 | gpio_direction_input(4); | ||
409 | set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING); | 413 | set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING); |
414 | |||
410 | spi_register_board_info(mistral_boardinfo, | 415 | spi_register_board_info(mistral_boardinfo, |
411 | ARRAY_SIZE(mistral_boardinfo)); | 416 | ARRAY_SIZE(mistral_boardinfo)); |
412 | 417 | ||
413 | /* the sideways button (SW1) is for use as a "wakeup" button */ | 418 | /* the sideways button (SW1) is for use as a "wakeup" button */ |
414 | omap_cfg_reg(N15_1610_MPUIO2); | 419 | omap_cfg_reg(N15_1610_MPUIO2); |
415 | if (omap_request_gpio(OMAP_MPUIO(2)) == 0) { | 420 | if (gpio_request(OMAP_MPUIO(2), "wakeup") == 0) { |
416 | int ret = 0; | 421 | int ret = 0; |
417 | omap_set_gpio_direction(OMAP_MPUIO(2), 1); | 422 | |
423 | gpio_direction_input(OMAP_MPUIO(2)); | ||
418 | set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQT_RISING); | 424 | set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQT_RISING); |
419 | #ifdef CONFIG_PM | 425 | #ifdef CONFIG_PM |
420 | /* share the IRQ in case someone wants to use the | 426 | /* share the IRQ in case someone wants to use the |
@@ -425,7 +431,7 @@ static void __init osk_mistral_init(void) | |||
425 | IRQF_SHARED, "mistral_wakeup", | 431 | IRQF_SHARED, "mistral_wakeup", |
426 | &osk_mistral_wake_interrupt); | 432 | &osk_mistral_wake_interrupt); |
427 | if (ret != 0) { | 433 | if (ret != 0) { |
428 | omap_free_gpio(OMAP_MPUIO(2)); | 434 | gpio_free(OMAP_MPUIO(2)); |
429 | printk(KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n", | 435 | printk(KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n", |
430 | ret); | 436 | ret); |
431 | } else | 437 | } else |
@@ -438,10 +444,8 @@ static void __init osk_mistral_init(void) | |||
438 | * board, like the touchscreen, EEPROM, and wakeup (!) switch. | 444 | * board, like the touchscreen, EEPROM, and wakeup (!) switch. |
439 | */ | 445 | */ |
440 | omap_cfg_reg(PWL); | 446 | omap_cfg_reg(PWL); |
441 | if (omap_request_gpio(2) == 0) { | 447 | if (gpio_request(2, "lcd_pwr") == 0) |
442 | omap_set_gpio_direction(2, 0 /* out */); | 448 | gpio_direction_output(2, 1); |
443 | omap_set_gpio_dataout(2, 1 /* on */); | ||
444 | } | ||
445 | 449 | ||
446 | platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices)); | 450 | platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices)); |
447 | } | 451 | } |