diff options
author | Igor Grinberg <grinberg@compulab.co.il> | 2011-05-03 11:22:09 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-05-12 05:52:06 -0400 |
commit | bc593f5d787d0a015539e21868302fb44a47c3e3 (patch) | |
tree | 75feac78712ae08e38b678c0dae62cb75765ddb0 /arch/arm/mach-omap2/board-omap3touchbook.c | |
parent | 9e18630b689d658d65bf59508bfec084f61ff5c6 (diff) |
arm: omap2plus: GPIO cleanup
use gpio_request_<one|array>() instead of multiple gpiolib calls,
remove unneeded variables, etc.
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3touchbook.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3touchbook.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index 392278d9a88..82872d7d313 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c | |||
@@ -146,13 +146,11 @@ static int touchbook_twl_gpio_setup(struct device *dev, | |||
146 | /* REVISIT: need ehci-omap hooks for external VBUS | 146 | /* REVISIT: need ehci-omap hooks for external VBUS |
147 | * power switch and overcurrent detect | 147 | * power switch and overcurrent detect |
148 | */ | 148 | */ |
149 | 149 | gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC"); | |
150 | gpio_request(gpio + 1, "EHCI_nOC"); | ||
151 | gpio_direction_input(gpio + 1); | ||
152 | 150 | ||
153 | /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */ | 151 | /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */ |
154 | gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR"); | 152 | gpio_request_one(gpio + TWL4030_GPIO_MAX, GPIOF_OUT_INIT_LOW, |
155 | gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); | 153 | "nEN_USB_PWR"); |
156 | 154 | ||
157 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ | 155 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ |
158 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; | 156 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; |
@@ -401,15 +399,10 @@ static const struct usbhs_omap_board_data usbhs_bdata __initconst = { | |||
401 | 399 | ||
402 | static void omap3_touchbook_poweroff(void) | 400 | static void omap3_touchbook_poweroff(void) |
403 | { | 401 | { |
404 | int r; | 402 | int pwr_off = TB_KILL_POWER_GPIO; |
405 | 403 | ||
406 | r = gpio_request(TB_KILL_POWER_GPIO, "DVI reset"); | 404 | if (gpio_request_one(pwr_off, GPIOF_OUT_INIT_LOW, "DVI reset") < 0) |
407 | if (r < 0) { | ||
408 | printk(KERN_ERR "Unable to get kill power GPIO\n"); | 405 | printk(KERN_ERR "Unable to get kill power GPIO\n"); |
409 | return; | ||
410 | } | ||
411 | |||
412 | gpio_direction_output(TB_KILL_POWER_GPIO, 0); | ||
413 | } | 406 | } |
414 | 407 | ||
415 | static int __init early_touchbook_revision(char *p) | 408 | static int __init early_touchbook_revision(char *p) |
@@ -435,9 +428,8 @@ static void __init omap3_touchbook_init(void) | |||
435 | omap_serial_init(); | 428 | omap_serial_init(); |
436 | 429 | ||
437 | omap_mux_init_gpio(170, OMAP_PIN_INPUT); | 430 | omap_mux_init_gpio(170, OMAP_PIN_INPUT); |
438 | gpio_request(176, "DVI_nPD"); | ||
439 | /* REVISIT leave DVI powered down until it's needed ... */ | 431 | /* REVISIT leave DVI powered down until it's needed ... */ |
440 | gpio_direction_output(176, true); | 432 | gpio_request_one(176, GPIOF_OUT_INIT_HIGH, "DVI_nPD"); |
441 | 433 | ||
442 | /* Touchscreen and accelerometer */ | 434 | /* Touchscreen and accelerometer */ |
443 | omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata); | 435 | omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata); |