Merge tag 'v3.9-rc3' into v4l_for_linus
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / plat-iop / i2c.c
CommitLineData
e25d64f1
LB
1/*
2 * arch/arm/plat-iop/i2c.c
3 *
4 * Author: Nicolas Pitre <nico@cam.org>
5 * Copyright (C) 2001 MontaVista Software, Inc.
6 * Copyright (C) 2004 Intel Corporation.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/mm.h>
14#include <linux/init.h>
15#include <linux/major.h>
16#include <linux/fs.h>
17#include <linux/platform_device.h>
18#include <linux/serial.h>
19#include <linux/tty.h>
20#include <linux/serial_core.h>
fced80c7 21#include <linux/io.h>
e25d64f1
LB
22#include <asm/pgtable.h>
23#include <asm/page.h>
24#include <asm/mach/map.h>
25#include <asm/setup.h>
e25d64f1 26#include <asm/memory.h>
a09e64fb 27#include <mach/hardware.h>
e25d64f1 28#include <asm/hardware/iop3xx.h>
e25d64f1
LB
29#include <asm/mach/arch.h>
30
31#ifdef CONFIG_ARCH_IOP32X
c852ac80
LB
32#define IRQ_IOP3XX_I2C_0 IRQ_IOP32X_I2C_0
33#define IRQ_IOP3XX_I2C_1 IRQ_IOP32X_I2C_1
e25d64f1
LB
34#endif
35#ifdef CONFIG_ARCH_IOP33X
c852ac80
LB
36#define IRQ_IOP3XX_I2C_0 IRQ_IOP33X_I2C_0
37#define IRQ_IOP3XX_I2C_1 IRQ_IOP33X_I2C_1
e25d64f1
LB
38#endif
39
40static struct resource iop3xx_i2c0_resources[] = {
41 [0] = {
42 .start = 0xfffff680,
43 .end = 0xfffff697,
44 .flags = IORESOURCE_MEM,
45 },
46 [1] = {
47 .start = IRQ_IOP3XX_I2C_0,
48 .end = IRQ_IOP3XX_I2C_0,
49 .flags = IORESOURCE_IRQ,
50 },
51};
52
53struct platform_device iop3xx_i2c0_device = {
54 .name = "IOP3xx-I2C",
55 .id = 0,
56 .num_resources = 2,
57 .resource = iop3xx_i2c0_resources,
58};
59
60
61static struct resource iop3xx_i2c1_resources[] = {
62 [0] = {
63 .start = 0xfffff6a0,
64 .end = 0xfffff6b7,
65 .flags = IORESOURCE_MEM,
66 },
67 [1] = {
68 .start = IRQ_IOP3XX_I2C_1,
69 .end = IRQ_IOP3XX_I2C_1,
70 .flags = IORESOURCE_IRQ,
71 }
72};
73
74struct platform_device iop3xx_i2c1_device = {
75 .name = "IOP3xx-I2C",
76 .id = 1,
77 .num_resources = 2,
78 .resource = iop3xx_i2c1_resources,
79};