diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-10-01 01:27:31 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2010-10-22 22:49:44 -0400 |
commit | 64c5bd841b5789e118f358b684090585f14be6cf (patch) | |
tree | 0bebfd56dc34063884f389a64c88ac6dcd63ffd6 /arch | |
parent | ce8f9abd62e3c9fb21d6cea96a07f42ed5e008ce (diff) |
ARM: S5PV210: Change to using s3c_gpio_cfgpin_range()
Change the code setting ranges of GPIO pins using s3c_gpio_cfgpin() to
use the recently introduced s3c_gpio_cfgpin_range().
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
[kgene.kim@samsung.com: coding-style fixes]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-s5pv210/dev-audio.c | 46 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/setup-sdhci-gpio.c | 53 |
2 files changed, 29 insertions, 70 deletions
diff --git a/arch/arm/mach-s5pv210/dev-audio.c b/arch/arm/mach-s5pv210/dev-audio.c index 21dc6cf955c3..b274b6be7bd5 100644 --- a/arch/arm/mach-s5pv210/dev-audio.c +++ b/arch/arm/mach-s5pv210/dev-audio.c | |||
@@ -24,29 +24,15 @@ static int s5pv210_cfg_i2s(struct platform_device *pdev) | |||
24 | /* configure GPIO for i2s port */ | 24 | /* configure GPIO for i2s port */ |
25 | switch (pdev->id) { | 25 | switch (pdev->id) { |
26 | case 1: | 26 | case 1: |
27 | s3c_gpio_cfgpin(S5PV210_GPC0(0), S3C_GPIO_SFN(2)); | 27 | s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(2)); |
28 | s3c_gpio_cfgpin(S5PV210_GPC0(1), S3C_GPIO_SFN(2)); | ||
29 | s3c_gpio_cfgpin(S5PV210_GPC0(2), S3C_GPIO_SFN(2)); | ||
30 | s3c_gpio_cfgpin(S5PV210_GPC0(3), S3C_GPIO_SFN(2)); | ||
31 | s3c_gpio_cfgpin(S5PV210_GPC0(4), S3C_GPIO_SFN(2)); | ||
32 | break; | 28 | break; |
33 | 29 | ||
34 | case 2: | 30 | case 2: |
35 | s3c_gpio_cfgpin(S5PV210_GPC1(0), S3C_GPIO_SFN(4)); | 31 | s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 5, S3C_GPIO_SFN(4)); |
36 | s3c_gpio_cfgpin(S5PV210_GPC1(1), S3C_GPIO_SFN(4)); | ||
37 | s3c_gpio_cfgpin(S5PV210_GPC1(2), S3C_GPIO_SFN(4)); | ||
38 | s3c_gpio_cfgpin(S5PV210_GPC1(3), S3C_GPIO_SFN(4)); | ||
39 | s3c_gpio_cfgpin(S5PV210_GPC1(4), S3C_GPIO_SFN(4)); | ||
40 | break; | 32 | break; |
41 | 33 | ||
42 | case -1: | 34 | case -1: |
43 | s3c_gpio_cfgpin(S5PV210_GPI(0), S3C_GPIO_SFN(2)); | 35 | s3c_gpio_cfgpin_range(S5PV210_GPI(0), 7, S3C_GPIO_SFN(2)); |
44 | s3c_gpio_cfgpin(S5PV210_GPI(1), S3C_GPIO_SFN(2)); | ||
45 | s3c_gpio_cfgpin(S5PV210_GPI(2), S3C_GPIO_SFN(2)); | ||
46 | s3c_gpio_cfgpin(S5PV210_GPI(3), S3C_GPIO_SFN(2)); | ||
47 | s3c_gpio_cfgpin(S5PV210_GPI(4), S3C_GPIO_SFN(2)); | ||
48 | s3c_gpio_cfgpin(S5PV210_GPI(5), S3C_GPIO_SFN(2)); | ||
49 | s3c_gpio_cfgpin(S5PV210_GPI(6), S3C_GPIO_SFN(2)); | ||
50 | break; | 36 | break; |
51 | 37 | ||
52 | default: | 38 | default: |
@@ -151,25 +137,13 @@ static int s5pv210_pcm_cfg_gpio(struct platform_device *pdev) | |||
151 | { | 137 | { |
152 | switch (pdev->id) { | 138 | switch (pdev->id) { |
153 | case 0: | 139 | case 0: |
154 | s3c_gpio_cfgpin(S5PV210_GPI(0), S3C_GPIO_SFN(3)); | 140 | s3c_gpio_cfgpin_range(S5PV210_GPI(0), 5, S3C_GPIO_SFN(3)); |
155 | s3c_gpio_cfgpin(S5PV210_GPI(1), S3C_GPIO_SFN(3)); | ||
156 | s3c_gpio_cfgpin(S5PV210_GPI(2), S3C_GPIO_SFN(3)); | ||
157 | s3c_gpio_cfgpin(S5PV210_GPI(3), S3C_GPIO_SFN(3)); | ||
158 | s3c_gpio_cfgpin(S5PV210_GPI(4), S3C_GPIO_SFN(3)); | ||
159 | break; | 141 | break; |
160 | case 1: | 142 | case 1: |
161 | s3c_gpio_cfgpin(S5PV210_GPC0(0), S3C_GPIO_SFN(3)); | 143 | s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(3)); |
162 | s3c_gpio_cfgpin(S5PV210_GPC0(1), S3C_GPIO_SFN(3)); | ||
163 | s3c_gpio_cfgpin(S5PV210_GPC0(2), S3C_GPIO_SFN(3)); | ||
164 | s3c_gpio_cfgpin(S5PV210_GPC0(3), S3C_GPIO_SFN(3)); | ||
165 | s3c_gpio_cfgpin(S5PV210_GPC0(4), S3C_GPIO_SFN(3)); | ||
166 | break; | 144 | break; |
167 | case 2: | 145 | case 2: |
168 | s3c_gpio_cfgpin(S5PV210_GPC1(0), S3C_GPIO_SFN(2)); | 146 | s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 5, S3C_GPIO_SFN(2)); |
169 | s3c_gpio_cfgpin(S5PV210_GPC1(1), S3C_GPIO_SFN(2)); | ||
170 | s3c_gpio_cfgpin(S5PV210_GPC1(2), S3C_GPIO_SFN(2)); | ||
171 | s3c_gpio_cfgpin(S5PV210_GPC1(3), S3C_GPIO_SFN(2)); | ||
172 | s3c_gpio_cfgpin(S5PV210_GPC1(4), S3C_GPIO_SFN(2)); | ||
173 | break; | 147 | break; |
174 | default: | 148 | default: |
175 | printk(KERN_DEBUG "Invalid PCM Controller number!"); | 149 | printk(KERN_DEBUG "Invalid PCM Controller number!"); |
@@ -271,13 +245,7 @@ struct platform_device s5pv210_device_pcm2 = { | |||
271 | 245 | ||
272 | static int s5pv210_ac97_cfg_gpio(struct platform_device *pdev) | 246 | static int s5pv210_ac97_cfg_gpio(struct platform_device *pdev) |
273 | { | 247 | { |
274 | s3c_gpio_cfgpin(S5PV210_GPC0(0), S3C_GPIO_SFN(4)); | 248 | return s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(4)); |
275 | s3c_gpio_cfgpin(S5PV210_GPC0(1), S3C_GPIO_SFN(4)); | ||
276 | s3c_gpio_cfgpin(S5PV210_GPC0(2), S3C_GPIO_SFN(4)); | ||
277 | s3c_gpio_cfgpin(S5PV210_GPC0(3), S3C_GPIO_SFN(4)); | ||
278 | s3c_gpio_cfgpin(S5PV210_GPC0(4), S3C_GPIO_SFN(4)); | ||
279 | |||
280 | return 0; | ||
281 | } | 249 | } |
282 | 250 | ||
283 | static struct resource s5pv210_ac97_resource[] = { | 251 | static struct resource s5pv210_ac97_resource[] = { |
diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c index b18587b1ec58..706427837d82 100644 --- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c +++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c | |||
@@ -29,23 +29,21 @@ void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | |||
29 | unsigned int gpio; | 29 | unsigned int gpio; |
30 | 30 | ||
31 | /* Set all the necessary GPG0/GPG1 pins to special-function 2 */ | 31 | /* Set all the necessary GPG0/GPG1 pins to special-function 2 */ |
32 | for (gpio = S5PV210_GPG0(0); gpio < S5PV210_GPG0(2); gpio++) { | 32 | s3c_gpio_cfgpin_range(S5PV210_GPG0(0), 2, S3C_GPIO_SFN(2)); |
33 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 33 | for (gpio = S5PV210_GPG0(0); gpio < S5PV210_GPG0(2); gpio++) |
34 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 34 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
35 | } | 35 | |
36 | switch (width) { | 36 | switch (width) { |
37 | case 8: | 37 | case 8: |
38 | /* GPG1[3:6] special-funtion 3 */ | 38 | /* GPG1[3:6] special-funtion 3 */ |
39 | for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) { | 39 | s3c_gpio_cfgpin_range(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(3)); |
40 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); | 40 | for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) |
41 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 41 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
42 | } | ||
43 | case 4: | 42 | case 4: |
44 | /* GPG0[3:6] special-funtion 2 */ | 43 | /* GPG0[3:6] special-funtion 2 */ |
45 | for (gpio = S5PV210_GPG0(3); gpio <= S5PV210_GPG0(6); gpio++) { | 44 | s3c_gpio_cfgpin_range(S5PV210_GPG0(3), 4, S3C_GPIO_SFN(2)); |
46 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 45 | for (gpio = S5PV210_GPG0(3); gpio <= S5PV210_GPG0(6); gpio++) |
47 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 46 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
48 | } | ||
49 | default: | 47 | default: |
50 | break; | 48 | break; |
51 | } | 49 | } |
@@ -62,16 +60,14 @@ void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) | |||
62 | unsigned int gpio; | 60 | unsigned int gpio; |
63 | 61 | ||
64 | /* Set all the necessary GPG1[0:1] pins to special-function 2 */ | 62 | /* Set all the necessary GPG1[0:1] pins to special-function 2 */ |
65 | for (gpio = S5PV210_GPG1(0); gpio < S5PV210_GPG1(2); gpio++) { | 63 | s3c_gpio_cfgpin_range(S5PV210_GPG1(0), 2, S3C_GPIO_SFN(2)); |
66 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 64 | for (gpio = S5PV210_GPG1(0); gpio < S5PV210_GPG1(2); gpio++) |
67 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 65 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
68 | } | ||
69 | 66 | ||
70 | /* Data pin GPG1[3:6] to special-function 2 */ | 67 | /* Data pin GPG1[3:6] to special-function 2 */ |
71 | for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) { | 68 | s3c_gpio_cfgpin_range(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(2)); |
72 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 69 | for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) |
73 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 70 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
74 | } | ||
75 | 71 | ||
76 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { | 72 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { |
77 | s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP); | 73 | s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP); |
@@ -85,24 +81,21 @@ void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) | |||
85 | unsigned int gpio; | 81 | unsigned int gpio; |
86 | 82 | ||
87 | /* Set all the necessary GPG2[0:1] pins to special-function 2 */ | 83 | /* Set all the necessary GPG2[0:1] pins to special-function 2 */ |
88 | for (gpio = S5PV210_GPG2(0); gpio < S5PV210_GPG2(2); gpio++) { | 84 | s3c_gpio_cfgpin_range(S5PV210_GPG2(0), 2, S3C_GPIO_SFN(2)); |
89 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 85 | for (gpio = S5PV210_GPG2(0); gpio < S5PV210_GPG2(2); gpio++) |
90 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 86 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
91 | } | ||
92 | 87 | ||
93 | switch (width) { | 88 | switch (width) { |
94 | case 8: | 89 | case 8: |
95 | /* Data pin GPG3[3:6] to special-function 3 */ | 90 | /* Data pin GPG3[3:6] to special-function 3 */ |
96 | for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) { | 91 | s3c_gpio_cfgpin_range(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(3)); |
97 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); | 92 | for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) |
98 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 93 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
99 | } | ||
100 | case 4: | 94 | case 4: |
101 | /* Data pin GPG2[3:6] to special-function 2 */ | 95 | /* Data pin GPG2[3:6] to special-function 2 */ |
102 | for (gpio = S5PV210_GPG2(3); gpio <= S5PV210_GPG2(6); gpio++) { | 96 | s3c_gpio_cfgpin_range(S5PV210_GPG2(3), 4, S3C_GPIO_SFN(2)); |
103 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 97 | for (gpio = S5PV210_GPG2(3); gpio <= S5PV210_GPG2(6); gpio++) |
104 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 98 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
105 | } | ||
106 | default: | 99 | default: |
107 | break; | 100 | break; |
108 | } | 101 | } |
@@ -118,17 +111,15 @@ void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width) | |||
118 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; | 111 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; |
119 | unsigned int gpio; | 112 | unsigned int gpio; |
120 | 113 | ||
121 | /* Set all the necessary GPG3[0:2] pins to special-function 2 */ | 114 | /* Set all the necessary GPG3[0:1] pins to special-function 2 */ |
122 | for (gpio = S5PV210_GPG3(0); gpio < S5PV210_GPG3(2); gpio++) { | 115 | s3c_gpio_cfgpin_range(S5PV210_GPG3(0), 2, S3C_GPIO_SFN(2)); |
123 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 116 | for (gpio = S5PV210_GPG3(0); gpio < S5PV210_GPG3(2); gpio++) |
124 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 117 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
125 | } | ||
126 | 118 | ||
127 | /* Data pin GPG3[3:6] to special-function 2 */ | 119 | /* Data pin GPG3[3:6] to special-function 2 */ |
128 | for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) { | 120 | s3c_gpio_cfgpin_range(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(2)); |
129 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 121 | for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) |
130 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 122 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
131 | } | ||
132 | 123 | ||
133 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { | 124 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { |
134 | s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP); | 125 | s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP); |