diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2006-09-18 18:15:21 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-09-25 05:25:38 -0400 |
commit | e25d64f1242e8586f6e20c26fd876a4d956a6c45 (patch) | |
tree | 1a68da7173716896254847708dcd1675102a24ac /arch/arm/plat-iop | |
parent | 7ae1f7ec525c32db441836ab0ab010b85cb819a2 (diff) |
[ARM] 3819/1: iop3xx: factor out shared i2c code
Move the i2c bits shared between iop32x and iop33x to plat-iop/i2c.c
and include/asm-arm/hardware/iop3xx.h.
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/plat-iop')
-rw-r--r-- | arch/arm/plat-iop/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/plat-iop/i2c.c | 81 |
2 files changed, 82 insertions, 1 deletions
diff --git a/arch/arm/plat-iop/Makefile b/arch/arm/plat-iop/Makefile index b299103537c5..be6ab7c71ca3 100644 --- a/arch/arm/plat-iop/Makefile +++ b/arch/arm/plat-iop/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for the linux kernel. | 2 | # Makefile for the linux kernel. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := setup.o | 5 | obj-y := i2c.o setup.o |
6 | obj-m := | 6 | obj-m := |
7 | obj-n := | 7 | obj-n := |
8 | obj- := | 8 | obj- := |
diff --git a/arch/arm/plat-iop/i2c.c b/arch/arm/plat-iop/i2c.c new file mode 100644 index 000000000000..7ae149c2e982 --- /dev/null +++ b/arch/arm/plat-iop/i2c.c | |||
@@ -0,0 +1,81 @@ | |||
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> | ||
21 | #include <asm/io.h> | ||
22 | #include <asm/pgtable.h> | ||
23 | #include <asm/page.h> | ||
24 | #include <asm/mach/map.h> | ||
25 | #include <asm/setup.h> | ||
26 | #include <asm/system.h> | ||
27 | #include <asm/memory.h> | ||
28 | #include <asm/hardware.h> | ||
29 | #include <asm/hardware/iop3xx.h> | ||
30 | #include <asm/mach-types.h> | ||
31 | #include <asm/mach/arch.h> | ||
32 | |||
33 | #ifdef CONFIG_ARCH_IOP32X | ||
34 | #define IRQ_IOP3XX_I2C_0 IRQ_IOP321_I2C_0 | ||
35 | #define IRQ_IOP3XX_I2C_1 IRQ_IOP321_I2C_1 | ||
36 | #endif | ||
37 | #ifdef CONFIG_ARCH_IOP33X | ||
38 | #define IRQ_IOP3XX_I2C_0 IRQ_IOP331_I2C_0 | ||
39 | #define IRQ_IOP3XX_I2C_1 IRQ_IOP331_I2C_1 | ||
40 | #endif | ||
41 | |||
42 | static struct resource iop3xx_i2c0_resources[] = { | ||
43 | [0] = { | ||
44 | .start = 0xfffff680, | ||
45 | .end = 0xfffff697, | ||
46 | .flags = IORESOURCE_MEM, | ||
47 | }, | ||
48 | [1] = { | ||
49 | .start = IRQ_IOP3XX_I2C_0, | ||
50 | .end = IRQ_IOP3XX_I2C_0, | ||
51 | .flags = IORESOURCE_IRQ, | ||
52 | }, | ||
53 | }; | ||
54 | |||
55 | struct platform_device iop3xx_i2c0_device = { | ||
56 | .name = "IOP3xx-I2C", | ||
57 | .id = 0, | ||
58 | .num_resources = 2, | ||
59 | .resource = iop3xx_i2c0_resources, | ||
60 | }; | ||
61 | |||
62 | |||
63 | static struct resource iop3xx_i2c1_resources[] = { | ||
64 | [0] = { | ||
65 | .start = 0xfffff6a0, | ||
66 | .end = 0xfffff6b7, | ||
67 | .flags = IORESOURCE_MEM, | ||
68 | }, | ||
69 | [1] = { | ||
70 | .start = IRQ_IOP3XX_I2C_1, | ||
71 | .end = IRQ_IOP3XX_I2C_1, | ||
72 | .flags = IORESOURCE_IRQ, | ||
73 | } | ||
74 | }; | ||
75 | |||
76 | struct platform_device iop3xx_i2c1_device = { | ||
77 | .name = "IOP3xx-I2C", | ||
78 | .id = 1, | ||
79 | .num_resources = 2, | ||
80 | .resource = iop3xx_i2c1_resources, | ||
81 | }; | ||