diff options
Diffstat (limited to 'arch/arm/mach-omap2/mux.c')
-rw-r--r-- | arch/arm/mach-omap2/mux.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index ab403b2ed26b..074536ae401f 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c | |||
@@ -23,12 +23,11 @@ | |||
23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 | * | 24 | * |
25 | */ | 25 | */ |
26 | #include <linux/module.h> | 26 | #include <linux/kernel.h> |
27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | #include <linux/slab.h> | ||
30 | #include <linux/spinlock.h> | ||
31 | #include <linux/list.h> | 29 | #include <linux/list.h> |
30 | #include <linux/slab.h> | ||
32 | #include <linux/ctype.h> | 31 | #include <linux/ctype.h> |
33 | #include <linux/debugfs.h> | 32 | #include <linux/debugfs.h> |
34 | #include <linux/seq_file.h> | 33 | #include <linux/seq_file.h> |
@@ -36,8 +35,7 @@ | |||
36 | 35 | ||
37 | #include <asm/system.h> | 36 | #include <asm/system.h> |
38 | 37 | ||
39 | #include <plat/control.h> | 38 | #include "control.h" |
40 | |||
41 | #include "mux.h" | 39 | #include "mux.h" |
42 | 40 | ||
43 | #define OMAP_MUX_BASE_OFFSET 0x30 /* Offset from CTRL_BASE */ | 41 | #define OMAP_MUX_BASE_OFFSET 0x30 /* Offset from CTRL_BASE */ |
@@ -87,7 +85,7 @@ static char *omap_mux_options; | |||
87 | int __init omap_mux_init_gpio(int gpio, int val) | 85 | int __init omap_mux_init_gpio(int gpio, int val) |
88 | { | 86 | { |
89 | struct omap_mux_entry *e; | 87 | struct omap_mux_entry *e; |
90 | struct omap_mux *gpio_mux; | 88 | struct omap_mux *gpio_mux = NULL; |
91 | u16 old_mode; | 89 | u16 old_mode; |
92 | u16 mux_mode; | 90 | u16 mux_mode; |
93 | int found = 0; | 91 | int found = 0; |
@@ -127,17 +125,16 @@ int __init omap_mux_init_gpio(int gpio, int val) | |||
127 | return 0; | 125 | return 0; |
128 | } | 126 | } |
129 | 127 | ||
130 | int __init omap_mux_init_signal(char *muxname, int val) | 128 | int __init omap_mux_init_signal(const char *muxname, int val) |
131 | { | 129 | { |
132 | struct omap_mux_entry *e; | 130 | struct omap_mux_entry *e; |
133 | char *m0_name = NULL, *mode_name = NULL; | 131 | const char *mode_name; |
134 | int found = 0; | 132 | int found = 0, mode0_len = 0; |
135 | 133 | ||
136 | mode_name = strchr(muxname, '.'); | 134 | mode_name = strchr(muxname, '.'); |
137 | if (mode_name) { | 135 | if (mode_name) { |
138 | *mode_name = '\0'; | 136 | mode0_len = strlen(muxname) - strlen(mode_name); |
139 | mode_name++; | 137 | mode_name++; |
140 | m0_name = muxname; | ||
141 | } else { | 138 | } else { |
142 | mode_name = muxname; | 139 | mode_name = muxname; |
143 | } | 140 | } |
@@ -147,9 +144,11 @@ int __init omap_mux_init_signal(char *muxname, int val) | |||
147 | char *m0_entry = m->muxnames[0]; | 144 | char *m0_entry = m->muxnames[0]; |
148 | int i; | 145 | int i; |
149 | 146 | ||
150 | if (m0_name && strcmp(m0_name, m0_entry)) | 147 | /* First check for full name in mode0.muxmode format */ |
148 | if (mode0_len && strncmp(muxname, m0_entry, mode0_len)) | ||
151 | continue; | 149 | continue; |
152 | 150 | ||
151 | /* Then check for muxmode only */ | ||
153 | for (i = 0; i < OMAP_MUX_NR_MODES; i++) { | 152 | for (i = 0; i < OMAP_MUX_NR_MODES; i++) { |
154 | char *mode_cur = m->muxnames[i]; | 153 | char *mode_cur = m->muxnames[i]; |
155 | 154 | ||