diff options
author | Kukjin Kim <kgene.kim@samsung.com> | 2010-10-01 02:46:36 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2010-10-22 22:49:32 -0400 |
commit | d5e8123bbb34f61c80c79fc7c2c2bc5336aa1166 (patch) | |
tree | 0b5e495c037761405ab4d95c67f80bce5b7a5f5e /arch/arm/mach-s5p64x0 | |
parent | af94e5771a1f5eab3cb7c222c12ec116cb358f62 (diff) |
ARM: S5P64X0: 2nd Change to using s3c_gpio_cfgpin_range()
This patch changes the code setting ranges of GPIO pins in mach-s5p64x0 using
s3c_gpio_cfgpin() to use the recently introduced s3c_gpio_cfgpin_range().
NOTE: This is for missed things from the previous patch.
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5p64x0')
-rw-r--r-- | arch/arm/mach-s5p64x0/dev-spi.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-s5p64x0/setup-i2c0.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-s5p64x0/setup-i2c1.c | 6 |
3 files changed, 16 insertions, 20 deletions
diff --git a/arch/arm/mach-s5p64x0/dev-spi.c b/arch/arm/mach-s5p64x0/dev-spi.c index 5b69ec4c8af3..be64fee2050b 100644 --- a/arch/arm/mach-s5p64x0/dev-spi.c +++ b/arch/arm/mach-s5p64x0/dev-spi.c | |||
@@ -39,20 +39,18 @@ static char *s5p64x0_spi_src_clks[] = { | |||
39 | */ | 39 | */ |
40 | static int s5p6440_spi_cfg_gpio(struct platform_device *pdev) | 40 | static int s5p6440_spi_cfg_gpio(struct platform_device *pdev) |
41 | { | 41 | { |
42 | unsigned int base; | ||
43 | |||
42 | switch (pdev->id) { | 44 | switch (pdev->id) { |
43 | case 0: | 45 | case 0: |
44 | s3c_gpio_cfgpin(S5P6440_GPC(0), S3C_GPIO_SFN(2)); | 46 | base = S5P6440_GPC(0); |
45 | s3c_gpio_cfgpin(S5P6440_GPC(1), S3C_GPIO_SFN(2)); | ||
46 | s3c_gpio_cfgpin(S5P6440_GPC(2), S3C_GPIO_SFN(2)); | ||
47 | s3c_gpio_setpull(S5P6440_GPC(0), S3C_GPIO_PULL_UP); | 47 | s3c_gpio_setpull(S5P6440_GPC(0), S3C_GPIO_PULL_UP); |
48 | s3c_gpio_setpull(S5P6440_GPC(1), S3C_GPIO_PULL_UP); | 48 | s3c_gpio_setpull(S5P6440_GPC(1), S3C_GPIO_PULL_UP); |
49 | s3c_gpio_setpull(S5P6440_GPC(2), S3C_GPIO_PULL_UP); | 49 | s3c_gpio_setpull(S5P6440_GPC(2), S3C_GPIO_PULL_UP); |
50 | break; | 50 | break; |
51 | 51 | ||
52 | case 1: | 52 | case 1: |
53 | s3c_gpio_cfgpin(S5P6440_GPC(4), S3C_GPIO_SFN(2)); | 53 | base = S5P6440_GPC(4); |
54 | s3c_gpio_cfgpin(S5P6440_GPC(5), S3C_GPIO_SFN(2)); | ||
55 | s3c_gpio_cfgpin(S5P6440_GPC(6), S3C_GPIO_SFN(2)); | ||
56 | s3c_gpio_setpull(S5P6440_GPC(4), S3C_GPIO_PULL_UP); | 54 | s3c_gpio_setpull(S5P6440_GPC(4), S3C_GPIO_PULL_UP); |
57 | s3c_gpio_setpull(S5P6440_GPC(5), S3C_GPIO_PULL_UP); | 55 | s3c_gpio_setpull(S5P6440_GPC(5), S3C_GPIO_PULL_UP); |
58 | s3c_gpio_setpull(S5P6440_GPC(6), S3C_GPIO_PULL_UP); | 56 | s3c_gpio_setpull(S5P6440_GPC(6), S3C_GPIO_PULL_UP); |
@@ -63,25 +61,25 @@ static int s5p6440_spi_cfg_gpio(struct platform_device *pdev) | |||
63 | return -EINVAL; | 61 | return -EINVAL; |
64 | } | 62 | } |
65 | 63 | ||
64 | s3c_gpio_cfgpin_range(base, 3, S3C_GPIO_SFN(2)); | ||
65 | |||
66 | return 0; | 66 | return 0; |
67 | } | 67 | } |
68 | 68 | ||
69 | static int s5p6450_spi_cfg_gpio(struct platform_device *pdev) | 69 | static int s5p6450_spi_cfg_gpio(struct platform_device *pdev) |
70 | { | 70 | { |
71 | unsigned int base; | ||
72 | |||
71 | switch (pdev->id) { | 73 | switch (pdev->id) { |
72 | case 0: | 74 | case 0: |
73 | s3c_gpio_cfgpin(S5P6450_GPC(0), S3C_GPIO_SFN(2)); | 75 | base = S5P6450_GPC(0); |
74 | s3c_gpio_cfgpin(S5P6450_GPC(1), S3C_GPIO_SFN(2)); | ||
75 | s3c_gpio_cfgpin(S5P6450_GPC(2), S3C_GPIO_SFN(2)); | ||
76 | s3c_gpio_setpull(S5P6450_GPC(0), S3C_GPIO_PULL_UP); | 76 | s3c_gpio_setpull(S5P6450_GPC(0), S3C_GPIO_PULL_UP); |
77 | s3c_gpio_setpull(S5P6450_GPC(1), S3C_GPIO_PULL_UP); | 77 | s3c_gpio_setpull(S5P6450_GPC(1), S3C_GPIO_PULL_UP); |
78 | s3c_gpio_setpull(S5P6450_GPC(2), S3C_GPIO_PULL_UP); | 78 | s3c_gpio_setpull(S5P6450_GPC(2), S3C_GPIO_PULL_UP); |
79 | break; | 79 | break; |
80 | 80 | ||
81 | case 1: | 81 | case 1: |
82 | s3c_gpio_cfgpin(S5P6450_GPC(4), S3C_GPIO_SFN(2)); | 82 | base = S5P6450_GPC(4); |
83 | s3c_gpio_cfgpin(S5P6450_GPC(5), S3C_GPIO_SFN(2)); | ||
84 | s3c_gpio_cfgpin(S5P6450_GPC(6), S3C_GPIO_SFN(2)); | ||
85 | s3c_gpio_setpull(S5P6450_GPC(4), S3C_GPIO_PULL_UP); | 83 | s3c_gpio_setpull(S5P6450_GPC(4), S3C_GPIO_PULL_UP); |
86 | s3c_gpio_setpull(S5P6450_GPC(5), S3C_GPIO_PULL_UP); | 84 | s3c_gpio_setpull(S5P6450_GPC(5), S3C_GPIO_PULL_UP); |
87 | s3c_gpio_setpull(S5P6450_GPC(6), S3C_GPIO_PULL_UP); | 85 | s3c_gpio_setpull(S5P6450_GPC(6), S3C_GPIO_PULL_UP); |
@@ -92,6 +90,8 @@ static int s5p6450_spi_cfg_gpio(struct platform_device *pdev) | |||
92 | return -EINVAL; | 90 | return -EINVAL; |
93 | } | 91 | } |
94 | 92 | ||
93 | s3c_gpio_cfgpin_range(base, 3, S3C_GPIO_SFN(2)); | ||
94 | |||
95 | return 0; | 95 | return 0; |
96 | } | 96 | } |
97 | 97 | ||
diff --git a/arch/arm/mach-s5p64x0/setup-i2c0.c b/arch/arm/mach-s5p64x0/setup-i2c0.c index dc4cc65a5019..75ef9e51b20a 100644 --- a/arch/arm/mach-s5p64x0/setup-i2c0.c +++ b/arch/arm/mach-s5p64x0/setup-i2c0.c | |||
@@ -25,17 +25,15 @@ struct platform_device; /* don't need the contents */ | |||
25 | 25 | ||
26 | void s5p6440_i2c0_cfg_gpio(struct platform_device *dev) | 26 | void s5p6440_i2c0_cfg_gpio(struct platform_device *dev) |
27 | { | 27 | { |
28 | s3c_gpio_cfgpin(S5P6440_GPB(5), S3C_GPIO_SFN(2)); | 28 | s3c_gpio_cfgpin_range(S5P6440_GPB(5), 2, S3C_GPIO_SFN(2)); |
29 | s3c_gpio_setpull(S5P6440_GPB(5), S3C_GPIO_PULL_UP); | 29 | s3c_gpio_setpull(S5P6440_GPB(5), S3C_GPIO_PULL_UP); |
30 | s3c_gpio_cfgpin(S5P6440_GPB(6), S3C_GPIO_SFN(2)); | ||
31 | s3c_gpio_setpull(S5P6440_GPB(6), S3C_GPIO_PULL_UP); | 30 | s3c_gpio_setpull(S5P6440_GPB(6), S3C_GPIO_PULL_UP); |
32 | } | 31 | } |
33 | 32 | ||
34 | void s5p6450_i2c0_cfg_gpio(struct platform_device *dev) | 33 | void s5p6450_i2c0_cfg_gpio(struct platform_device *dev) |
35 | { | 34 | { |
36 | s3c_gpio_cfgpin(S5P6450_GPB(5), S3C_GPIO_SFN(2)); | 35 | s3c_gpio_cfgpin_range(S5P6450_GPB(5), 2, S3C_GPIO_SFN(2)); |
37 | s3c_gpio_setpull(S5P6450_GPB(5), S3C_GPIO_PULL_UP); | 36 | s3c_gpio_setpull(S5P6450_GPB(5), S3C_GPIO_PULL_UP); |
38 | s3c_gpio_cfgpin(S5P6450_GPB(6), S3C_GPIO_SFN(2)); | ||
39 | s3c_gpio_setpull(S5P6450_GPB(6), S3C_GPIO_PULL_UP); | 37 | s3c_gpio_setpull(S5P6450_GPB(6), S3C_GPIO_PULL_UP); |
40 | } | 38 | } |
41 | 39 | ||
diff --git a/arch/arm/mach-s5p64x0/setup-i2c1.c b/arch/arm/mach-s5p64x0/setup-i2c1.c index 2edd7912f8e4..5d5dd3c4edba 100644 --- a/arch/arm/mach-s5p64x0/setup-i2c1.c +++ b/arch/arm/mach-s5p64x0/setup-i2c1.c | |||
@@ -25,17 +25,15 @@ struct platform_device; /* don't need the contents */ | |||
25 | 25 | ||
26 | void s5p6440_i2c1_cfg_gpio(struct platform_device *dev) | 26 | void s5p6440_i2c1_cfg_gpio(struct platform_device *dev) |
27 | { | 27 | { |
28 | s3c_gpio_cfgpin(S5P6440_GPR(9), S3C_GPIO_SFN(6)); | 28 | s3c_gpio_cfgpin_range(S5P6440_GPR(9), 2, S3C_GPIO_SFN(6)); |
29 | s3c_gpio_setpull(S5P6440_GPR(9), S3C_GPIO_PULL_UP); | 29 | s3c_gpio_setpull(S5P6440_GPR(9), S3C_GPIO_PULL_UP); |
30 | s3c_gpio_cfgpin(S5P6440_GPR(10), S3C_GPIO_SFN(6)); | ||
31 | s3c_gpio_setpull(S5P6440_GPR(10), S3C_GPIO_PULL_UP); | 30 | s3c_gpio_setpull(S5P6440_GPR(10), S3C_GPIO_PULL_UP); |
32 | } | 31 | } |
33 | 32 | ||
34 | void s5p6450_i2c1_cfg_gpio(struct platform_device *dev) | 33 | void s5p6450_i2c1_cfg_gpio(struct platform_device *dev) |
35 | { | 34 | { |
36 | s3c_gpio_cfgpin(S5P6450_GPR(9), S3C_GPIO_SFN(6)); | 35 | s3c_gpio_cfgpin_range(S5P6450_GPR(9), 2, S3C_GPIO_SFN(6)); |
37 | s3c_gpio_setpull(S5P6450_GPR(9), S3C_GPIO_PULL_UP); | 36 | s3c_gpio_setpull(S5P6450_GPR(9), S3C_GPIO_PULL_UP); |
38 | s3c_gpio_cfgpin(S5P6450_GPR(10), S3C_GPIO_SFN(6)); | ||
39 | s3c_gpio_setpull(S5P6450_GPR(10), S3C_GPIO_PULL_UP); | 37 | s3c_gpio_setpull(S5P6450_GPR(10), S3C_GPIO_PULL_UP); |
40 | } | 38 | } |
41 | 39 | ||