diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-10-01 03:49:11 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2010-10-22 22:50:25 -0400 |
commit | a40af06655f97d88fc1b0fcc9b5f2a5c06a27a4a (patch) | |
tree | d6eb02bef531690e0ca1262c5cfe7c934189738c /arch/arm/mach-s5pc100 | |
parent | f90715f9f07abcfff3b994a0f5b7edf7a78a5aec (diff) |
ARM: S5PC100: Change to using s3c_gpio_cfgall_range()
Change the code setting a range of GPIO pins' configuration and
pull state to use the recently introduced s3c_gpio_cfgall_range().
Mop up a few missed s3c_gpio_cfgpin_range() changes.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5pc100')
-rw-r--r-- | arch/arm/mach-s5pc100/setup-fb-24bpp.c | 30 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/setup-sdhci-gpio.c | 36 |
2 files changed, 18 insertions, 48 deletions
diff --git a/arch/arm/mach-s5pc100/setup-fb-24bpp.c b/arch/arm/mach-s5pc100/setup-fb-24bpp.c index 6eba6cb8e2f4..5a882d46c3f5 100644 --- a/arch/arm/mach-s5pc100/setup-fb-24bpp.c +++ b/arch/arm/mach-s5pc100/setup-fb-24bpp.c | |||
@@ -22,27 +22,15 @@ | |||
22 | 22 | ||
23 | #define DISR_OFFSET 0x7008 | 23 | #define DISR_OFFSET 0x7008 |
24 | 24 | ||
25 | void s5pc100_fb_gpio_setup_24bpp(void) | 25 | static void s5pc100_fb_setgpios(unsigned int base, unsigned int nr) |
26 | { | 26 | { |
27 | unsigned int gpio = 0; | 27 | s3c_gpio_cfgall_range(base, nr, S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); |
28 | 28 | } | |
29 | for (gpio = S5PC100_GPF0(0); gpio <= S5PC100_GPF0(7); gpio++) { | ||
30 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
31 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
32 | } | ||
33 | |||
34 | for (gpio = S5PC100_GPF1(0); gpio <= S5PC100_GPF1(7); gpio++) { | ||
35 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
36 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
37 | } | ||
38 | |||
39 | for (gpio = S5PC100_GPF2(0); gpio <= S5PC100_GPF2(7); gpio++) { | ||
40 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
41 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
42 | } | ||
43 | 29 | ||
44 | for (gpio = S5PC100_GPF3(0); gpio <= S5PC100_GPF3(3); gpio++) { | 30 | void s5pc100_fb_gpio_setup_24bpp(void) |
45 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 31 | { |
46 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 32 | s5pc100_fb_setgpios(S5PC100_GPF0(0), 8); |
47 | } | 33 | s5pc100_fb_setgpios(S5PC100_GPF1(0), 8); |
34 | s5pc100_fb_setgpios(S5PC100_GPF2(0), 8); | ||
35 | s5pc100_fb_setgpios(S5PC100_GPF3(0), 4); | ||
48 | } | 36 | } |
diff --git a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c index 79b031f5f434..a8d22a7b1581 100644 --- a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c +++ b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c | |||
@@ -25,8 +25,6 @@ | |||
25 | void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | 25 | void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) |
26 | { | 26 | { |
27 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; | 27 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; |
28 | unsigned int gpio; | ||
29 | unsigned int end; | ||
30 | unsigned int num; | 28 | unsigned int num; |
31 | 29 | ||
32 | num = width; | 30 | num = width; |
@@ -34,19 +32,13 @@ void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | |||
34 | if (width == 8) | 32 | if (width == 8) |
35 | num = width - 2; | 33 | num = width - 2; |
36 | 34 | ||
37 | end = S5PC100_GPG0(2 + num); | ||
38 | |||
39 | /* Set all the necessary GPG0/GPG1 pins to special-function 0 */ | 35 | /* Set all the necessary GPG0/GPG1 pins to special-function 0 */ |
40 | s3c_gpio_cfgpin_range(S5PC100_GPG0(0), 2 + num, S3C_GPIO_SFN(2)); | 36 | s3c_gpio_cfgall_range(S5PC100_GPG0(0), 2 + num, |
41 | for (gpio = S5PC100_GPG0(0); gpio < end; gpio++) | 37 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); |
42 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
43 | 38 | ||
44 | if (width == 8) { | 39 | if (width == 8) |
45 | for (gpio = S5PC100_GPG1(0); gpio <= S5PC100_GPG1(1); gpio++) { | 40 | s3c_gpio_cfgall_range(S5PC100_GPG1(0), 2, |
46 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 41 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); |
47 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
48 | } | ||
49 | } | ||
50 | 42 | ||
51 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { | 43 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { |
52 | s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP); | 44 | s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP); |
@@ -57,15 +49,10 @@ void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | |||
57 | void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) | 49 | void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) |
58 | { | 50 | { |
59 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; | 51 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; |
60 | unsigned int gpio; | ||
61 | unsigned int end; | ||
62 | |||
63 | end = S5PC100_GPG2(2 + width); | ||
64 | 52 | ||
65 | /* Set all the necessary GPG2 pins to special-function 2 */ | 53 | /* Set all the necessary GPG2 pins to special-function 2 */ |
66 | s3c_gpio_cfgpin_range(S5PC100_GPG2(0), 2 + width, S3C_GPIO_SFN(2)); | 54 | s3c_gpio_cfgall_range(S5PC100_GPG2(0), 2 + width, |
67 | for (gpio = S5PC100_GPG2(0); gpio < end; gpio++) | 55 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); |
68 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
69 | 56 | ||
70 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { | 57 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { |
71 | s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP); | 58 | s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP); |
@@ -76,15 +63,10 @@ void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) | |||
76 | void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) | 63 | void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) |
77 | { | 64 | { |
78 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; | 65 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; |
79 | unsigned int gpio; | ||
80 | unsigned int end; | ||
81 | |||
82 | end = S5PC100_GPG3(2 + width); | ||
83 | 66 | ||
84 | /* Set all the necessary GPG3 pins to special-function 2 */ | 67 | /* Set all the necessary GPG3 pins to special-function 2 */ |
85 | s3c_gpio_cfgpin_range(S5PC100_GPG3(0), 2 + width, S3C_GPIO_SFN(2)); | 68 | s3c_gpio_cfgall_range(S5PC100_GPG3(0), 2 + width, |
86 | for (gpio = S5PC100_GPG3(0); gpio < end; gpio++) | 69 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); |
87 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
88 | 70 | ||
89 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { | 71 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { |
90 | s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP); | 72 | s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP); |