From ea7d8d23618af6000c79101827bc51ced6525ab8 Mon Sep 17 00:00:00 2001 From: Herbert Valerio Riedel Date: Mon, 12 Nov 2007 09:51:36 +0200 Subject: [PATCH] --- yaml --- r: 77533 b: refs/heads/master c: 144aa3db1e8faa34bb33c61131494ac879a6d978 h: refs/heads/master i: 77531: 54ed97eda0bf06483f46c6a4108d973a235e222b v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-orion/common.c | 38 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index da2f6a270389..0e44ea13198e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2f0a8df40ff008822e5570b3323c56622cd92c95 +refs/heads/master: 144aa3db1e8faa34bb33c61131494ac879a6d978 diff --git a/trunk/arch/arm/mach-orion/common.c b/trunk/arch/arm/mach-orion/common.c index ff34827f82a5..5e20b6b32508 100644 --- a/trunk/arch/arm/mach-orion/common.c +++ b/trunk/arch/arm/mach-orion/common.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -212,6 +213,42 @@ void __init orion_eth_init(struct mv643xx_eth_platform_data *eth_data) platform_device_register(&orion_eth); } +/***************************************************************************** + * I2C controller + * (The Orion and Discovery (MV643xx) families share the same I2C controller) + ****************************************************************************/ + +static struct mv64xxx_i2c_pdata orion_i2c_pdata = { + .freq_m = 8, /* assumes 166 MHz TCLK */ + .freq_n = 3, + .timeout = 1000, /* Default timeout of 1 second */ +}; + +static struct resource orion_i2c_resources[] = { + { + .name = "i2c base", + .start = I2C_BASE, + .end = I2C_BASE + 0x20 -1, + .flags = IORESOURCE_MEM, + }, + { + .name = "i2c irq", + .start = IRQ_ORION_I2C, + .end = IRQ_ORION_I2C, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device orion_i2c = { + .name = MV64XXX_I2C_CTLR_NAME, + .id = 0, + .num_resources = ARRAY_SIZE(orion_i2c_resources), + .resource = orion_i2c_resources, + .dev = { + .platform_data = &orion_i2c_pdata, + }, +}; + /***************************************************************************** * General ****************************************************************************/ @@ -274,4 +311,5 @@ void __init orion_init(void) platform_device_register(&orion_ehci0); if (dev == MV88F5182_DEV_ID) platform_device_register(&orion_ehci1); + platform_device_register(&orion_i2c); }