diff options
Diffstat (limited to 'arch/arm/plat-samsung/dev-i2c1.c')
-rw-r--r-- | arch/arm/plat-samsung/dev-i2c1.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/arch/arm/plat-samsung/dev-i2c1.c b/arch/arm/plat-samsung/dev-i2c1.c index 858ee2a0414c..3b7c7bec1cf9 100644 --- a/arch/arm/plat-samsung/dev-i2c1.c +++ b/arch/arm/plat-samsung/dev-i2c1.c | |||
@@ -44,26 +44,18 @@ 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 = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL); | 56 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), |
63 | if (!npd) | 57 | &s3c_device_i2c1); |
64 | printk(KERN_ERR "%s: no memory for platform data\n", __func__); | ||
65 | else if (!npd->cfg_gpio) | ||
66 | npd->cfg_gpio = s3c_i2c1_cfg_gpio; | ||
67 | 58 | ||
68 | s3c_device_i2c1.dev.platform_data = npd; | 59 | if (!npd->cfg_gpio) |
60 | npd->cfg_gpio = s3c_i2c1_cfg_gpio; | ||
69 | } | 61 | } |