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 <drw...@gmail.com>

---
 arch/arm/mach-pxa/include/mach/reset.h |    5 +++--
 arch/arm/mach-pxa/reset.c              |    4 ++--
 arch/arm/mach-pxa/spitz.c              |    2 +-
 arch/arm/mach-pxa/tosa.c               |    2 +-
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-pxa/include/mach/reset.h 
b/arch/arm/mach-pxa/include/mach/reset.h
index 31e6a7b..b6c1055 100644
--- a/arch/arm/mach-pxa/include/mach/reset.h
+++ b/arch/arm/mach-pxa/include/mach/reset.h
@@ -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 */
diff --git a/arch/arm/mach-pxa/reset.c b/arch/arm/mach-pxa/reset.c
index df29d45..01e9d64 100644
--- a/arch/arm/mach-pxa/reset.c
+++ b/arch/arm/mach-pxa/reset.c
@@ -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) {
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index c18e34a..cdacea0 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -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;
 
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index afac5b6..a0bd46e 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -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;
-- 
tg: (a425a63..) pxa/gpio_reset (depends on: master)
total: 0 errors, 0 warnings, 43 lines checked

pxa_gpio_reset.patch has no obvious style problems and is ready for submission.

-- 
Daniel Ribeiro


Reply via email to