[PATCH 2/2 v2] omap: move do_set_mux to omap4_generic

Jan Weitzel j.weitzel at phytec.de
Tue Mar 6 09:26:29 EST 2012


do_set_mux is used by two boards.

Signed-off-by: Jan Weitzel <j.weitzel at phytec.de>
---
v2: add omap4_ prefix

 arch/arm/boards/panda/mux.c                 |   13 ++-----------
 arch/arm/boards/pcm049/mux.c                |   13 ++-----------
 arch/arm/mach-omap/include/mach/omap4-mux.h |    2 ++
 arch/arm/mach-omap/omap4_generic.c          |   10 ++++++++++
 4 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/arch/arm/boards/panda/mux.c b/arch/arm/boards/panda/mux.c
index 7586e86..310e433 100644
--- a/arch/arm/boards/panda/mux.c
+++ b/arch/arm/boards/panda/mux.c
@@ -238,20 +238,11 @@ static const struct pad_conf_entry wkup_padconf_array[] = {
 	{ PAD0_FREF_CLK4_OUT, M3 /* gpio_wk8 */ },
 };
 
-static void do_set_mux(u32 base, struct pad_conf_entry const *array, int size)
-{
-	int i;
-	struct pad_conf_entry *pad = (struct pad_conf_entry *) array;
-
-	for (i = 0; i < size; i++, pad++)
-		writew(pad->val, base + pad->offset);
-}
-
 void set_muxconf_regs(void)
 {
-	do_set_mux(OMAP44XX_CONTROL_PADCONF_CORE, core_padconf_array,
+	omap4_do_set_mux(OMAP44XX_CONTROL_PADCONF_CORE, core_padconf_array,
 			ARRAY_SIZE(core_padconf_array));
 
-	do_set_mux(OMAP44XX_CONTROL_PADCONF_WKUP, wkup_padconf_array,
+	omap4_do_set_mux(OMAP44XX_CONTROL_PADCONF_WKUP, wkup_padconf_array,
 			ARRAY_SIZE(wkup_padconf_array));
 }
diff --git a/arch/arm/boards/pcm049/mux.c b/arch/arm/boards/pcm049/mux.c
index 9911b62..0e7adea 100644
--- a/arch/arm/boards/pcm049/mux.c
+++ b/arch/arm/boards/pcm049/mux.c
@@ -235,20 +235,11 @@ static const struct pad_conf_entry wkup_padconf_array[] = {
 	{PAD1_SYS_BOOT7, (IEN | M3)},					/* gpio_wk10 */
 };
 
-static void do_set_mux(u32 base, struct pad_conf_entry const *array, int size)
-{
-	int i;
-	struct pad_conf_entry *pad = (struct pad_conf_entry *) array;
-
-	for (i = 0; i < size; i++, pad++)
-		writew(pad->val, base + pad->offset);
-}
-
 void set_muxconf_regs(void)
 {
-	do_set_mux(OMAP44XX_CONTROL_PADCONF_CORE, core_padconf_array,
+	omap4_do_set_mux(OMAP44XX_CONTROL_PADCONF_CORE, core_padconf_array,
 			ARRAY_SIZE(core_padconf_array));
 
-	do_set_mux(OMAP44XX_CONTROL_PADCONF_WKUP, wkup_padconf_array,
+	omap4_do_set_mux(OMAP44XX_CONTROL_PADCONF_WKUP, wkup_padconf_array,
 			ARRAY_SIZE(wkup_padconf_array));
 }
diff --git a/arch/arm/mach-omap/include/mach/omap4-mux.h b/arch/arm/mach-omap/include/mach/omap4-mux.h
index 019574b..d06beaa 100644
--- a/arch/arm/mach-omap/include/mach/omap4-mux.h
+++ b/arch/arm/mach-omap/include/mach/omap4-mux.h
@@ -341,4 +341,6 @@ struct pad_conf_entry {
 #define CONTROL_SPARE_R		0x0618
 #define CONTROL_SPARE_R_C0		0x061C
 
+void omap4_do_set_mux(u32 base, struct pad_conf_entry const *array, int size);
+
 #endif /* _MUX_OMAP4_H_ */
diff --git a/arch/arm/mach-omap/omap4_generic.c b/arch/arm/mach-omap/omap4_generic.c
index 8352470..baa138d 100644
--- a/arch/arm/mach-omap/omap4_generic.c
+++ b/arch/arm/mach-omap/omap4_generic.c
@@ -3,6 +3,7 @@
 #include <mach/silicon.h>
 #include <io.h>
 #include <mach/omap4-silicon.h>
+#include <mach/omap4-mux.h>
 #include <mach/omap4-clock.h>
 #include <mach/syslib.h>
 #include <mach/xload.h>
@@ -450,3 +451,12 @@ noinline int omap4_scale_vcores(void)
 
 	return 0;
 }
+
+void omap4_do_set_mux(u32 base, struct pad_conf_entry const *array, int size)
+{
+	int i;
+	struct pad_conf_entry *pad = (struct pad_conf_entry *) array;
+
+	for (i = 0; i < size; i++, pad++)
+		writew(pad->val, base + pad->offset);
+}
-- 
1.7.0.4




More information about the barebox mailing list