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 | |
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')
-rw-r--r-- | arch/arm/plat-mxc/include/mach/iomux-v3.h | 17 | ||||
-rw-r--r-- | arch/arm/plat-mxc/iomux-v3.c | 36 |
2 files changed, 3 insertions, 50 deletions
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/plat-mxc/include/mach/iomux-v3.h index a0fa40265468..1deda0184892 100644 --- a/arch/arm/plat-mxc/include/mach/iomux-v3.h +++ b/arch/arm/plat-mxc/include/mach/iomux-v3.h | |||
@@ -88,9 +88,7 @@ struct pad_desc { | |||
88 | #define PAD_CTL_SRE_FAST (1 << 0) | 88 | #define PAD_CTL_SRE_FAST (1 << 0) |
89 | 89 | ||
90 | /* | 90 | /* |
91 | * setups a single pad: | 91 | * setups a single pad in the iomuxer |
92 | * - reserves the pad so that it is not claimed by another driver | ||
93 | * - setups the iomux according to the configuration | ||
94 | */ | 92 | */ |
95 | int mxc_iomux_v3_setup_pad(struct pad_desc *pad); | 93 | int mxc_iomux_v3_setup_pad(struct pad_desc *pad); |
96 | 94 | ||
@@ -101,19 +99,6 @@ int mxc_iomux_v3_setup_pad(struct pad_desc *pad); | |||
101 | int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count); | 99 | int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count); |
102 | 100 | ||
103 | /* | 101 | /* |
104 | * releases a single pad: | ||
105 | * - make it available for a future use by another driver | ||
106 | * - DOES NOT reconfigure the IOMUX in its reset state | ||
107 | */ | ||
108 | void mxc_iomux_v3_release_pad(struct pad_desc *pad); | ||
109 | |||
110 | /* | ||
111 | * releases multiple pads | ||
112 | * convenvient way to call the above function with tables | ||
113 | */ | ||
114 | void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count); | ||
115 | |||
116 | /* | ||
117 | * Initialise the iomux controller | 102 | * Initialise the iomux controller |
118 | */ | 103 | */ |
119 | void mxc_iomux_v3_init(void __iomem *iomux_v3_base); | 104 | void mxc_iomux_v3_init(void __iomem *iomux_v3_base); |
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; |