Lennert Buytenhek | e25d64f | 2006-09-18 23:15:21 +0100 | [diff] [blame] | 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> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 21 | #include <linux/io.h> |
Lennert Buytenhek | e25d64f | 2006-09-18 23:15:21 +0100 | [diff] [blame] | 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> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 28 | #include <mach/hardware.h> |
Lennert Buytenhek | e25d64f | 2006-09-18 23:15:21 +0100 | [diff] [blame] | 29 | #include <asm/hardware/iop3xx.h> |
Lennert Buytenhek | e25d64f | 2006-09-18 23:15:21 +0100 | [diff] [blame] | 30 | #include <asm/mach/arch.h> |
| 31 | |
| 32 | #ifdef CONFIG_ARCH_IOP32X |
Lennert Buytenhek | c852ac8 | 2006-09-18 23:26:25 +0100 | [diff] [blame] | 33 | #define IRQ_IOP3XX_I2C_0 IRQ_IOP32X_I2C_0 |
| 34 | #define IRQ_IOP3XX_I2C_1 IRQ_IOP32X_I2C_1 |
Lennert Buytenhek | e25d64f | 2006-09-18 23:15:21 +0100 | [diff] [blame] | 35 | #endif |
| 36 | #ifdef CONFIG_ARCH_IOP33X |
Lennert Buytenhek | c852ac8 | 2006-09-18 23:26:25 +0100 | [diff] [blame] | 37 | #define IRQ_IOP3XX_I2C_0 IRQ_IOP33X_I2C_0 |
| 38 | #define IRQ_IOP3XX_I2C_1 IRQ_IOP33X_I2C_1 |
Lennert Buytenhek | e25d64f | 2006-09-18 23:15:21 +0100 | [diff] [blame] | 39 | #endif |
| 40 | |
| 41 | static struct resource iop3xx_i2c0_resources[] = { |
| 42 | [0] = { |
| 43 | .start = 0xfffff680, |
| 44 | .end = 0xfffff697, |
| 45 | .flags = IORESOURCE_MEM, |
| 46 | }, |
| 47 | [1] = { |
| 48 | .start = IRQ_IOP3XX_I2C_0, |
| 49 | .end = IRQ_IOP3XX_I2C_0, |
| 50 | .flags = IORESOURCE_IRQ, |
| 51 | }, |
| 52 | }; |
| 53 | |
| 54 | struct platform_device iop3xx_i2c0_device = { |
| 55 | .name = "IOP3xx-I2C", |
| 56 | .id = 0, |
| 57 | .num_resources = 2, |
| 58 | .resource = iop3xx_i2c0_resources, |
| 59 | }; |
| 60 | |
| 61 | |
| 62 | static struct resource iop3xx_i2c1_resources[] = { |
| 63 | [0] = { |
| 64 | .start = 0xfffff6a0, |
| 65 | .end = 0xfffff6b7, |
| 66 | .flags = IORESOURCE_MEM, |
| 67 | }, |
| 68 | [1] = { |
| 69 | .start = IRQ_IOP3XX_I2C_1, |
| 70 | .end = IRQ_IOP3XX_I2C_1, |
| 71 | .flags = IORESOURCE_IRQ, |
| 72 | } |
| 73 | }; |
| 74 | |
| 75 | struct platform_device iop3xx_i2c1_device = { |
| 76 | .name = "IOP3xx-I2C", |
| 77 | .id = 1, |
| 78 | .num_resources = 2, |
| 79 | .resource = iop3xx_i2c1_resources, |
| 80 | }; |