]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: 5300/1: fixup spitz reset during boot
authorDmitry Baryshkov <dbaryshkov@gmail.com>
Thu, 9 Oct 2008 15:58:13 +0000 (16:58 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 13 Nov 2008 17:56:03 +0000 (09:56 -0800)
commit 69fc7eed5f56bce15b239e5110de2575a6970df4 upstream

Some machines don't have the pullup/down on their reset
pin, so configuring the reset generating pin as input makes
them reset immediately. Fix that by making reset pin direction
configurable.

This fixes the boot problem on Sharp Zaurus c3000

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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 9489a48871a88a8196deb0bb001df9be2cebadb2..7b8842cfa5fce30753914f538a0d125d2d1a349d 100644 (file)
 extern unsigned int reset_status;
 extern void clear_reset_status(unsigned int mask);
 
-/*
- * register GPIO as reset generator
+/**
+ * init_gpio_reset() - register GPIO as reset generator
+ *
+ * @gpio - gpio nr
+ * @output - set gpio as out/low instead of input during normal work
  */
-extern int init_gpio_reset(int gpio);
+extern int init_gpio_reset(int gpio, int output);
 
 #endif /* __ASM_ARCH_RESET_H */
index 9996c612c3d685d2ed749578f118b93262bfb6cc..1b236a62de1f6fa3df397473255a501a1cbf401c 100644 (file)
@@ -20,7 +20,7 @@ static void do_hw_reset(void);
 
 static int reset_gpio = -1;
 
-int init_gpio_reset(int gpio)
+int init_gpio_reset(int gpio, int output)
 {
        int rc;
 
@@ -30,9 +30,12 @@ int init_gpio_reset(int gpio)
                goto out;
        }
 
-       rc = gpio_direction_input(gpio);
+       if (output)
+               rc = gpio_direction_output(gpio, 0);
+       else
+               rc = gpio_direction_input(gpio);
        if (rc) {
-               printk(KERN_ERR "Can't configure reset_gpio for input\n");
+               printk(KERN_ERR "Can't configure reset_gpio\n");
                gpio_free(gpio);
                goto out;
        }
index b569f3b4cf3a68dfa629e201ab79da0e464e0908..32cee4c9279b749d6333017a6c32d01887029901 100644 (file)
@@ -548,7 +548,7 @@ static void spitz_restart(char mode)
 
 static void __init common_init(void)
 {
-       init_gpio_reset(SPITZ_GPIO_ON_RESET);
+       init_gpio_reset(SPITZ_GPIO_ON_RESET, 1);
        pm_power_off = spitz_poweroff;
        arm_pm_restart = spitz_restart;
 
index 9f3ef9eb32e37366d0ecf5d3b6e8d1abaada4fab..130e37e4ebdd2292aef62443a8614e89d8dd92bd 100644 (file)
@@ -781,7 +781,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);
+       init_gpio_reset(TOSA_GPIO_ON_RESET, 0);
 
        pm_power_off = tosa_poweroff;
        arm_pm_restart = tosa_restart;