Skip to contentSkip to conversation

AR7: initialize GPIO earlier

PATCH In review Florian Fainelli 2 participants 2 messages Aug 29, 2010 – Oct 18, 2010 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 AR7: initialize GPIO earlier

In order to detect the Titan variant, we must initialize GPIOs earlier since detection relies on some GPIO values to be set.

---

arch/mips/ar7/gpio.c +1 -2
index c32fbb5..f848342 100644
@@ -107,7 +107,7 @@ int ar7_gpio_disable(unsigned gpio)
 }
 EXPORT_SYMBOL(ar7_gpio_disable);
 
-static int __init ar7_gpio_init(void)
+int __init ar7_gpio_init(void)
 {
 	int ret;
 
@@ -128,4 +128,3 @@ static int __init ar7_gpio_init(void)
 				ar7_gpio_chip.chip.ngpio);
 	return ret;
 }
-arch_initcall(ar7_gpio_init);
arch/mips/ar7/prom.c +2 -0
index 5238579..23818d2 100644
@@ -246,6 +246,8 @@ void __init prom_init(void)
 	ar7_init_cmdline(fw_arg0, (char **)fw_arg1);
 	ar7_init_env((struct env_var *)fw_arg2);
 	console_config();
+
+	ar7_gpio_init();
 }
 
 #define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4)))
arch/mips/include/asm/mach- renamed from arch/mips/include/asm/mach-ar7/ar7.h +0 -0

ar7/ar7.h
index 483ffea..ddb413e 100644

arch/mips/include/asm/mach-ar7/ar7.h +2 -0
@@ -161,4 +161,6 @@ static inline void ar7_device_off(u32 bit)
 	msleep(20);
 }
 
+int __init ar7_gpio_init(void);
+
 #endif /* __AR7_H__ */