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

Jan Weitzel j.weitzel at phytec.de
Mon Mar 5 05:19:44 EST 2012


do_set_mux is used by two boards.

Signed-off-by: Jan Weitzel <j.weitzel at phytec.de>
---
 arch/arm/boards/panda/mux.c                 |    9 ---------
 arch/arm/boards/pcm049/mux.c                |    9 ---------
 arch/arm/mach-omap/include/mach/omap4-mux.h |    2 ++
 arch/arm/mach-omap/omap4_generic.c          |   10 ++++++++++
 4 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/arch/arm/boards/panda/mux.c b/arch/arm/boards/panda/mux.c
index 7586e86..5a5c155 100644
--- a/arch/arm/boards/panda/mux.c
+++ b/arch/arm/boards/panda/mux.c
@@ -238,15 +238,6 @@ 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,
diff --git a/arch/arm/boards/pcm049/mux.c b/arch/arm/boards/pcm049/mux.c
index 9911b62..f8a23d8 100644
--- a/arch/arm/boards/pcm049/mux.c
+++ b/arch/arm/boards/pcm049/mux.c
@@ -235,15 +235,6 @@ 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,
diff --git a/arch/arm/mach-omap/include/mach/omap4-mux.h b/arch/arm/mach-omap/include/mach/omap4-mux.h
index 019574b..dfecfd5 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 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 76cf2f5..9c0dbf6 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 scale_vcores(void)
 
 	return 0;
 }
+
+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);
+}
-- 
1.7.0.4




More information about the barebox mailing list