diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-10-29 12:18:02 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-11-24 02:39:43 -0500 |
commit | 654166d6879ed1e4df9815d04e6a358adf1259a6 (patch) | |
tree | f019aa8e259b0b1b98d64dc255ac37dc311a776d /arch/arm/plat-mxc/iomux-v3.c | |
parent | c6e7c0e20d0ece2825389f5e24684490a440c427 (diff) |
mxc: iomux v3: remove resource handling
The current model does not allow to put a pad into different modes
once a pins is allocated. Remove the resource handling.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/iomux-v3.c')
-rw-r--r-- | arch/arm/plat-mxc/iomux-v3.c | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/arch/arm/plat-mxc/iomux-v3.c b/arch/arm/plat-mxc/iomux-v3.c index 851ca99bf1b1..b318c6a222d5 100644 --- a/arch/arm/plat-mxc/iomux-v3.c +++ b/arch/arm/plat-mxc/iomux-v3.c | |||
@@ -31,19 +31,11 @@ | |||
31 | 31 | ||
32 | static void __iomem *base; | 32 | static void __iomem *base; |
33 | 33 | ||
34 | static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG]; | ||
35 | |||
36 | /* | 34 | /* |
37 | * setups a single pin: | 35 | * setups a single pad in the iomuxer |
38 | * - reserves the pin so that it is not claimed by another driver | ||
39 | * - setups the iomux according to the configuration | ||
40 | */ | 36 | */ |
41 | int mxc_iomux_v3_setup_pad(struct pad_desc *pad) | 37 | int mxc_iomux_v3_setup_pad(struct pad_desc *pad) |
42 | { | 38 | { |
43 | unsigned int pad_ofs = pad->pad_ctrl_ofs; | ||
44 | |||
45 | if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map)) | ||
46 | return -EBUSY; | ||
47 | if (pad->mux_ctrl_ofs) | 39 | if (pad->mux_ctrl_ofs) |
48 | __raw_writel(pad->mux_mode, base + pad->mux_ctrl_ofs); | 40 | __raw_writel(pad->mux_mode, base + pad->mux_ctrl_ofs); |
49 | 41 | ||
@@ -66,37 +58,13 @@ int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count) | |||
66 | for (i = 0; i < count; i++) { | 58 | for (i = 0; i < count; i++) { |
67 | ret = mxc_iomux_v3_setup_pad(p); | 59 | ret = mxc_iomux_v3_setup_pad(p); |
68 | if (ret) | 60 | if (ret) |
69 | goto setup_error; | 61 | return ret; |
70 | p++; | 62 | p++; |
71 | } | 63 | } |
72 | return 0; | 64 | return 0; |
73 | |||
74 | setup_error: | ||
75 | mxc_iomux_v3_release_multiple_pads(pad_list, i); | ||
76 | return ret; | ||
77 | } | 65 | } |
78 | EXPORT_SYMBOL(mxc_iomux_v3_setup_multiple_pads); | 66 | EXPORT_SYMBOL(mxc_iomux_v3_setup_multiple_pads); |
79 | 67 | ||
80 | void mxc_iomux_v3_release_pad(struct pad_desc *pad) | ||
81 | { | ||
82 | unsigned int pad_ofs = pad->pad_ctrl_ofs; | ||
83 | |||
84 | clear_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map); | ||
85 | } | ||
86 | EXPORT_SYMBOL(mxc_iomux_v3_release_pad); | ||
87 | |||
88 | void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count) | ||
89 | { | ||
90 | struct pad_desc *p = pad_list; | ||
91 | int i; | ||
92 | |||
93 | for (i = 0; i < count; i++) { | ||
94 | mxc_iomux_v3_release_pad(p); | ||
95 | p++; | ||
96 | } | ||
97 | } | ||
98 | EXPORT_SYMBOL(mxc_iomux_v3_release_multiple_pads); | ||
99 | |||
100 | void mxc_iomux_v3_init(void __iomem *iomux_v3_base) | 68 | void mxc_iomux_v3_init(void __iomem *iomux_v3_base) |
101 | { | 69 | { |
102 | base = iomux_v3_base; | 70 | base = iomux_v3_base; |