[ARM] pxa: allow gpio_reset drive high during normal work
authorDaniel Ribeiro <drwyrm@gmail.com>
Wed, 6 May 2009 01:43:18 +0000 (22:43 -0300)
committerEric Miao <eric.miao@marvell.com>
Mon, 18 May 2009 13:52:09 +0000 (21:52 +0800)
I want to reuse tosa/spitz gpio_reset code, but my board needs the reset
gpio to be driven high during normal operation.

Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
Acked-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
arch/arm/mach-pxa/include/mach/reset.h
arch/arm/mach-pxa/reset.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/tosa.c

index 31e6a7b6ad80d27f055b9ce49da0b7e036e06755..b6c10556fbc7931ab2382fee61fa73e9c8291081 100644 (file)
@@ -13,8 +13,9 @@ extern void clear_reset_status(unsigned int mask);
 /**
  * init_gpio_reset() - register GPIO as reset generator
  * @gpio: gpio nr
- * @output: set gpio as out/low instead of input during normal work
+ * @output: set gpio as output instead of input during normal work
+ * @level: output level
  */
-extern int init_gpio_reset(int gpio, int output);
+extern int init_gpio_reset(int gpio, int output, int level);
 
 #endif /* __ASM_ARCH_RESET_H */
index df29d45fb4e72db6cabbe06332018071fbe1774d..01e9d643394a9d28160a98ccaee118761d8fb75f 100644 (file)
@@ -20,7 +20,7 @@ static void do_hw_reset(void);
 
 static int reset_gpio = -1;
 
-int init_gpio_reset(int gpio, int output)
+int init_gpio_reset(int gpio, int output, int level)
 {
        int rc;
 
@@ -31,7 +31,7 @@ int init_gpio_reset(int gpio, int output)
        }
 
        if (output)
-               rc = gpio_direction_output(gpio, 0);
+               rc = gpio_direction_output(gpio, level);
        else
                rc = gpio_direction_input(gpio);
        if (rc) {
index c18e34acafcb427563f874a2a59804a952a3b2b5..cdacea09abfa14de7157d6f14deef9a0f03fc59b 100644 (file)
@@ -731,7 +731,7 @@ static void spitz_restart(char mode, const char *cmd)
 
 static void __init common_init(void)
 {
-       init_gpio_reset(SPITZ_GPIO_ON_RESET, 1);
+       init_gpio_reset(SPITZ_GPIO_ON_RESET, 1, 0);
        pm_power_off = spitz_poweroff;
        arm_pm_restart = spitz_restart;
 
index afac5b6d3d78e50212afbca1df72579f57de00e4..a0bd46ef5d30de6fb09cda7fc96371a344c95207 100644 (file)
@@ -897,7 +897,7 @@ static void __init tosa_init(void)
        gpio_set_wake(MFP_PIN_GPIO1, 1);
        /* We can't pass to gpio-keys since it will drop the Reset altfunc */
 
-       init_gpio_reset(TOSA_GPIO_ON_RESET, 0);
+       init_gpio_reset(TOSA_GPIO_ON_RESET, 0, 0);
 
        pm_power_off = tosa_poweroff;
        arm_pm_restart = tosa_restart;
This page took 0.028793 seconds and 5 git commands to generate.