25 #include <linux/module.h>
30 #include <mach/hardware.h>
34 #ifdef CONFIG_OMAP_MUX
38 #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
78 #define OMAP7XX_PINS_SZ ARRAY_SIZE(omap7xx_pins)
80 #define omap7xx_pins NULL
81 #define OMAP7XX_PINS_SZ 0
84 #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
90 MUX_CFG(
"UART1_TX", 9, 21, 1, 2, 3, 0,
NA, 0, 0)
123 MUX_CFG("USB1_SE0", 9, 0, 2, 1, 28, 0, NA, 0, 1)
132 MUX_CFG("R13_1710_USB1_SEO", A, 12, 5, 2, 10, 0, NA, 0, 1)
140 MUX_CFG("USB2_SE0", C, 24, 2, 3, 2, 0, NA, 0, 1)
266 MUX_CFG("Y10_USB0_SUSP", B, 3, 5, 2, 17, 0, 2, 0, 1)
340 #define OMAP1XXX_PINS_SZ ARRAY_SIZE(omap1xxx_pins)
342 #define omap1xxx_pins NULL
343 #define OMAP1XXX_PINS_SZ 0
350 unsigned int reg_orig = 0,
reg = 0, pu_pd_orig = 0, pu_pd = 0,
351 pull_orig = 0,
pull = 0;
363 tmp1 = reg_orig &
mask;
364 reg = reg_orig & ~mask;
373 spin_unlock_irqrestore(&mux_spin_lock, flags);
384 if (!(pu_pd_orig & mask))
387 pu_pd = pu_pd_orig |
mask;
389 if (pu_pd_orig & mask)
392 pu_pd = pu_pd_orig & ~mask;
395 spin_unlock_irqrestore(&mux_spin_lock, flags);
406 if (pull_orig & mask)
409 pull = pull_orig & ~mask;
411 if (!(pull_orig & mask))
418 spin_unlock_irqrestore(&mux_spin_lock, flags);
422 #ifdef CONFIG_OMAP_MUX_WARNINGS
427 #ifdef CONFIG_OMAP_MUX_DEBUG
428 if (cfg->
debug || warn) {
429 printk(
"MUX: Setting register %s\n", cfg->
name);
430 printk(
" %s (0x%08x) = 0x%08x -> 0x%08x\n",
431 cfg->mux_reg_name, cfg->
mux_reg, reg_orig,
reg);
435 printk(
" %s (0x%08x) = 0x%08x -> 0x%08x\n",
442 printk(
" %s (0x%08x) = 0x%08x -> 0x%08x\n",
447 #ifdef CONFIG_OMAP_MUX_WARNINGS
458 if (!arch_mux_cfg || !arch_mux_cfg->
pins || arch_mux_cfg->
size == 0
464 mux_cfg = arch_mux_cfg;
483 if (mux_cfg ==
NULL) {
488 if (index >= mux_cfg->
size) {
490 index, mux_cfg->
size);
504 int __init omap1_mux_init(
void)
507 arch_mux_cfg.
pins = omap7xx_pins;
508 arch_mux_cfg.
size = OMAP7XX_PINS_SZ;
509 arch_mux_cfg.
cfg_reg = omap1_cfg_reg;
513 arch_mux_cfg.
pins = omap1xxx_pins;
514 arch_mux_cfg.
size = OMAP1XXX_PINS_SZ;
515 arch_mux_cfg.
cfg_reg = omap1_cfg_reg;
518 return omap_mux_register(&arch_mux_cfg);
522 #define omap_mux_init() do {} while(0)
523 #define omap_cfg_reg(x) do {} while(0)