diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-06-04 05:16:22 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-08-14 06:40:41 -0400 |
commit | 6134b2cbb0e24f897fd1063745638397809fca29 (patch) | |
tree | 2e985b582459fd56cb260e02ea8399d175923e9c /arch/arm/plat-mxc | |
parent | fc2a9f0bc7f6dd4966dc57fb98b8697c83b6d035 (diff) |
iomux-v3: Allow for a runtime base address
also, check for a valid pad_ctrl_ofs before changing the
pad control register.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r-- | arch/arm/plat-mxc/include/mach/iomux-v3.h | 5 | ||||
-rw-r--r-- | arch/arm/plat-mxc/iomux-v3.c | 15 |
2 files changed, 15 insertions, 5 deletions
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/plat-mxc/include/mach/iomux-v3.h index cd06df9370cb..a0fa40265468 100644 --- a/arch/arm/plat-mxc/include/mach/iomux-v3.h +++ b/arch/arm/plat-mxc/include/mach/iomux-v3.h | |||
@@ -113,5 +113,10 @@ void mxc_iomux_v3_release_pad(struct pad_desc *pad); | |||
113 | */ | 113 | */ |
114 | void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count); | 114 | void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count); |
115 | 115 | ||
116 | /* | ||
117 | * Initialise the iomux controller | ||
118 | */ | ||
119 | void mxc_iomux_v3_init(void __iomem *iomux_v3_base); | ||
120 | |||
116 | #endif /* __MACH_IOMUX_V3_H__*/ | 121 | #endif /* __MACH_IOMUX_V3_H__*/ |
117 | 122 | ||
diff --git a/arch/arm/plat-mxc/iomux-v3.c b/arch/arm/plat-mxc/iomux-v3.c index 77a078f9513f..851ca99bf1b1 100644 --- a/arch/arm/plat-mxc/iomux-v3.c +++ b/arch/arm/plat-mxc/iomux-v3.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <asm/mach/map.h> | 29 | #include <asm/mach/map.h> |
30 | #include <mach/iomux-v3.h> | 30 | #include <mach/iomux-v3.h> |
31 | 31 | ||
32 | #define IOMUX_BASE IO_ADDRESS(IOMUXC_BASE_ADDR) | 32 | static void __iomem *base; |
33 | 33 | ||
34 | static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG]; | 34 | static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG]; |
35 | 35 | ||
@@ -45,14 +45,14 @@ int mxc_iomux_v3_setup_pad(struct pad_desc *pad) | |||
45 | if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map)) | 45 | if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map)) |
46 | return -EBUSY; | 46 | return -EBUSY; |
47 | if (pad->mux_ctrl_ofs) | 47 | if (pad->mux_ctrl_ofs) |
48 | __raw_writel(pad->mux_mode, IOMUX_BASE + pad->mux_ctrl_ofs); | 48 | __raw_writel(pad->mux_mode, base + pad->mux_ctrl_ofs); |
49 | 49 | ||
50 | if (pad->select_input_ofs) | 50 | if (pad->select_input_ofs) |
51 | __raw_writel(pad->select_input, | 51 | __raw_writel(pad->select_input, |
52 | IOMUX_BASE + pad->select_input_ofs); | 52 | base + pad->select_input_ofs); |
53 | 53 | ||
54 | if (!(pad->pad_ctrl & NO_PAD_CTRL)) | 54 | if (!(pad->pad_ctrl & NO_PAD_CTRL) && pad->pad_ctrl_ofs) |
55 | __raw_writel(pad->pad_ctrl, IOMUX_BASE + pad->pad_ctrl_ofs); | 55 | __raw_writel(pad->pad_ctrl, base + pad->pad_ctrl_ofs); |
56 | return 0; | 56 | return 0; |
57 | } | 57 | } |
58 | EXPORT_SYMBOL(mxc_iomux_v3_setup_pad); | 58 | EXPORT_SYMBOL(mxc_iomux_v3_setup_pad); |
@@ -96,3 +96,8 @@ void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count) | |||
96 | } | 96 | } |
97 | } | 97 | } |
98 | EXPORT_SYMBOL(mxc_iomux_v3_release_multiple_pads); | 98 | EXPORT_SYMBOL(mxc_iomux_v3_release_multiple_pads); |
99 | |||
100 | void mxc_iomux_v3_init(void __iomem *iomux_v3_base) | ||
101 | { | ||
102 | base = iomux_v3_base; | ||
103 | } | ||