diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-03-25 10:00:08 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-03-25 10:00:08 +0000 |
commit | cf281a99b6e4f1223c8fdce390db3bf79e773f4c (patch) | |
tree | 33bff28362b5e41f7a2a09c097e0d2ea6e4ded13 /arch/arm/mach-kirkwood/common.c | |
parent | fbf2b1f9cfdb4e4b5d042839142ed19ff5d46679 (diff) | |
parent | 9d1d4f9eabbca276a2a618a94ed3149d5971063e (diff) |
Merge git://git.marvell.com/orion into devel
Diffstat (limited to 'arch/arm/mach-kirkwood/common.c')
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 9f012551794..19b03f62c3f 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c @@ -14,6 +14,7 @@ #include <linux/serial_8250.h> #include <linux/mbus.h> #include <linux/mv643xx_eth.h> +#include <linux/mv643xx_i2c.h> #include <linux/ata_platform.h> #include <linux/spi/orion_spi.h> #include <net/dsa.h> @@ -371,6 +372,45 @@ void __init kirkwood_spi_init() /***************************************************************************** + * I2C + ****************************************************************************/ +static struct mv64xxx_i2c_pdata kirkwood_i2c_pdata = { + .freq_m = 8, /* assumes 166 MHz TCLK */ + .freq_n = 3, + .timeout = 1000, /* Default timeout of 1 second */ +}; + +static struct resource kirkwood_i2c_resources[] = { + { + .name = "i2c", + .start = I2C_PHYS_BASE, + .end = I2C_PHYS_BASE + 0x1f, + .flags = IORESOURCE_MEM, + }, { + .name = "i2c", + .start = IRQ_KIRKWOOD_TWSI, + .end = IRQ_KIRKWOOD_TWSI, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device kirkwood_i2c = { + .name = MV64XXX_I2C_CTLR_NAME, + .id = 0, + .num_resources = ARRAY_SIZE(kirkwood_i2c_resources), + .resource = kirkwood_i2c_resources, + .dev = { + .platform_data = &kirkwood_i2c_pdata, + }, +}; + +void __init kirkwood_i2c_init(void) +{ + platform_device_register(&kirkwood_i2c); +} + + +/***************************************************************************** * UART0 ****************************************************************************/ static struct plat_serial8250_port kirkwood_uart0_data[] = { |