]>
Commit | Line | Data |
---|---|---|
c8d833bf MS |
1 | /* linux/arch/arm/plat-s3c/dev-i2c2.c |
2 | * | |
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | |
4 | * http://www.samsung.com/ | |
5 | * | |
6 | * S3C series device definition for i2c device 2 | |
7 | * | |
8 | * Based on plat-samsung/dev-i2c0.c | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License version 2 as | |
12 | * published by the Free Software Foundation. | |
13 | */ | |
14 | ||
15 | #include <linux/gfp.h> | |
16 | #include <linux/kernel.h> | |
17 | #include <linux/string.h> | |
18 | #include <linux/platform_device.h> | |
19 | ||
20 | #include <mach/irqs.h> | |
21 | #include <mach/map.h> | |
22 | ||
23 | #include <plat/regs-iic.h> | |
24 | #include <plat/iic.h> | |
25 | #include <plat/devs.h> | |
26 | #include <plat/cpu.h> | |
27 | ||
28 | static struct resource s3c_i2c_resource[] = { | |
29 | [0] = { | |
30 | .start = S3C_PA_IIC2, | |
31 | .end = S3C_PA_IIC2 + SZ_4K - 1, | |
32 | .flags = IORESOURCE_MEM, | |
33 | }, | |
34 | [1] = { | |
023c75c7 KP |
35 | .start = IRQ_IIC2, |
36 | .end = IRQ_IIC2, | |
c8d833bf MS |
37 | .flags = IORESOURCE_IRQ, |
38 | }, | |
39 | }; | |
40 | ||
41 | struct platform_device s3c_device_i2c2 = { | |
42 | .name = "s3c2410-i2c", | |
43 | .id = 2, | |
44 | .num_resources = ARRAY_SIZE(s3c_i2c_resource), | |
45 | .resource = s3c_i2c_resource, | |
46 | }; | |
47 | ||
c8d833bf MS |
48 | void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd) |
49 | { | |
50 | struct s3c2410_platform_i2c *npd; | |
51 | ||
696f6fc1 NKC |
52 | if (!pd) { |
53 | pd = &default_i2c_data; | |
54 | pd->bus_num = 2; | |
55 | } | |
c8d833bf | 56 | |
2c2e2c27 NKC |
57 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), |
58 | &s3c_device_i2c2); | |
c8d833bf | 59 | |
2c2e2c27 NKC |
60 | if (!npd->cfg_gpio) |
61 | npd->cfg_gpio = s3c_i2c2_cfg_gpio; | |
c8d833bf | 62 | } |