aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2012-10-10 22:56:51 -0400
committerSimon Horman <horms@verge.net.au>2012-11-05 23:47:23 -0500
commitccc2a27b15c978334927cea9f1156f019a01b833 (patch)
treea101c74e4a2ad3ea45cc9fe1f6a75db952b9b769 /arch/arm
parent16c40abcfa8738da9aa0e25b407bbf0dcbdd5e13 (diff)
ARM: shmobile: r8a7779: add I2C driver support
This patch enable R-Car I2C driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/configs/marzen_defconfig2
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c77
2 files changed, 79 insertions, 0 deletions
diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 53382b6c8bb4..f79b55c512d0 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -69,6 +69,8 @@ CONFIG_SERIAL_SH_SCI=y
69CONFIG_SERIAL_SH_SCI_NR_UARTS=6 69CONFIG_SERIAL_SH_SCI_NR_UARTS=6
70CONFIG_SERIAL_SH_SCI_CONSOLE=y 70CONFIG_SERIAL_SH_SCI_CONSOLE=y
71# CONFIG_HW_RANDOM is not set 71# CONFIG_HW_RANDOM is not set
72CONFIG_I2C=y
73CONFIG_I2C_RCAR=y
72CONFIG_GPIO_SYSFS=y 74CONFIG_GPIO_SYSFS=y
73# CONFIG_HWMON is not set 75# CONFIG_HWMON is not set
74CONFIG_THERMAL=y 76CONFIG_THERMAL=y
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 2917668f0091..63de5cb28e4a 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -229,6 +229,79 @@ static struct platform_device tmu01_device = {
229 .num_resources = ARRAY_SIZE(tmu01_resources), 229 .num_resources = ARRAY_SIZE(tmu01_resources),
230}; 230};
231 231
232/* I2C */
233static struct resource rcar_i2c0_res[] = {
234 {
235 .start = 0xffc70000,
236 .end = 0xffc70fff,
237 .flags = IORESOURCE_MEM,
238 }, {
239 .start = gic_spi(79),
240 .flags = IORESOURCE_IRQ,
241 },
242};
243
244static struct platform_device i2c0_device = {
245 .name = "i2c-rcar",
246 .id = 0,
247 .resource = rcar_i2c0_res,
248 .num_resources = ARRAY_SIZE(rcar_i2c0_res),
249};
250
251static struct resource rcar_i2c1_res[] = {
252 {
253 .start = 0xffc71000,
254 .end = 0xffc71fff,
255 .flags = IORESOURCE_MEM,
256 }, {
257 .start = gic_spi(82),
258 .flags = IORESOURCE_IRQ,
259 },
260};
261
262static struct platform_device i2c1_device = {
263 .name = "i2c-rcar",
264 .id = 1,
265 .resource = rcar_i2c1_res,
266 .num_resources = ARRAY_SIZE(rcar_i2c1_res),
267};
268
269static struct resource rcar_i2c2_res[] = {
270 {
271 .start = 0xffc72000,
272 .end = 0xffc72fff,
273 .flags = IORESOURCE_MEM,
274 }, {
275 .start = gic_spi(80),
276 .flags = IORESOURCE_IRQ,
277 },
278};
279
280static struct platform_device i2c2_device = {
281 .name = "i2c-rcar",
282 .id = 2,
283 .resource = rcar_i2c2_res,
284 .num_resources = ARRAY_SIZE(rcar_i2c2_res),
285};
286
287static struct resource rcar_i2c3_res[] = {
288 {
289 .start = 0xffc73000,
290 .end = 0xffc73fff,
291 .flags = IORESOURCE_MEM,
292 }, {
293 .start = gic_spi(81),
294 .flags = IORESOURCE_IRQ,
295 },
296};
297
298static struct platform_device i2c3_device = {
299 .name = "i2c-rcar",
300 .id = 3,
301 .resource = rcar_i2c3_res,
302 .num_resources = ARRAY_SIZE(rcar_i2c3_res),
303};
304
232static struct platform_device *r8a7779_early_devices[] __initdata = { 305static struct platform_device *r8a7779_early_devices[] __initdata = {
233 &scif0_device, 306 &scif0_device,
234 &scif1_device, 307 &scif1_device,
@@ -238,6 +311,10 @@ static struct platform_device *r8a7779_early_devices[] __initdata = {
238 &scif5_device, 311 &scif5_device,
239 &tmu00_device, 312 &tmu00_device,
240 &tmu01_device, 313 &tmu01_device,
314 &i2c0_device,
315 &i2c1_device,
316 &i2c2_device,
317 &i2c3_device,
241}; 318};
242 319
243static struct platform_device *r8a7779_late_devices[] __initdata = { 320static struct platform_device *r8a7779_late_devices[] __initdata = {