diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-08 11:12:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-08 11:12:43 -0500 |
commit | 79c9601c2e0dbbe69895d302de4d19f3a31fbd30 (patch) | |
tree | 78d4be2df851b2b4106adcfd736622a90cecf9e9 /arch/arm/plat-mxc/iomux-v3.c | |
parent | 41440ffe21f29bdb985cab76b2d0b06d83e63b19 (diff) | |
parent | 3d14b5beba35250c548d3851a2b84fce742d8311 (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: (272 commits)
Fix soc_common PCMCIA configuration
ARM: 5827/1: SA1100: h3100/h3600: emit messages on failed gpio_request
ARM: 5826/1: SA1100: h3100/h3600: always build htc-egpio driver
ARM: 5825/1: SA1100: h3600: update defconfig
ARM: 5824/1: SA1100: reuse h3600 PCMCIA driver on h3100
ARM: 5823/1: SA1100: h3100/h3600: add support for gpio-keys
ARM: 5822/1: SA1100: h3100/h3600: clean up #includes
ARM: 5821/1: SA1100: h3100/h3600: revise copyright boilerplates
ARM: 5820/1: SA1100: h3100/h3600: split h3600.c
ARM: 5819/1: SA1100: h3100/h3600: merge h3600.h and h3600_gpio.h into h3xxx.h
ARM: 5818/1: SA1100: h3100/h3600: drop old GPIO definitions
ARM: 5817/1: SA1100: h3100/h3600: configure all unused gpios as inputs
ARM: 5816/1: SA1100: h3600: remove IRQ_GPIO_* definitions
ARM: 5815/1: SA1100: h3100/h3600: remove now unused assign_h3600_egpio handlers
ARM: 5814/1: SA1100: h3100/h3600: convert all users of assign_h3600_egpio to gpiolib
ARM: 5813/1: SA1100: h3100/h3600: add htc-egpio driver
ARM: 5812/1: SA1100: h3100/h3600: separate machine-specific LCD helpers
ARM: 5811/2: pcmcia: convert sa1100_h3600 driver to gpiolib
ARM: 5799/1: SA1100: h3600: stop setting direction for LCD pins
ARM: 5798/1: SA1100: h3600: remove unused cruft from h3600.h
...
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; |