diff options
author | Naveen Krishna Chatradhi <ch.naveen@samsung.com> | 2011-07-16 00:30:09 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-07-20 13:09:59 -0400 |
commit | 696f6fc1be92a8e117b4d07de34bf2d514a9c079 (patch) | |
tree | 663f0fc37c4a9a66eb7dbbf2f6c6f995490c7a4e | |
parent | 2c2e2c27e621e75313a6d0574afc0eedae3da84e (diff) |
ARM: SAMSUNG: Cleanup I2C code in plat-samsung
Removes the duplication of default info structure in
dev-i2c[0 ~ 7].c files
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r-- | arch/arm/plat-samsung/dev-i2c0.c | 4 | ||||
-rw-r--r-- | arch/arm/plat-samsung/dev-i2c1.c | 14 | ||||
-rw-r--r-- | arch/arm/plat-samsung/dev-i2c2.c | 14 | ||||
-rw-r--r-- | arch/arm/plat-samsung/dev-i2c3.c | 14 | ||||
-rw-r--r-- | arch/arm/plat-samsung/dev-i2c4.c | 14 | ||||
-rw-r--r-- | arch/arm/plat-samsung/dev-i2c5.c | 14 | ||||
-rw-r--r-- | arch/arm/plat-samsung/dev-i2c6.c | 14 | ||||
-rw-r--r-- | arch/arm/plat-samsung/dev-i2c7.c | 14 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/iic.h | 2 |
9 files changed, 32 insertions, 72 deletions
diff --git a/arch/arm/plat-samsung/dev-i2c0.c b/arch/arm/plat-samsung/dev-i2c0.c index c2a7b93cc059..f8251f5098bd 100644 --- a/arch/arm/plat-samsung/dev-i2c0.c +++ b/arch/arm/plat-samsung/dev-i2c0.c | |||
@@ -48,7 +48,7 @@ struct platform_device s3c_device_i2c0 = { | |||
48 | .resource = s3c_i2c_resource, | 48 | .resource = s3c_i2c_resource, |
49 | }; | 49 | }; |
50 | 50 | ||
51 | static struct s3c2410_platform_i2c default_i2c_data0 __initdata = { | 51 | struct s3c2410_platform_i2c default_i2c_data __initdata = { |
52 | .flags = 0, | 52 | .flags = 0, |
53 | .slave_addr = 0x10, | 53 | .slave_addr = 0x10, |
54 | .frequency = 100*1000, | 54 | .frequency = 100*1000, |
@@ -60,7 +60,7 @@ void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd) | |||
60 | struct s3c2410_platform_i2c *npd; | 60 | struct s3c2410_platform_i2c *npd; |
61 | 61 | ||
62 | if (!pd) | 62 | if (!pd) |
63 | pd = &default_i2c_data0; | 63 | pd = &default_i2c_data; |
64 | 64 | ||
65 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 65 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), |
66 | &s3c_device_i2c0); | 66 | &s3c_device_i2c0); |
diff --git a/arch/arm/plat-samsung/dev-i2c1.c b/arch/arm/plat-samsung/dev-i2c1.c index 0b6e02fe82b4..3b7c7bec1cf9 100644 --- a/arch/arm/plat-samsung/dev-i2c1.c +++ b/arch/arm/plat-samsung/dev-i2c1.c | |||
@@ -44,20 +44,14 @@ struct platform_device s3c_device_i2c1 = { | |||
44 | .resource = s3c_i2c_resource, | 44 | .resource = s3c_i2c_resource, |
45 | }; | 45 | }; |
46 | 46 | ||
47 | static struct s3c2410_platform_i2c default_i2c_data1 __initdata = { | ||
48 | .flags = 0, | ||
49 | .bus_num = 1, | ||
50 | .slave_addr = 0x10, | ||
51 | .frequency = 100*1000, | ||
52 | .sda_delay = 100, | ||
53 | }; | ||
54 | |||
55 | void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd) | 47 | void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd) |
56 | { | 48 | { |
57 | struct s3c2410_platform_i2c *npd; | 49 | struct s3c2410_platform_i2c *npd; |
58 | 50 | ||
59 | if (!pd) | 51 | if (!pd) { |
60 | pd = &default_i2c_data1; | 52 | pd = &default_i2c_data; |
53 | pd->bus_num = 1; | ||
54 | } | ||
61 | 55 | ||
62 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 56 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), |
63 | &s3c_device_i2c1); | 57 | &s3c_device_i2c1); |
diff --git a/arch/arm/plat-samsung/dev-i2c2.c b/arch/arm/plat-samsung/dev-i2c2.c index 5a015eadc210..07e9fd0b1b8b 100644 --- a/arch/arm/plat-samsung/dev-i2c2.c +++ b/arch/arm/plat-samsung/dev-i2c2.c | |||
@@ -45,20 +45,14 @@ struct platform_device s3c_device_i2c2 = { | |||
45 | .resource = s3c_i2c_resource, | 45 | .resource = s3c_i2c_resource, |
46 | }; | 46 | }; |
47 | 47 | ||
48 | static struct s3c2410_platform_i2c default_i2c_data2 __initdata = { | ||
49 | .flags = 0, | ||
50 | .bus_num = 2, | ||
51 | .slave_addr = 0x10, | ||
52 | .frequency = 100*1000, | ||
53 | .sda_delay = 100, | ||
54 | }; | ||
55 | |||
56 | void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd) | 48 | void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd) |
57 | { | 49 | { |
58 | struct s3c2410_platform_i2c *npd; | 50 | struct s3c2410_platform_i2c *npd; |
59 | 51 | ||
60 | if (!pd) | 52 | if (!pd) { |
61 | pd = &default_i2c_data2; | 53 | pd = &default_i2c_data; |
54 | pd->bus_num = 2; | ||
55 | } | ||
62 | 56 | ||
63 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 57 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), |
64 | &s3c_device_i2c2); | 58 | &s3c_device_i2c2); |
diff --git a/arch/arm/plat-samsung/dev-i2c3.c b/arch/arm/plat-samsung/dev-i2c3.c index 438bf4501dc0..d48efa93c6e7 100644 --- a/arch/arm/plat-samsung/dev-i2c3.c +++ b/arch/arm/plat-samsung/dev-i2c3.c | |||
@@ -43,20 +43,14 @@ struct platform_device s3c_device_i2c3 = { | |||
43 | .resource = s3c_i2c_resource, | 43 | .resource = s3c_i2c_resource, |
44 | }; | 44 | }; |
45 | 45 | ||
46 | static struct s3c2410_platform_i2c default_i2c_data3 __initdata = { | ||
47 | .flags = 0, | ||
48 | .bus_num = 3, | ||
49 | .slave_addr = 0x10, | ||
50 | .frequency = 100*1000, | ||
51 | .sda_delay = 100, | ||
52 | }; | ||
53 | |||
54 | void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd) | 46 | void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd) |
55 | { | 47 | { |
56 | struct s3c2410_platform_i2c *npd; | 48 | struct s3c2410_platform_i2c *npd; |
57 | 49 | ||
58 | if (!pd) | 50 | if (!pd) { |
59 | pd = &default_i2c_data3; | 51 | pd = &default_i2c_data; |
52 | pd->bus_num = 3; | ||
53 | } | ||
60 | 54 | ||
61 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 55 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), |
62 | &s3c_device_i2c3); | 56 | &s3c_device_i2c3); |
diff --git a/arch/arm/plat-samsung/dev-i2c4.c b/arch/arm/plat-samsung/dev-i2c4.c index c38ae9c25856..07e26444efe6 100644 --- a/arch/arm/plat-samsung/dev-i2c4.c +++ b/arch/arm/plat-samsung/dev-i2c4.c | |||
@@ -43,20 +43,14 @@ struct platform_device s3c_device_i2c4 = { | |||
43 | .resource = s3c_i2c_resource, | 43 | .resource = s3c_i2c_resource, |
44 | }; | 44 | }; |
45 | 45 | ||
46 | static struct s3c2410_platform_i2c default_i2c_data4 __initdata = { | ||
47 | .flags = 0, | ||
48 | .bus_num = 4, | ||
49 | .slave_addr = 0x10, | ||
50 | .frequency = 100*1000, | ||
51 | .sda_delay = 100, | ||
52 | }; | ||
53 | |||
54 | void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd) | 46 | void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd) |
55 | { | 47 | { |
56 | struct s3c2410_platform_i2c *npd; | 48 | struct s3c2410_platform_i2c *npd; |
57 | 49 | ||
58 | if (!pd) | 50 | if (!pd) { |
59 | pd = &default_i2c_data4; | 51 | pd = &default_i2c_data; |
52 | pd->bus_num = 4; | ||
53 | } | ||
60 | 54 | ||
61 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 55 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), |
62 | &s3c_device_i2c4); | 56 | &s3c_device_i2c4); |
diff --git a/arch/arm/plat-samsung/dev-i2c5.c b/arch/arm/plat-samsung/dev-i2c5.c index a0ce4d333d02..f49655784563 100644 --- a/arch/arm/plat-samsung/dev-i2c5.c +++ b/arch/arm/plat-samsung/dev-i2c5.c | |||
@@ -43,20 +43,14 @@ struct platform_device s3c_device_i2c5 = { | |||
43 | .resource = s3c_i2c_resource, | 43 | .resource = s3c_i2c_resource, |
44 | }; | 44 | }; |
45 | 45 | ||
46 | static struct s3c2410_platform_i2c default_i2c_data5 __initdata = { | ||
47 | .flags = 0, | ||
48 | .bus_num = 5, | ||
49 | .slave_addr = 0x10, | ||
50 | .frequency = 100*1000, | ||
51 | .sda_delay = 100, | ||
52 | }; | ||
53 | |||
54 | void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd) | 46 | void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd) |
55 | { | 47 | { |
56 | struct s3c2410_platform_i2c *npd; | 48 | struct s3c2410_platform_i2c *npd; |
57 | 49 | ||
58 | if (!pd) | 50 | if (!pd) { |
59 | pd = &default_i2c_data5; | 51 | pd = &default_i2c_data; |
52 | pd->bus_num = 5; | ||
53 | } | ||
60 | 54 | ||
61 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 55 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), |
62 | &s3c_device_i2c5); | 56 | &s3c_device_i2c5); |
diff --git a/arch/arm/plat-samsung/dev-i2c6.c b/arch/arm/plat-samsung/dev-i2c6.c index cf539cc708cc..141d799944e2 100644 --- a/arch/arm/plat-samsung/dev-i2c6.c +++ b/arch/arm/plat-samsung/dev-i2c6.c | |||
@@ -43,20 +43,14 @@ struct platform_device s3c_device_i2c6 = { | |||
43 | .resource = s3c_i2c_resource, | 43 | .resource = s3c_i2c_resource, |
44 | }; | 44 | }; |
45 | 45 | ||
46 | static struct s3c2410_platform_i2c default_i2c_data6 __initdata = { | ||
47 | .flags = 0, | ||
48 | .bus_num = 6, | ||
49 | .slave_addr = 0x10, | ||
50 | .frequency = 100*1000, | ||
51 | .sda_delay = 100, | ||
52 | }; | ||
53 | |||
54 | void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd) | 46 | void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd) |
55 | { | 47 | { |
56 | struct s3c2410_platform_i2c *npd; | 48 | struct s3c2410_platform_i2c *npd; |
57 | 49 | ||
58 | if (!pd) | 50 | if (!pd) { |
59 | pd = &default_i2c_data6; | 51 | pd = &default_i2c_data; |
52 | pd->bus_num = 6; | ||
53 | } | ||
60 | 54 | ||
61 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 55 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), |
62 | &s3c_device_i2c6); | 56 | &s3c_device_i2c6); |
diff --git a/arch/arm/plat-samsung/dev-i2c7.c b/arch/arm/plat-samsung/dev-i2c7.c index 70b249ac08cb..9dddcd1665b5 100644 --- a/arch/arm/plat-samsung/dev-i2c7.c +++ b/arch/arm/plat-samsung/dev-i2c7.c | |||
@@ -43,20 +43,14 @@ struct platform_device s3c_device_i2c7 = { | |||
43 | .resource = s3c_i2c_resource, | 43 | .resource = s3c_i2c_resource, |
44 | }; | 44 | }; |
45 | 45 | ||
46 | static struct s3c2410_platform_i2c default_i2c_data7 __initdata = { | ||
47 | .flags = 0, | ||
48 | .bus_num = 7, | ||
49 | .slave_addr = 0x10, | ||
50 | .frequency = 100*1000, | ||
51 | .sda_delay = 100, | ||
52 | }; | ||
53 | |||
54 | void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd) | 46 | void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd) |
55 | { | 47 | { |
56 | struct s3c2410_platform_i2c *npd; | 48 | struct s3c2410_platform_i2c *npd; |
57 | 49 | ||
58 | if (!pd) | 50 | if (!pd) { |
59 | pd = &default_i2c_data7; | 51 | pd = &default_i2c_data; |
52 | pd->bus_num = 7; | ||
53 | } | ||
60 | 54 | ||
61 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), | 55 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), |
62 | &s3c_device_i2c7); | 56 | &s3c_device_i2c7); |
diff --git a/arch/arm/plat-samsung/include/plat/iic.h b/arch/arm/plat-samsung/include/plat/iic.h index 1543da8f85c1..56b0059439e1 100644 --- a/arch/arm/plat-samsung/include/plat/iic.h +++ b/arch/arm/plat-samsung/include/plat/iic.h | |||
@@ -71,4 +71,6 @@ extern void s3c_i2c5_cfg_gpio(struct platform_device *dev); | |||
71 | extern void s3c_i2c6_cfg_gpio(struct platform_device *dev); | 71 | extern void s3c_i2c6_cfg_gpio(struct platform_device *dev); |
72 | extern void s3c_i2c7_cfg_gpio(struct platform_device *dev); | 72 | extern void s3c_i2c7_cfg_gpio(struct platform_device *dev); |
73 | 73 | ||
74 | extern struct s3c2410_platform_i2c default_i2c_data; | ||
75 | |||
74 | #endif /* __ASM_ARCH_IIC_H */ | 76 | #endif /* __ASM_ARCH_IIC_H */ |