2 * DaVinci pin multiplexing configurations
4 * Author: Vladimir Barinov, MontaVista Software, Inc. <source@mvista.com>
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
12 #include <linux/spinlock.h>
14 #include <mach/hardware.h>
18 /* System control register offsets */
22 static DEFINE_SPINLOCK(mux_lock);
24 void davinci_mux_peripheral(unsigned int mux, unsigned int enable)
26 void __iomem *base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE);
27 u32 pinmux, muxreg = PINMUX0;
29 if (mux >= DAVINCI_MUX_LEVEL2) {
31 mux -= DAVINCI_MUX_LEVEL2;
35 pinmux = __raw_readl(base + muxreg);
39 pinmux &= ~(1 << mux);
40 __raw_writel(pinmux, base + muxreg);
41 spin_unlock(&mux_lock);