[ARM] pxa: fix gpio issue in zylonite

WARNING: at drivers/gpio/gpiolib.c:83 gpio_ensure_requested+0x58/0xbc()
 autorequest GPIO-71
 Modules linked in:
 [<c0028bd0>] (unwind_backtrace+0x0/0xe8) from [<c003c328>] (warn_slowpath_common+0x48/0x78)
 [<c003c328>] (warn_slowpath_common+0x48/0x78) from [<c003c394>] (warn_slowpath_fmt+0x28/0x38)
 [<c003c394>] (warn_slowpath_fmt+0x28/0x38) from [<c0146128>] (gpio_ensure_requested+0x58/0xbc)
 [<c0146128>] (gpio_ensure_requested+0x58/0xbc) from [<c0146308>] (gpio_direction_input+0x80/0xf4)
 [<c0146308>] (gpio_direction_input+0x80/0xf4) from [<c000c668>] (zylonite_pxa300_init+0x108/0x214)
 [<c000c668>] (zylonite_pxa300_init+0x108/0x214) from [<c000c4e4>] (zylonite_init+0x8/0x84)
 [<c000c4e4>] (zylonite_init+0x8/0x84) from [<c00097cc>] (customize_machine+0x18/0x24)
 [<c00097cc>] (customize_machine+0x18/0x24) from [<c00222e0>] (do_one_initcall+0x30/0x1b0)
 [<c00222e0>] (do_one_initcall+0x30/0x1b0) from [<c00083f4>] (kernel_init+0xa4/0x11c)
 [<c00083f4>] (kernel_init+0xa4/0x11c) from [<c0023f3c>] (kernel_thread_exit+0x0/0x8)
 ---[ end trace 1b75b31a2719ed1c ]---

This issue is caused by using gpio pin without request. Add gpio_request()
into zylonite. To simplify the code, error checking is omitted since this
is being performed early.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
This commit is contained in:
Haojian Zhuang 2009-07-15 19:47:24 +08:00 committed by Eric Miao
parent 22fe84394f
commit eb9069119d
2 changed files with 4 additions and 0 deletions

View file

@ -197,10 +197,12 @@ static void __init zylonite_detect_lcd_panel(void)
for (i = 0; i < NUM_LCD_DETECT_PINS; i++) {
id = id << 1;
gpio = mfp_to_gpio(lcd_detect_pins[i]);
gpio_request(gpio, "LCD_ID_PINS");
gpio_direction_input(gpio);
if (gpio_get_value(gpio))
id = id | 0x1;
gpio_free(gpio);
}
/* lcd id, flush out bit 1 */

View file

@ -176,10 +176,12 @@ static void __init zylonite_detect_lcd_panel(void)
for (i = 0; i < NUM_LCD_DETECT_PINS; i++) {
id = id << 1;
gpio = mfp_to_gpio(lcd_detect_pins[i]);
gpio_request(gpio, "LCD_ID_PINS");
gpio_direction_input(gpio);
if (gpio_get_value(gpio))
id = id | 0x1;
gpio_free(gpio);
}
/* lcd id, flush out bit 1 */