Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-omap2/mux.c |
| 3 | * |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 4 | * OMAP2, OMAP3 and OMAP4 pin multiplexing configurations |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 5 | * |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 6 | * Copyright (C) 2004 - 2010 Texas Instruments Inc. |
Tony Lindgren | 9330899 | 2008-01-24 17:24:15 -0800 | [diff] [blame] | 7 | * Copyright (C) 2003 - 2008 Nokia Corporation |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 8 | * |
Tony Lindgren | 9330899 | 2008-01-24 17:24:15 -0800 | [diff] [blame] | 9 | * Written by Tony Lindgren |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by |
| 13 | * the Free Software Foundation; either version 2 of the License, or |
| 14 | * (at your option) any later version. |
| 15 | * |
| 16 | * This program is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with this program; if not, write to the Free Software |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 24 | * |
| 25 | */ |
Paul Walmsley | 4814ced | 2010-10-08 11:40:20 -0600 | [diff] [blame] | 26 | #include <linux/kernel.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 27 | #include <linux/init.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 28 | #include <linux/io.h> |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 29 | #include <linux/list.h> |
Paul Walmsley | 4814ced | 2010-10-08 11:40:20 -0600 | [diff] [blame] | 30 | #include <linux/slab.h> |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 31 | #include <linux/ctype.h> |
| 32 | #include <linux/debugfs.h> |
| 33 | #include <linux/seq_file.h> |
| 34 | #include <linux/uaccess.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 35 | |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 36 | #include <asm/system.h> |
| 37 | |
Tony Lindgren | 9796b32 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 38 | #include <plat/omap_hwmod.h> |
| 39 | |
Paul Walmsley | 4814ced | 2010-10-08 11:40:20 -0600 | [diff] [blame] | 40 | #include "control.h" |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 41 | #include "mux.h" |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 42 | |
Mike Rapoport | 92c9f50 | 2009-12-11 16:16:31 -0800 | [diff] [blame] | 43 | #define OMAP_MUX_BASE_OFFSET 0x30 /* Offset from CTRL_BASE */ |
| 44 | #define OMAP_MUX_BASE_SZ 0x5ca |
| 45 | |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 46 | struct omap_mux_entry { |
| 47 | struct omap_mux mux; |
| 48 | struct list_head node; |
| 49 | }; |
| 50 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 51 | static LIST_HEAD(mux_partitions); |
| 52 | static DEFINE_MUTEX(muxmode_mutex); |
Mike Rapoport | 92c9f50 | 2009-12-11 16:16:31 -0800 | [diff] [blame] | 53 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 54 | struct omap_mux_partition *omap_mux_get(const char *name) |
Mike Rapoport | 92c9f50 | 2009-12-11 16:16:31 -0800 | [diff] [blame] | 55 | { |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 56 | struct omap_mux_partition *partition; |
| 57 | |
| 58 | list_for_each_entry(partition, &mux_partitions, node) { |
| 59 | if (!strcmp(name, partition->name)) |
| 60 | return partition; |
| 61 | } |
| 62 | |
| 63 | return NULL; |
Mike Rapoport | 92c9f50 | 2009-12-11 16:16:31 -0800 | [diff] [blame] | 64 | } |
| 65 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 66 | u16 omap_mux_read(struct omap_mux_partition *partition, u16 reg) |
Mike Rapoport | 92c9f50 | 2009-12-11 16:16:31 -0800 | [diff] [blame] | 67 | { |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 68 | if (partition->flags & OMAP_MUX_REG_8BIT) |
| 69 | return __raw_readb(partition->base + reg); |
Mike Rapoport | 92c9f50 | 2009-12-11 16:16:31 -0800 | [diff] [blame] | 70 | else |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 71 | return __raw_readw(partition->base + reg); |
Mike Rapoport | 92c9f50 | 2009-12-11 16:16:31 -0800 | [diff] [blame] | 72 | } |
Tony Lindgren | 7d7f665 | 2008-01-25 00:42:48 -0800 | [diff] [blame] | 73 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 74 | void omap_mux_write(struct omap_mux_partition *partition, u16 val, |
| 75 | u16 reg) |
Tony Lindgren | d4bb72e | 2010-01-19 15:15:24 -0800 | [diff] [blame] | 76 | { |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 77 | if (partition->flags & OMAP_MUX_REG_8BIT) |
| 78 | __raw_writeb(val, partition->base + reg); |
| 79 | else |
| 80 | __raw_writew(val, partition->base + reg); |
| 81 | } |
| 82 | |
| 83 | void omap_mux_write_array(struct omap_mux_partition *partition, |
| 84 | struct omap_board_mux *board_mux) |
| 85 | { |
Colin Cross | d4ff612 | 2011-05-31 12:00:09 -0700 | [diff] [blame] | 86 | if (!board_mux) |
| 87 | return; |
| 88 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 89 | while (board_mux->reg_offset != OMAP_MUX_TERMINATOR) { |
| 90 | omap_mux_write(partition, board_mux->value, |
| 91 | board_mux->reg_offset); |
Tony Lindgren | d4bb72e | 2010-01-19 15:15:24 -0800 | [diff] [blame] | 92 | board_mux++; |
| 93 | } |
| 94 | } |
| 95 | |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 96 | #ifdef CONFIG_OMAP_MUX |
| 97 | |
| 98 | static char *omap_mux_options; |
| 99 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 100 | static int __init _omap_mux_init_gpio(struct omap_mux_partition *partition, |
| 101 | int gpio, int val) |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 102 | { |
| 103 | struct omap_mux_entry *e; |
Sanjeev Premi | ca82876 | 2010-09-23 18:27:18 -0700 | [diff] [blame] | 104 | struct omap_mux *gpio_mux = NULL; |
Grazvydas Ignotas | 8a6f7e1 | 2010-08-02 13:18:28 +0300 | [diff] [blame] | 105 | u16 old_mode; |
| 106 | u16 mux_mode; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 107 | int found = 0; |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 108 | struct list_head *muxmodes = &partition->muxmodes; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 109 | |
| 110 | if (!gpio) |
| 111 | return -EINVAL; |
| 112 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 113 | list_for_each_entry(e, muxmodes, node) { |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 114 | struct omap_mux *m = &e->mux; |
| 115 | if (gpio == m->gpio) { |
Grazvydas Ignotas | 8a6f7e1 | 2010-08-02 13:18:28 +0300 | [diff] [blame] | 116 | gpio_mux = m; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 117 | found++; |
| 118 | } |
| 119 | } |
| 120 | |
Grazvydas Ignotas | 8a6f7e1 | 2010-08-02 13:18:28 +0300 | [diff] [blame] | 121 | if (found == 0) { |
Dan Murphy | 032a642 | 2010-11-15 09:50:50 -0600 | [diff] [blame] | 122 | pr_err("%s: Could not set gpio%i\n", __func__, gpio); |
Grazvydas Ignotas | 8a6f7e1 | 2010-08-02 13:18:28 +0300 | [diff] [blame] | 123 | return -ENODEV; |
| 124 | } |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 125 | |
| 126 | if (found > 1) { |
Dan Murphy | 032a642 | 2010-11-15 09:50:50 -0600 | [diff] [blame] | 127 | pr_info("%s: Multiple gpio paths (%d) for gpio%i\n", __func__, |
Benoit Cousson | 1cbb3a9 | 2010-08-10 17:33:01 +0200 | [diff] [blame] | 128 | found, gpio); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 129 | return -EINVAL; |
| 130 | } |
| 131 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 132 | old_mode = omap_mux_read(partition, gpio_mux->reg_offset); |
Grazvydas Ignotas | 8a6f7e1 | 2010-08-02 13:18:28 +0300 | [diff] [blame] | 133 | mux_mode = val & ~(OMAP_MUX_NR_MODES - 1); |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 134 | if (partition->flags & OMAP_MUX_GPIO_IN_MODE3) |
Grazvydas Ignotas | 8a6f7e1 | 2010-08-02 13:18:28 +0300 | [diff] [blame] | 135 | mux_mode |= OMAP_MUX_MODE3; |
| 136 | else |
| 137 | mux_mode |= OMAP_MUX_MODE4; |
Dan Murphy | 032a642 | 2010-11-15 09:50:50 -0600 | [diff] [blame] | 138 | pr_debug("%s: Setting signal %s.gpio%i 0x%04x -> 0x%04x\n", __func__, |
Benoit Cousson | 1cbb3a9 | 2010-08-10 17:33:01 +0200 | [diff] [blame] | 139 | gpio_mux->muxnames[0], gpio, old_mode, mux_mode); |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 140 | omap_mux_write(partition, mux_mode, gpio_mux->reg_offset); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 141 | |
Grazvydas Ignotas | 8a6f7e1 | 2010-08-02 13:18:28 +0300 | [diff] [blame] | 142 | return 0; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 143 | } |
| 144 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 145 | int __init omap_mux_init_gpio(int gpio, int val) |
| 146 | { |
| 147 | struct omap_mux_partition *partition; |
| 148 | int ret; |
| 149 | |
| 150 | list_for_each_entry(partition, &mux_partitions, node) { |
| 151 | ret = _omap_mux_init_gpio(partition, gpio, val); |
| 152 | if (!ret) |
| 153 | return ret; |
| 154 | } |
| 155 | |
| 156 | return -ENODEV; |
| 157 | } |
| 158 | |
Tony Lindgren | 8419fdb | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 159 | static int __init _omap_mux_get_by_name(struct omap_mux_partition *partition, |
| 160 | const char *muxname, |
| 161 | struct omap_mux **found_mux) |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 162 | { |
Tony Lindgren | 8419fdb | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 163 | struct omap_mux *mux = NULL; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 164 | struct omap_mux_entry *e; |
Tony Lindgren | 5a3b2f7 | 2010-10-01 16:35:24 -0700 | [diff] [blame] | 165 | const char *mode_name; |
Felipe Balbi | afb7d70 | 2011-01-17 06:31:18 +0200 | [diff] [blame] | 166 | int found = 0, found_mode = 0, mode0_len = 0; |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 167 | struct list_head *muxmodes = &partition->muxmodes; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 168 | |
| 169 | mode_name = strchr(muxname, '.'); |
| 170 | if (mode_name) { |
Tony Lindgren | 5a3b2f7 | 2010-10-01 16:35:24 -0700 | [diff] [blame] | 171 | mode0_len = strlen(muxname) - strlen(mode_name); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 172 | mode_name++; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 173 | } else { |
| 174 | mode_name = muxname; |
| 175 | } |
| 176 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 177 | list_for_each_entry(e, muxmodes, node) { |
Tony Lindgren | 8419fdb | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 178 | char *m0_entry; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 179 | int i; |
| 180 | |
Tony Lindgren | 8419fdb | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 181 | mux = &e->mux; |
| 182 | m0_entry = mux->muxnames[0]; |
| 183 | |
Tony Lindgren | 5a3b2f7 | 2010-10-01 16:35:24 -0700 | [diff] [blame] | 184 | /* First check for full name in mode0.muxmode format */ |
| 185 | if (mode0_len && strncmp(muxname, m0_entry, mode0_len)) |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 186 | continue; |
| 187 | |
Tony Lindgren | 5a3b2f7 | 2010-10-01 16:35:24 -0700 | [diff] [blame] | 188 | /* Then check for muxmode only */ |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 189 | for (i = 0; i < OMAP_MUX_NR_MODES; i++) { |
Tony Lindgren | 8419fdb | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 190 | char *mode_cur = mux->muxnames[i]; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 191 | |
| 192 | if (!mode_cur) |
| 193 | continue; |
| 194 | |
| 195 | if (!strcmp(mode_name, mode_cur)) { |
Tony Lindgren | 8419fdb | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 196 | *found_mux = mux; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 197 | found++; |
Tony Lindgren | 8419fdb | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 198 | found_mode = i; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 199 | } |
| 200 | } |
| 201 | } |
| 202 | |
Tony Lindgren | 8419fdb | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 203 | if (found == 1) { |
| 204 | return found_mode; |
| 205 | } |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 206 | |
| 207 | if (found > 1) { |
Dan Murphy | 032a642 | 2010-11-15 09:50:50 -0600 | [diff] [blame] | 208 | pr_err("%s: Multiple signal paths (%i) for %s\n", __func__, |
Benoit Cousson | 1cbb3a9 | 2010-08-10 17:33:01 +0200 | [diff] [blame] | 209 | found, muxname); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 210 | return -EINVAL; |
| 211 | } |
| 212 | |
Tony Lindgren | 8419fdb | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 213 | pr_err("%s: Could not find signal %s\n", __func__, muxname); |
| 214 | |
| 215 | return -ENODEV; |
| 216 | } |
| 217 | |
| 218 | static int __init |
| 219 | omap_mux_get_by_name(const char *muxname, |
| 220 | struct omap_mux_partition **found_partition, |
| 221 | struct omap_mux **found_mux) |
| 222 | { |
| 223 | struct omap_mux_partition *partition; |
| 224 | |
| 225 | list_for_each_entry(partition, &mux_partitions, node) { |
| 226 | struct omap_mux *mux = NULL; |
| 227 | int mux_mode = _omap_mux_get_by_name(partition, muxname, &mux); |
| 228 | if (mux_mode < 0) |
| 229 | continue; |
| 230 | |
| 231 | *found_partition = partition; |
| 232 | *found_mux = mux; |
| 233 | |
| 234 | return mux_mode; |
| 235 | } |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 236 | |
| 237 | return -ENODEV; |
| 238 | } |
| 239 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 240 | int __init omap_mux_init_signal(const char *muxname, int val) |
| 241 | { |
Tony Lindgren | 8419fdb | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 242 | struct omap_mux_partition *partition = NULL; |
| 243 | struct omap_mux *mux = NULL; |
| 244 | u16 old_mode; |
| 245 | int mux_mode; |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 246 | |
Tony Lindgren | 8419fdb | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 247 | mux_mode = omap_mux_get_by_name(muxname, &partition, &mux); |
| 248 | if (mux_mode < 0) |
| 249 | return mux_mode; |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 250 | |
Tony Lindgren | 8419fdb | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 251 | old_mode = omap_mux_read(partition, mux->reg_offset); |
| 252 | mux_mode |= val; |
| 253 | pr_debug("%s: Setting signal %s 0x%04x -> 0x%04x\n", |
| 254 | __func__, muxname, old_mode, mux_mode); |
| 255 | omap_mux_write(partition, mux_mode, mux->reg_offset); |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 256 | |
Tony Lindgren | 8419fdb | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 257 | return 0; |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 258 | } |
| 259 | |
Tony Lindgren | 9796b32 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 260 | struct omap_hwmod_mux_info * __init |
| 261 | omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads) |
| 262 | { |
| 263 | struct omap_hwmod_mux_info *hmux; |
Tony Lindgren | 029268e | 2011-03-11 11:32:25 -0800 | [diff] [blame] | 264 | int i, nr_pads_dynamic = 0; |
Tony Lindgren | 9796b32 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 265 | |
| 266 | if (!bpads || nr_pads < 1) |
| 267 | return NULL; |
| 268 | |
| 269 | hmux = kzalloc(sizeof(struct omap_hwmod_mux_info), GFP_KERNEL); |
| 270 | if (!hmux) |
| 271 | goto err1; |
| 272 | |
| 273 | hmux->nr_pads = nr_pads; |
| 274 | |
| 275 | hmux->pads = kzalloc(sizeof(struct omap_device_pad) * |
| 276 | nr_pads, GFP_KERNEL); |
| 277 | if (!hmux->pads) |
| 278 | goto err2; |
| 279 | |
| 280 | for (i = 0; i < hmux->nr_pads; i++) { |
| 281 | struct omap_mux_partition *partition; |
| 282 | struct omap_device_pad *bpad = &bpads[i], *pad = &hmux->pads[i]; |
| 283 | struct omap_mux *mux; |
| 284 | int mux_mode; |
| 285 | |
| 286 | mux_mode = omap_mux_get_by_name(bpad->name, &partition, &mux); |
| 287 | if (mux_mode < 0) |
| 288 | goto err3; |
| 289 | if (!pad->partition) |
| 290 | pad->partition = partition; |
| 291 | if (!pad->mux) |
| 292 | pad->mux = mux; |
| 293 | |
| 294 | pad->name = kzalloc(strlen(bpad->name) + 1, GFP_KERNEL); |
| 295 | if (!pad->name) { |
| 296 | int j; |
| 297 | |
| 298 | for (j = i - 1; j >= 0; j--) |
| 299 | kfree(hmux->pads[j].name); |
| 300 | goto err3; |
| 301 | } |
| 302 | strcpy(pad->name, bpad->name); |
| 303 | |
| 304 | pad->flags = bpad->flags; |
| 305 | pad->enable = bpad->enable; |
| 306 | pad->idle = bpad->idle; |
| 307 | pad->off = bpad->off; |
Tony Lindgren | 029268e | 2011-03-11 11:32:25 -0800 | [diff] [blame] | 308 | |
| 309 | if (pad->flags & OMAP_DEVICE_PAD_REMUX) |
| 310 | nr_pads_dynamic++; |
| 311 | |
Tony Lindgren | 9796b32 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 312 | pr_debug("%s: Initialized %s\n", __func__, pad->name); |
| 313 | } |
| 314 | |
Tony Lindgren | 029268e | 2011-03-11 11:32:25 -0800 | [diff] [blame] | 315 | if (!nr_pads_dynamic) |
| 316 | return hmux; |
| 317 | |
| 318 | /* |
| 319 | * Add pads that need dynamic muxing into a separate list |
| 320 | */ |
| 321 | |
| 322 | hmux->nr_pads_dynamic = nr_pads_dynamic; |
| 323 | hmux->pads_dynamic = kzalloc(sizeof(struct omap_device_pad *) * |
| 324 | nr_pads_dynamic, GFP_KERNEL); |
| 325 | if (!hmux->pads_dynamic) { |
| 326 | pr_err("%s: Could not allocate dynamic pads\n", __func__); |
| 327 | return hmux; |
| 328 | } |
| 329 | |
| 330 | nr_pads_dynamic = 0; |
| 331 | for (i = 0; i < hmux->nr_pads; i++) { |
| 332 | struct omap_device_pad *pad = &hmux->pads[i]; |
| 333 | |
| 334 | if (pad->flags & OMAP_DEVICE_PAD_REMUX) { |
| 335 | pr_debug("%s: pad %s tagged dynamic\n", |
| 336 | __func__, pad->name); |
| 337 | hmux->pads_dynamic[nr_pads_dynamic] = pad; |
| 338 | nr_pads_dynamic++; |
| 339 | } |
| 340 | } |
| 341 | |
Tony Lindgren | 9796b32 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 342 | return hmux; |
| 343 | |
| 344 | err3: |
| 345 | kfree(hmux->pads); |
| 346 | err2: |
| 347 | kfree(hmux); |
| 348 | err1: |
| 349 | pr_err("%s: Could not allocate device mux entry\n", __func__); |
| 350 | |
| 351 | return NULL; |
| 352 | } |
| 353 | |
Tony Lindgren | 8d9af88 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 354 | /* Assumes the calling function takes care of locking */ |
| 355 | void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state) |
| 356 | { |
| 357 | int i; |
| 358 | |
Tony Lindgren | 029268e | 2011-03-11 11:32:25 -0800 | [diff] [blame] | 359 | /* Runtime idling of dynamic pads */ |
| 360 | if (state == _HWMOD_STATE_IDLE && hmux->enabled) { |
| 361 | for (i = 0; i < hmux->nr_pads_dynamic; i++) { |
| 362 | struct omap_device_pad *pad = hmux->pads_dynamic[i]; |
| 363 | int val = -EINVAL; |
| 364 | |
Tony Lindgren | 029268e | 2011-03-11 11:32:25 -0800 | [diff] [blame] | 365 | val = pad->idle; |
| 366 | omap_mux_write(pad->partition, val, |
| 367 | pad->mux->reg_offset); |
| 368 | } |
| 369 | |
| 370 | return; |
| 371 | } |
| 372 | |
| 373 | /* Runtime enabling of dynamic pads */ |
R Sricharan | 86c79bf | 2011-03-11 11:32:25 -0800 | [diff] [blame] | 374 | if ((state == _HWMOD_STATE_ENABLED) && hmux->pads_dynamic |
| 375 | && hmux->enabled) { |
Tony Lindgren | 029268e | 2011-03-11 11:32:25 -0800 | [diff] [blame] | 376 | for (i = 0; i < hmux->nr_pads_dynamic; i++) { |
| 377 | struct omap_device_pad *pad = hmux->pads_dynamic[i]; |
| 378 | int val = -EINVAL; |
| 379 | |
Tony Lindgren | 029268e | 2011-03-11 11:32:25 -0800 | [diff] [blame] | 380 | val = pad->enable; |
| 381 | omap_mux_write(pad->partition, val, |
| 382 | pad->mux->reg_offset); |
Tony Lindgren | 029268e | 2011-03-11 11:32:25 -0800 | [diff] [blame] | 383 | } |
| 384 | |
R Sricharan | 86c79bf | 2011-03-11 11:32:25 -0800 | [diff] [blame] | 385 | return; |
Tony Lindgren | 029268e | 2011-03-11 11:32:25 -0800 | [diff] [blame] | 386 | } |
| 387 | |
| 388 | /* Enabling or disabling of all pads */ |
Tony Lindgren | 8d9af88 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 389 | for (i = 0; i < hmux->nr_pads; i++) { |
| 390 | struct omap_device_pad *pad = &hmux->pads[i]; |
| 391 | int flags, val = -EINVAL; |
| 392 | |
| 393 | flags = pad->flags; |
| 394 | |
| 395 | switch (state) { |
| 396 | case _HWMOD_STATE_ENABLED: |
Tony Lindgren | 8d9af88 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 397 | val = pad->enable; |
| 398 | pr_debug("%s: Enabling %s %x\n", __func__, |
| 399 | pad->name, val); |
| 400 | break; |
Tony Lindgren | 8d9af88 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 401 | case _HWMOD_STATE_DISABLED: |
Tony Lindgren | 8d9af88 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 402 | /* Use safe mode unless OMAP_DEVICE_PAD_REMUX */ |
| 403 | if (flags & OMAP_DEVICE_PAD_REMUX) |
| 404 | val = pad->off; |
| 405 | else |
| 406 | val = OMAP_MUX_MODE7; |
Tony Lindgren | 8d9af88 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 407 | pr_debug("%s: Disabling %s %x\n", __func__, |
| 408 | pad->name, val); |
R Sricharan | 86c79bf | 2011-03-11 11:32:25 -0800 | [diff] [blame] | 409 | break; |
| 410 | default: |
| 411 | /* Nothing to be done */ |
| 412 | break; |
Tony Lindgren | 8d9af88 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 413 | }; |
| 414 | |
| 415 | if (val >= 0) { |
| 416 | omap_mux_write(pad->partition, val, |
| 417 | pad->mux->reg_offset); |
| 418 | pad->flags = flags; |
| 419 | } |
| 420 | } |
Tony Lindgren | 029268e | 2011-03-11 11:32:25 -0800 | [diff] [blame] | 421 | |
| 422 | if (state == _HWMOD_STATE_ENABLED) |
| 423 | hmux->enabled = true; |
| 424 | else |
| 425 | hmux->enabled = false; |
Tony Lindgren | 8d9af88 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 426 | } |
| 427 | |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 428 | #ifdef CONFIG_DEBUG_FS |
| 429 | |
| 430 | #define OMAP_MUX_MAX_NR_FLAGS 10 |
| 431 | #define OMAP_MUX_TEST_FLAG(val, mask) \ |
| 432 | if (((val) & (mask)) == (mask)) { \ |
| 433 | i++; \ |
| 434 | flags[i] = #mask; \ |
| 435 | } |
| 436 | |
| 437 | /* REVISIT: Add checking for non-optimal mux settings */ |
| 438 | static inline void omap_mux_decode(struct seq_file *s, u16 val) |
| 439 | { |
| 440 | char *flags[OMAP_MUX_MAX_NR_FLAGS]; |
Tony Lindgren | 78737ae | 2010-02-01 13:03:42 -0800 | [diff] [blame] | 441 | char mode[sizeof("OMAP_MUX_MODE") + 1]; |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 442 | int i = -1; |
| 443 | |
| 444 | sprintf(mode, "OMAP_MUX_MODE%d", val & 0x7); |
| 445 | i++; |
| 446 | flags[i] = mode; |
| 447 | |
| 448 | OMAP_MUX_TEST_FLAG(val, OMAP_PIN_OFF_WAKEUPENABLE); |
| 449 | if (val & OMAP_OFF_EN) { |
| 450 | if (!(val & OMAP_OFFOUT_EN)) { |
| 451 | if (!(val & OMAP_OFF_PULL_UP)) { |
| 452 | OMAP_MUX_TEST_FLAG(val, |
| 453 | OMAP_PIN_OFF_INPUT_PULLDOWN); |
| 454 | } else { |
| 455 | OMAP_MUX_TEST_FLAG(val, |
| 456 | OMAP_PIN_OFF_INPUT_PULLUP); |
| 457 | } |
| 458 | } else { |
| 459 | if (!(val & OMAP_OFFOUT_VAL)) { |
| 460 | OMAP_MUX_TEST_FLAG(val, |
| 461 | OMAP_PIN_OFF_OUTPUT_LOW); |
| 462 | } else { |
| 463 | OMAP_MUX_TEST_FLAG(val, |
| 464 | OMAP_PIN_OFF_OUTPUT_HIGH); |
| 465 | } |
| 466 | } |
| 467 | } |
| 468 | |
| 469 | if (val & OMAP_INPUT_EN) { |
| 470 | if (val & OMAP_PULL_ENA) { |
| 471 | if (!(val & OMAP_PULL_UP)) { |
| 472 | OMAP_MUX_TEST_FLAG(val, |
| 473 | OMAP_PIN_INPUT_PULLDOWN); |
| 474 | } else { |
| 475 | OMAP_MUX_TEST_FLAG(val, OMAP_PIN_INPUT_PULLUP); |
| 476 | } |
| 477 | } else { |
| 478 | OMAP_MUX_TEST_FLAG(val, OMAP_PIN_INPUT); |
| 479 | } |
| 480 | } else { |
| 481 | i++; |
| 482 | flags[i] = "OMAP_PIN_OUTPUT"; |
| 483 | } |
| 484 | |
| 485 | do { |
| 486 | seq_printf(s, "%s", flags[i]); |
| 487 | if (i > 0) |
| 488 | seq_printf(s, " | "); |
| 489 | } while (i-- > 0); |
| 490 | } |
| 491 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 492 | #define OMAP_MUX_DEFNAME_LEN 32 |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 493 | |
| 494 | static int omap_mux_dbg_board_show(struct seq_file *s, void *unused) |
| 495 | { |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 496 | struct omap_mux_partition *partition = s->private; |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 497 | struct omap_mux_entry *e; |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 498 | u8 omap_gen = omap_rev() >> 28; |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 499 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 500 | list_for_each_entry(e, &partition->muxmodes, node) { |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 501 | struct omap_mux *m = &e->mux; |
| 502 | char m0_def[OMAP_MUX_DEFNAME_LEN]; |
| 503 | char *m0_name = m->muxnames[0]; |
| 504 | u16 val; |
| 505 | int i, mode; |
| 506 | |
| 507 | if (!m0_name) |
| 508 | continue; |
| 509 | |
Tony Lindgren | 78737ae | 2010-02-01 13:03:42 -0800 | [diff] [blame] | 510 | /* REVISIT: Needs to be updated if mode0 names get longer */ |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 511 | for (i = 0; i < OMAP_MUX_DEFNAME_LEN; i++) { |
| 512 | if (m0_name[i] == '\0') { |
| 513 | m0_def[i] = m0_name[i]; |
| 514 | break; |
| 515 | } |
| 516 | m0_def[i] = toupper(m0_name[i]); |
| 517 | } |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 518 | val = omap_mux_read(partition, m->reg_offset); |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 519 | mode = val & OMAP_MUX_MODE7; |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 520 | if (mode != 0) |
| 521 | seq_printf(s, "/* %s */\n", m->muxnames[mode]); |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 522 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 523 | /* |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 524 | * XXX: Might be revisited to support differences across |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 525 | * same OMAP generation. |
| 526 | */ |
| 527 | seq_printf(s, "OMAP%d_MUX(%s, ", omap_gen, m0_def); |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 528 | omap_mux_decode(s, val); |
| 529 | seq_printf(s, "),\n"); |
| 530 | } |
| 531 | |
| 532 | return 0; |
| 533 | } |
| 534 | |
| 535 | static int omap_mux_dbg_board_open(struct inode *inode, struct file *file) |
| 536 | { |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 537 | return single_open(file, omap_mux_dbg_board_show, inode->i_private); |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 538 | } |
| 539 | |
| 540 | static const struct file_operations omap_mux_dbg_board_fops = { |
| 541 | .open = omap_mux_dbg_board_open, |
| 542 | .read = seq_read, |
| 543 | .llseek = seq_lseek, |
| 544 | .release = single_release, |
| 545 | }; |
| 546 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 547 | static struct omap_mux_partition *omap_mux_get_partition(struct omap_mux *mux) |
| 548 | { |
| 549 | struct omap_mux_partition *partition; |
| 550 | |
| 551 | list_for_each_entry(partition, &mux_partitions, node) { |
| 552 | struct list_head *muxmodes = &partition->muxmodes; |
| 553 | struct omap_mux_entry *e; |
| 554 | |
| 555 | list_for_each_entry(e, muxmodes, node) { |
| 556 | struct omap_mux *m = &e->mux; |
| 557 | |
| 558 | if (m == mux) |
| 559 | return partition; |
| 560 | } |
| 561 | } |
| 562 | |
| 563 | return NULL; |
| 564 | } |
| 565 | |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 566 | static int omap_mux_dbg_signal_show(struct seq_file *s, void *unused) |
| 567 | { |
| 568 | struct omap_mux *m = s->private; |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 569 | struct omap_mux_partition *partition; |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 570 | const char *none = "NA"; |
| 571 | u16 val; |
| 572 | int mode; |
| 573 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 574 | partition = omap_mux_get_partition(m); |
| 575 | if (!partition) |
| 576 | return 0; |
| 577 | |
| 578 | val = omap_mux_read(partition, m->reg_offset); |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 579 | mode = val & OMAP_MUX_MODE7; |
| 580 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 581 | seq_printf(s, "name: %s.%s (0x%08x/0x%03x = 0x%04x), b %s, t %s\n", |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 582 | m->muxnames[0], m->muxnames[mode], |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 583 | partition->phys + m->reg_offset, m->reg_offset, val, |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 584 | m->balls[0] ? m->balls[0] : none, |
| 585 | m->balls[1] ? m->balls[1] : none); |
| 586 | seq_printf(s, "mode: "); |
| 587 | omap_mux_decode(s, val); |
| 588 | seq_printf(s, "\n"); |
| 589 | seq_printf(s, "signals: %s | %s | %s | %s | %s | %s | %s | %s\n", |
| 590 | m->muxnames[0] ? m->muxnames[0] : none, |
| 591 | m->muxnames[1] ? m->muxnames[1] : none, |
| 592 | m->muxnames[2] ? m->muxnames[2] : none, |
| 593 | m->muxnames[3] ? m->muxnames[3] : none, |
| 594 | m->muxnames[4] ? m->muxnames[4] : none, |
| 595 | m->muxnames[5] ? m->muxnames[5] : none, |
| 596 | m->muxnames[6] ? m->muxnames[6] : none, |
| 597 | m->muxnames[7] ? m->muxnames[7] : none); |
| 598 | |
| 599 | return 0; |
| 600 | } |
| 601 | |
| 602 | #define OMAP_MUX_MAX_ARG_CHAR 7 |
| 603 | |
| 604 | static ssize_t omap_mux_dbg_signal_write(struct file *file, |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 605 | const char __user *user_buf, |
| 606 | size_t count, loff_t *ppos) |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 607 | { |
| 608 | char buf[OMAP_MUX_MAX_ARG_CHAR]; |
| 609 | struct seq_file *seqf; |
| 610 | struct omap_mux *m; |
| 611 | unsigned long val; |
| 612 | int buf_size, ret; |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 613 | struct omap_mux_partition *partition; |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 614 | |
| 615 | if (count > OMAP_MUX_MAX_ARG_CHAR) |
| 616 | return -EINVAL; |
| 617 | |
| 618 | memset(buf, 0, sizeof(buf)); |
| 619 | buf_size = min(count, sizeof(buf) - 1); |
| 620 | |
| 621 | if (copy_from_user(buf, user_buf, buf_size)) |
| 622 | return -EFAULT; |
| 623 | |
| 624 | ret = strict_strtoul(buf, 0x10, &val); |
| 625 | if (ret < 0) |
| 626 | return ret; |
| 627 | |
| 628 | if (val > 0xffff) |
| 629 | return -EINVAL; |
| 630 | |
| 631 | seqf = file->private_data; |
| 632 | m = seqf->private; |
| 633 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 634 | partition = omap_mux_get_partition(m); |
| 635 | if (!partition) |
| 636 | return -ENODEV; |
| 637 | |
| 638 | omap_mux_write(partition, (u16)val, m->reg_offset); |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 639 | *ppos += count; |
| 640 | |
| 641 | return count; |
| 642 | } |
| 643 | |
| 644 | static int omap_mux_dbg_signal_open(struct inode *inode, struct file *file) |
| 645 | { |
| 646 | return single_open(file, omap_mux_dbg_signal_show, inode->i_private); |
| 647 | } |
| 648 | |
| 649 | static const struct file_operations omap_mux_dbg_signal_fops = { |
| 650 | .open = omap_mux_dbg_signal_open, |
| 651 | .read = seq_read, |
| 652 | .write = omap_mux_dbg_signal_write, |
| 653 | .llseek = seq_lseek, |
| 654 | .release = single_release, |
| 655 | }; |
| 656 | |
| 657 | static struct dentry *mux_dbg_dir; |
| 658 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 659 | static void __init omap_mux_dbg_create_entry( |
| 660 | struct omap_mux_partition *partition, |
| 661 | struct dentry *mux_dbg_dir) |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 662 | { |
| 663 | struct omap_mux_entry *e; |
| 664 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 665 | list_for_each_entry(e, &partition->muxmodes, node) { |
| 666 | struct omap_mux *m = &e->mux; |
| 667 | |
Vasiliy Kulikov | 9b12771 | 2011-02-04 12:23:13 +0000 | [diff] [blame] | 668 | (void)debugfs_create_file(m->muxnames[0], S_IWUSR, mux_dbg_dir, |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 669 | m, &omap_mux_dbg_signal_fops); |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | static void __init omap_mux_dbg_init(void) |
| 674 | { |
| 675 | struct omap_mux_partition *partition; |
| 676 | static struct dentry *mux_dbg_board_dir; |
| 677 | |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 678 | mux_dbg_dir = debugfs_create_dir("omap_mux", NULL); |
| 679 | if (!mux_dbg_dir) |
| 680 | return; |
| 681 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 682 | mux_dbg_board_dir = debugfs_create_dir("board", mux_dbg_dir); |
| 683 | if (!mux_dbg_board_dir) |
| 684 | return; |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 685 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 686 | list_for_each_entry(partition, &mux_partitions, node) { |
| 687 | omap_mux_dbg_create_entry(partition, mux_dbg_dir); |
| 688 | (void)debugfs_create_file(partition->name, S_IRUGO, |
| 689 | mux_dbg_board_dir, partition, |
| 690 | &omap_mux_dbg_board_fops); |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 691 | } |
| 692 | } |
| 693 | |
| 694 | #else |
| 695 | static inline void omap_mux_dbg_init(void) |
| 696 | { |
| 697 | } |
| 698 | #endif /* CONFIG_DEBUG_FS */ |
| 699 | |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 700 | static void __init omap_mux_free_names(struct omap_mux *m) |
| 701 | { |
| 702 | int i; |
| 703 | |
| 704 | for (i = 0; i < OMAP_MUX_NR_MODES; i++) |
| 705 | kfree(m->muxnames[i]); |
| 706 | |
| 707 | #ifdef CONFIG_DEBUG_FS |
| 708 | for (i = 0; i < OMAP_MUX_NR_SIDES; i++) |
| 709 | kfree(m->balls[i]); |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 710 | #endif |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 711 | |
| 712 | } |
| 713 | |
| 714 | /* Free all data except for GPIO pins unless CONFIG_DEBUG_FS is set */ |
| 715 | static int __init omap_mux_late_init(void) |
| 716 | { |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 717 | struct omap_mux_partition *partition; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 718 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 719 | list_for_each_entry(partition, &mux_partitions, node) { |
| 720 | struct omap_mux_entry *e, *tmp; |
| 721 | list_for_each_entry_safe(e, tmp, &partition->muxmodes, node) { |
| 722 | struct omap_mux *m = &e->mux; |
| 723 | u16 mode = omap_mux_read(partition, m->reg_offset); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 724 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 725 | if (OMAP_MODE_GPIO(mode)) |
| 726 | continue; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 727 | |
| 728 | #ifndef CONFIG_DEBUG_FS |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 729 | mutex_lock(&muxmode_mutex); |
| 730 | list_del(&e->node); |
| 731 | mutex_unlock(&muxmode_mutex); |
| 732 | omap_mux_free_names(m); |
| 733 | kfree(m); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 734 | #endif |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 735 | } |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 736 | } |
| 737 | |
Tony Lindgren | 4b715ef | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 738 | omap_mux_dbg_init(); |
| 739 | |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 740 | return 0; |
| 741 | } |
| 742 | late_initcall(omap_mux_late_init); |
| 743 | |
| 744 | static void __init omap_mux_package_fixup(struct omap_mux *p, |
| 745 | struct omap_mux *superset) |
| 746 | { |
| 747 | while (p->reg_offset != OMAP_MUX_TERMINATOR) { |
| 748 | struct omap_mux *s = superset; |
| 749 | int found = 0; |
| 750 | |
| 751 | while (s->reg_offset != OMAP_MUX_TERMINATOR) { |
| 752 | if (s->reg_offset == p->reg_offset) { |
| 753 | *s = *p; |
| 754 | found++; |
| 755 | break; |
| 756 | } |
| 757 | s++; |
| 758 | } |
| 759 | if (!found) |
Dan Murphy | 032a642 | 2010-11-15 09:50:50 -0600 | [diff] [blame] | 760 | pr_err("%s: Unknown entry offset 0x%x\n", __func__, |
Benoit Cousson | 1cbb3a9 | 2010-08-10 17:33:01 +0200 | [diff] [blame] | 761 | p->reg_offset); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 762 | p++; |
| 763 | } |
| 764 | } |
| 765 | |
| 766 | #ifdef CONFIG_DEBUG_FS |
| 767 | |
| 768 | static void __init omap_mux_package_init_balls(struct omap_ball *b, |
| 769 | struct omap_mux *superset) |
| 770 | { |
| 771 | while (b->reg_offset != OMAP_MUX_TERMINATOR) { |
| 772 | struct omap_mux *s = superset; |
| 773 | int found = 0; |
| 774 | |
| 775 | while (s->reg_offset != OMAP_MUX_TERMINATOR) { |
| 776 | if (s->reg_offset == b->reg_offset) { |
| 777 | s->balls[0] = b->balls[0]; |
| 778 | s->balls[1] = b->balls[1]; |
| 779 | found++; |
| 780 | break; |
| 781 | } |
| 782 | s++; |
| 783 | } |
| 784 | if (!found) |
Dan Murphy | 032a642 | 2010-11-15 09:50:50 -0600 | [diff] [blame] | 785 | pr_err("%s: Unknown ball offset 0x%x\n", __func__, |
Benoit Cousson | 1cbb3a9 | 2010-08-10 17:33:01 +0200 | [diff] [blame] | 786 | b->reg_offset); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 787 | b++; |
| 788 | } |
| 789 | } |
| 790 | |
| 791 | #else /* CONFIG_DEBUG_FS */ |
| 792 | |
| 793 | static inline void omap_mux_package_init_balls(struct omap_ball *b, |
| 794 | struct omap_mux *superset) |
| 795 | { |
| 796 | } |
| 797 | |
| 798 | #endif /* CONFIG_DEBUG_FS */ |
| 799 | |
| 800 | static int __init omap_mux_setup(char *options) |
| 801 | { |
| 802 | if (!options) |
| 803 | return 0; |
| 804 | |
| 805 | omap_mux_options = options; |
| 806 | |
| 807 | return 1; |
| 808 | } |
| 809 | __setup("omap_mux=", omap_mux_setup); |
| 810 | |
| 811 | /* |
| 812 | * Note that the omap_mux=some.signal1=0x1234,some.signal2=0x1234 |
| 813 | * cmdline options only override the bootloader values. |
| 814 | * During development, please enable CONFIG_DEBUG_FS, and use the |
| 815 | * signal specific entries under debugfs. |
| 816 | */ |
| 817 | static void __init omap_mux_set_cmdline_signals(void) |
| 818 | { |
| 819 | char *options, *next_opt, *token; |
| 820 | |
| 821 | if (!omap_mux_options) |
| 822 | return; |
| 823 | |
Thomas Meyer | dccb3b0 | 2011-08-06 09:29:10 +0000 | [diff] [blame] | 824 | options = kstrdup(omap_mux_options, GFP_KERNEL); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 825 | if (!options) |
| 826 | return; |
| 827 | |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 828 | next_opt = options; |
| 829 | |
| 830 | while ((token = strsep(&next_opt, ",")) != NULL) { |
| 831 | char *keyval, *name; |
| 832 | unsigned long val; |
| 833 | |
| 834 | keyval = token; |
| 835 | name = strsep(&keyval, "="); |
| 836 | if (name) { |
| 837 | int res; |
| 838 | |
| 839 | res = strict_strtoul(keyval, 0x10, &val); |
| 840 | if (res < 0) |
| 841 | continue; |
| 842 | |
| 843 | omap_mux_init_signal(name, (u16)val); |
| 844 | } |
| 845 | } |
| 846 | |
| 847 | kfree(options); |
| 848 | } |
| 849 | |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 850 | static int __init omap_mux_copy_names(struct omap_mux *src, |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 851 | struct omap_mux *dst) |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 852 | { |
| 853 | int i; |
| 854 | |
| 855 | for (i = 0; i < OMAP_MUX_NR_MODES; i++) { |
| 856 | if (src->muxnames[i]) { |
Thomas Meyer | dccb3b0 | 2011-08-06 09:29:10 +0000 | [diff] [blame] | 857 | dst->muxnames[i] = kstrdup(src->muxnames[i], |
| 858 | GFP_KERNEL); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 859 | if (!dst->muxnames[i]) |
| 860 | goto free; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 861 | } |
| 862 | } |
| 863 | |
| 864 | #ifdef CONFIG_DEBUG_FS |
| 865 | for (i = 0; i < OMAP_MUX_NR_SIDES; i++) { |
| 866 | if (src->balls[i]) { |
Thomas Meyer | dccb3b0 | 2011-08-06 09:29:10 +0000 | [diff] [blame] | 867 | dst->balls[i] = kstrdup(src->balls[i], GFP_KERNEL); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 868 | if (!dst->balls[i]) |
| 869 | goto free; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 870 | } |
| 871 | } |
| 872 | #endif |
| 873 | |
| 874 | return 0; |
| 875 | |
| 876 | free: |
| 877 | omap_mux_free_names(dst); |
| 878 | return -ENOMEM; |
| 879 | |
| 880 | } |
| 881 | |
| 882 | #endif /* CONFIG_OMAP_MUX */ |
| 883 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 884 | static struct omap_mux *omap_mux_get_by_gpio( |
| 885 | struct omap_mux_partition *partition, |
| 886 | int gpio) |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 887 | { |
| 888 | struct omap_mux_entry *e; |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 889 | struct omap_mux *ret = NULL; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 890 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 891 | list_for_each_entry(e, &partition->muxmodes, node) { |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 892 | struct omap_mux *m = &e->mux; |
| 893 | if (m->gpio == gpio) { |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 894 | ret = m; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 895 | break; |
| 896 | } |
| 897 | } |
| 898 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 899 | return ret; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 900 | } |
| 901 | |
| 902 | /* Needed for dynamic muxing of GPIO pins for off-idle */ |
| 903 | u16 omap_mux_get_gpio(int gpio) |
| 904 | { |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 905 | struct omap_mux_partition *partition; |
Govindraj.R | 30ebad9 | 2011-06-01 11:28:56 +0530 | [diff] [blame] | 906 | struct omap_mux *m = NULL; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 907 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 908 | list_for_each_entry(partition, &mux_partitions, node) { |
| 909 | m = omap_mux_get_by_gpio(partition, gpio); |
| 910 | if (m) |
| 911 | return omap_mux_read(partition, m->reg_offset); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 912 | } |
| 913 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 914 | if (!m || m->reg_offset == OMAP_MUX_TERMINATOR) |
Dan Murphy | 032a642 | 2010-11-15 09:50:50 -0600 | [diff] [blame] | 915 | pr_err("%s: Could not get gpio%i\n", __func__, gpio); |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 916 | |
| 917 | return OMAP_MUX_TERMINATOR; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 918 | } |
| 919 | |
| 920 | /* Needed for dynamic muxing of GPIO pins for off-idle */ |
| 921 | void omap_mux_set_gpio(u16 val, int gpio) |
| 922 | { |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 923 | struct omap_mux_partition *partition; |
| 924 | struct omap_mux *m = NULL; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 925 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 926 | list_for_each_entry(partition, &mux_partitions, node) { |
| 927 | m = omap_mux_get_by_gpio(partition, gpio); |
| 928 | if (m) { |
| 929 | omap_mux_write(partition, val, m->reg_offset); |
| 930 | return; |
| 931 | } |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 932 | } |
| 933 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 934 | if (!m || m->reg_offset == OMAP_MUX_TERMINATOR) |
Dan Murphy | 032a642 | 2010-11-15 09:50:50 -0600 | [diff] [blame] | 935 | pr_err("%s: Could not set gpio%i\n", __func__, gpio); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 936 | } |
| 937 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 938 | static struct omap_mux * __init omap_mux_list_add( |
| 939 | struct omap_mux_partition *partition, |
| 940 | struct omap_mux *src) |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 941 | { |
| 942 | struct omap_mux_entry *entry; |
| 943 | struct omap_mux *m; |
| 944 | |
| 945 | entry = kzalloc(sizeof(struct omap_mux_entry), GFP_KERNEL); |
| 946 | if (!entry) |
| 947 | return NULL; |
| 948 | |
| 949 | m = &entry->mux; |
Aaro Koskinen | 3083314 | 2011-01-06 19:49:28 -0800 | [diff] [blame] | 950 | entry->mux = *src; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 951 | |
| 952 | #ifdef CONFIG_OMAP_MUX |
| 953 | if (omap_mux_copy_names(src, m)) { |
| 954 | kfree(entry); |
| 955 | return NULL; |
| 956 | } |
| 957 | #endif |
| 958 | |
| 959 | mutex_lock(&muxmode_mutex); |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 960 | list_add_tail(&entry->node, &partition->muxmodes); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 961 | mutex_unlock(&muxmode_mutex); |
| 962 | |
| 963 | return m; |
| 964 | } |
| 965 | |
| 966 | /* |
| 967 | * Note if CONFIG_OMAP_MUX is not selected, we will only initialize |
| 968 | * the GPIO to mux offset mapping that is needed for dynamic muxing |
| 969 | * of GPIO pins for off-idle. |
| 970 | */ |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 971 | static void __init omap_mux_init_list(struct omap_mux_partition *partition, |
| 972 | struct omap_mux *superset) |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 973 | { |
| 974 | while (superset->reg_offset != OMAP_MUX_TERMINATOR) { |
| 975 | struct omap_mux *entry; |
| 976 | |
Ranjith Lohithakshan | b72c7d5 | 2010-02-17 17:17:01 +0000 | [diff] [blame] | 977 | #ifdef CONFIG_OMAP_MUX |
| 978 | if (!superset->muxnames || !superset->muxnames[0]) { |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 979 | superset++; |
| 980 | continue; |
| 981 | } |
Ranjith Lohithakshan | b72c7d5 | 2010-02-17 17:17:01 +0000 | [diff] [blame] | 982 | #else |
| 983 | /* Skip pins that are not muxed as GPIO by bootloader */ |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 984 | if (!OMAP_MODE_GPIO(omap_mux_read(partition, |
| 985 | superset->reg_offset))) { |
Tony Lindgren | 9ecef43 | 2010-02-01 11:22:54 -0800 | [diff] [blame] | 986 | superset++; |
| 987 | continue; |
| 988 | } |
| 989 | #endif |
| 990 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 991 | entry = omap_mux_list_add(partition, superset); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 992 | if (!entry) { |
Dan Murphy | 032a642 | 2010-11-15 09:50:50 -0600 | [diff] [blame] | 993 | pr_err("%s: Could not add entry\n", __func__); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 994 | return; |
| 995 | } |
| 996 | superset++; |
| 997 | } |
| 998 | } |
| 999 | |
Tony Lindgren | 321cfc8 | 2010-02-15 10:03:35 -0800 | [diff] [blame] | 1000 | #ifdef CONFIG_OMAP_MUX |
| 1001 | |
| 1002 | static void omap_mux_init_package(struct omap_mux *superset, |
| 1003 | struct omap_mux *package_subset, |
| 1004 | struct omap_ball *package_balls) |
| 1005 | { |
| 1006 | if (package_subset) |
| 1007 | omap_mux_package_fixup(package_subset, superset); |
| 1008 | if (package_balls) |
| 1009 | omap_mux_package_init_balls(package_balls, superset); |
| 1010 | } |
| 1011 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 1012 | static void omap_mux_init_signals(struct omap_mux_partition *partition, |
| 1013 | struct omap_board_mux *board_mux) |
Tony Lindgren | 321cfc8 | 2010-02-15 10:03:35 -0800 | [diff] [blame] | 1014 | { |
| 1015 | omap_mux_set_cmdline_signals(); |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 1016 | omap_mux_write_array(partition, board_mux); |
Tony Lindgren | 321cfc8 | 2010-02-15 10:03:35 -0800 | [diff] [blame] | 1017 | } |
| 1018 | |
| 1019 | #else |
| 1020 | |
| 1021 | static void omap_mux_init_package(struct omap_mux *superset, |
| 1022 | struct omap_mux *package_subset, |
| 1023 | struct omap_ball *package_balls) |
| 1024 | { |
| 1025 | } |
| 1026 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 1027 | static void omap_mux_init_signals(struct omap_mux_partition *partition, |
| 1028 | struct omap_board_mux *board_mux) |
Tony Lindgren | 321cfc8 | 2010-02-15 10:03:35 -0800 | [diff] [blame] | 1029 | { |
| 1030 | } |
| 1031 | |
| 1032 | #endif |
| 1033 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 1034 | static u32 mux_partitions_cnt; |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 1035 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 1036 | int __init omap_mux_init(const char *name, u32 flags, |
| 1037 | u32 mux_pbase, u32 mux_size, |
| 1038 | struct omap_mux *superset, |
| 1039 | struct omap_mux *package_subset, |
| 1040 | struct omap_board_mux *board_mux, |
| 1041 | struct omap_ball *package_balls) |
| 1042 | { |
| 1043 | struct omap_mux_partition *partition; |
| 1044 | |
| 1045 | partition = kzalloc(sizeof(struct omap_mux_partition), GFP_KERNEL); |
| 1046 | if (!partition) |
| 1047 | return -ENOMEM; |
| 1048 | |
| 1049 | partition->name = name; |
| 1050 | partition->flags = flags; |
| 1051 | partition->size = mux_size; |
| 1052 | partition->phys = mux_pbase; |
| 1053 | partition->base = ioremap(mux_pbase, mux_size); |
| 1054 | if (!partition->base) { |
Dan Murphy | 032a642 | 2010-11-15 09:50:50 -0600 | [diff] [blame] | 1055 | pr_err("%s: Could not ioremap mux partition at 0x%08x\n", |
| 1056 | __func__, partition->phys); |
Aaro Koskinen | 9d47e30 | 2011-01-28 14:50:55 +0000 | [diff] [blame] | 1057 | kfree(partition); |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 1058 | return -ENODEV; |
| 1059 | } |
| 1060 | |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 1061 | INIT_LIST_HEAD(&partition->muxmodes); |
| 1062 | |
| 1063 | list_add_tail(&partition->node, &mux_partitions); |
| 1064 | mux_partitions_cnt++; |
Dan Murphy | 032a642 | 2010-11-15 09:50:50 -0600 | [diff] [blame] | 1065 | pr_info("%s: Add partition: #%d: %s, flags: %x\n", __func__, |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 1066 | mux_partitions_cnt, partition->name, partition->flags); |
Tony Lindgren | d5425be | 2010-07-05 16:31:35 +0300 | [diff] [blame] | 1067 | |
Tony Lindgren | 321cfc8 | 2010-02-15 10:03:35 -0800 | [diff] [blame] | 1068 | omap_mux_init_package(superset, package_subset, package_balls); |
Benoit Cousson | 112485e | 2010-08-16 10:55:35 +0200 | [diff] [blame] | 1069 | omap_mux_init_list(partition, superset); |
| 1070 | omap_mux_init_signals(partition, board_mux); |
Tony Lindgren | 2cb0c54 | 2010-01-19 18:17:07 -0800 | [diff] [blame] | 1071 | |
Tony Lindgren | 15ac7af | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 1072 | return 0; |
| 1073 | } |
| 1074 | |