Skip to contentSkip to conversation

mach-ux500: Remove most of the ugly machine_is_u8500() calls

PATCH New Lee Jones 3 participants 3 messages Aug 26, 2011 – Aug 29, 2011

Subsystems (3)
lore
Share & tools
lore

Lee Jones

author
#0 lore raw

PATCH 1/1 mach-ux500: Remove most of the ugly machine_is_u8500() calls

---
 arch/arm/mach-ux500/board-mop500-pins.c       |   34 +++++++----
 arch/arm/mach-ux500/board-mop500-sdi.c        |   52 +++++++++++-----
 arch/arm/mach-ux500/board-mop500.c            |   78 +++++++++++++++++++-----
 arch/arm/mach-ux500/board-mop500.h            |    3 +
 arch/arm/mach-ux500/include/mach/uncompress.h |   10 +---
 5 files changed, 124 insertions(+), 53 deletions(-)
arch/arm/mach-ux500/board-mop500-pins.c +23 -11
index f26fd76..4108c7b 100644
@@ -153,7 +153,7 @@ static pin_cfg_t mop500_pins_default[] = {
 	GPIO7_U1_RTSn	| PIN_OUTPUT_HIGH,
 };
 
-static pin_cfg_t mop500_pins_hrefv60[] = {
+static pin_cfg_t hrefv60_pins[] = {
 	/* WLAN */
 	GPIO4_GPIO		| PIN_INPUT_PULLUP,/* WLAN_IRQ */
 	GPIO85_GPIO		| PIN_OUTPUT_LOW,/* WLAN_ENA */
@@ -279,14 +279,26 @@ static pin_cfg_t snowball_pins[] = {
 void __init mop500_pins_init(void)
 {
 	nmk_config_pins(mop500_pins_common,
-				ARRAY_SIZE(mop500_pins_common));
-	if (machine_is_hrefv60())
-		nmk_config_pins(mop500_pins_hrefv60,
-				ARRAY_SIZE(mop500_pins_hrefv60));
-	else if (machine_is_snowball())
-		nmk_config_pins(snowball_pins,
-				ARRAY_SIZE(snowball_pins));
-	else
-		nmk_config_pins(mop500_pins_default,
-				ARRAY_SIZE(mop500_pins_default));
+			ARRAY_SIZE(mop500_pins_common));
+
+	nmk_config_pins(mop500_pins_default,
+			ARRAY_SIZE(mop500_pins_default));
+}
+
+void __init snowball_pins_init(void)
+{
+	nmk_config_pins(mop500_pins_common,
+			ARRAY_SIZE(mop500_pins_common));
+
+	nmk_config_pins(snowball_pins,
+			ARRAY_SIZE(snowball_pins));
+}
+
+void __init hrefv60_pins_init(void)
+{
+	nmk_config_pins(mop500_pins_common,
+			ARRAY_SIZE(mop500_pins_common));
+
+	nmk_config_pins(hrefv60_pins,
+			ARRAY_SIZE(hrefv60_pins));
 }
arch/arm/mach-ux500/board-mop500-sdi.c +35 -17

65 lines not on this page · raw message

arch/arm/mach-ux500/board-mop500.c +61 -17

109 lines not on this page · raw message

arch/arm/mach-ux500/board-mop500.h +3 -0
index ee77a89..de18a2a 100644
@@ -40,10 +40,13 @@
 struct i2c_board_info;
 
 extern void mop500_sdi_init(void);
+extern void snowball_sdi_init(void);
 extern void mop500_sdi_tc35892_init(void);
 void __init mop500_u8500uib_init(void);
 void __init mop500_stuib_init(void);
 void __init mop500_pins_init(void);
+void __init hrefv60_pins_init(void);
+void __init snowball_pins_init(void);
 
 void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info,
 		unsigned n);
arch/arm/mach-ux500/include/mach/uncompress.h +2 -8
index 7dd0807..6fb3c4b 100644
@@ -51,15 +51,9 @@ static void flush(void)
 static inline void arch_decomp_setup(void)
 {
 	/* Check in run time if we run on an U8500 or U5500 */
-	if (machine_is_u8500() ||
-	    machine_is_svp8500v1() ||
-	    machine_is_svp8500v2() ||
-	    machine_is_hrefv60()   ||
-	    machine_is_snowball())
-		ux500_uart_base = U8500_UART2_BASE;
-	else if (machine_is_u5500())
+	if (machine_is_u5500())
 		ux500_uart_base = U5500_UART0_BASE;
-	else /* not much can be done to help here */
+	else
 		ux500_uart_base = U8500_UART2_BASE;
 }
 
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/1 mach-ux500: Remove most of the ugly machine_is_u8500() calls

Quoted 1 line · Lee Jones

Excellent patch Lee, no commit message so I added something and pushed to ux500-core.

Thanks,
Linus Walleij