aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/iomux-v3.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-06 19:50:35 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-06 19:50:35 -0500
commit3c0cb7c31c206aaedb967e44b98442bbeb17a6c4 (patch)
tree3ecba45d7ffae4fba4a5aafaef4af5b0b1105bde /arch/arm/plat-mxc/iomux-v3.c
parentf70f5b9dc74ca7d0a64c4ead3fb28da09dc1b234 (diff)
parent404a02cbd2ae8bf256a2fa1169bdfe86bb5ebb34 (diff)
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (416 commits) ARM: DMA: add support for DMA debugging ARM: PL011: add DMA burst threshold support for ST variants ARM: PL011: Add support for transmit DMA ARM: PL011: Ensure IRQs are disabled in UART interrupt handler ARM: PL011: Separate hardware FIFO size from TTY FIFO size ARM: PL011: Allow better handling of vendor data ARM: PL011: Ensure error flags are clear at startup ARM: PL011: include revision number in boot-time port printk ARM: vexpress: add sched_clock() for Versatile Express ARM i.MX53: Make MX53 EVK bootable ARM i.MX53: Some bug fix about MX53 MSL code ARM: 6607/1: sa1100: Update platform device registration ARM: 6606/1: sa1100: Fix platform device registration ARM i.MX51: rename IPU irqs ARM i.MX51: Add ipu clock support ARM: imx/mx27_3ds: Add PMIC support ARM: DMA: Replace page_to_dma()/dma_to_page() with pfn_to_dma()/dma_to_pfn() mx51: fix usb clock support MX51: Add support for usb host 2 arch/arm/plat-mxc/ehci.c: fix errors/typos ...
Diffstat (limited to 'arch/arm/plat-mxc/iomux-v3.c')
-rw-r--r--arch/arm/plat-mxc/iomux-v3.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/arch/arm/plat-mxc/iomux-v3.c b/arch/arm/plat-mxc/iomux-v3.c
index b318c6a222d5..99a9cdb9d6be 100644
--- a/arch/arm/plat-mxc/iomux-v3.c
+++ b/arch/arm/plat-mxc/iomux-v3.c
@@ -32,31 +32,38 @@
32static void __iomem *base; 32static void __iomem *base;
33 33
34/* 34/*
35 * setups a single pad in the iomuxer 35 * configures a single pad in the iomuxer
36 */ 36 */
37int mxc_iomux_v3_setup_pad(struct pad_desc *pad) 37int mxc_iomux_v3_setup_pad(iomux_v3_cfg_t pad)
38{ 38{
39 if (pad->mux_ctrl_ofs) 39 u32 mux_ctrl_ofs = (pad & MUX_CTRL_OFS_MASK) >> MUX_CTRL_OFS_SHIFT;
40 __raw_writel(pad->mux_mode, base + pad->mux_ctrl_ofs); 40 u32 mux_mode = (pad & MUX_MODE_MASK) >> MUX_MODE_SHIFT;
41 u32 sel_input_ofs = (pad & MUX_SEL_INPUT_OFS_MASK) >> MUX_SEL_INPUT_OFS_SHIFT;
42 u32 sel_input = (pad & MUX_SEL_INPUT_MASK) >> MUX_SEL_INPUT_SHIFT;
43 u32 pad_ctrl_ofs = (pad & MUX_PAD_CTRL_OFS_MASK) >> MUX_PAD_CTRL_OFS_SHIFT;
44 u32 pad_ctrl = (pad & MUX_PAD_CTRL_MASK) >> MUX_PAD_CTRL_SHIFT;
41 45
42 if (pad->select_input_ofs) 46 if (mux_ctrl_ofs)
43 __raw_writel(pad->select_input, 47 __raw_writel(mux_mode, base + mux_ctrl_ofs);
44 base + pad->select_input_ofs); 48
49 if (sel_input_ofs)
50 __raw_writel(sel_input, base + sel_input_ofs);
51
52 if (!(pad_ctrl & NO_PAD_CTRL) && pad_ctrl_ofs)
53 __raw_writel(pad_ctrl, base + pad_ctrl_ofs);
45 54
46 if (!(pad->pad_ctrl & NO_PAD_CTRL) && pad->pad_ctrl_ofs)
47 __raw_writel(pad->pad_ctrl, base + pad->pad_ctrl_ofs);
48 return 0; 55 return 0;
49} 56}
50EXPORT_SYMBOL(mxc_iomux_v3_setup_pad); 57EXPORT_SYMBOL(mxc_iomux_v3_setup_pad);
51 58
52int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count) 59int mxc_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t *pad_list, unsigned count)
53{ 60{
54 struct pad_desc *p = pad_list; 61 iomux_v3_cfg_t *p = pad_list;
55 int i; 62 int i;
56 int ret; 63 int ret;
57 64
58 for (i = 0; i < count; i++) { 65 for (i = 0; i < count; i++) {
59 ret = mxc_iomux_v3_setup_pad(p); 66 ret = mxc_iomux_v3_setup_pad(*p);
60 if (ret) 67 if (ret)
61 return ret; 68 return ret;
62 p++; 69 p++;