aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mv78xx0
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2011-05-15 07:32:45 -0400
committerNicolas Pitre <nico@fluxnic.net>2011-05-16 15:08:36 -0400
commitaac7ffa3ed121846b61347028828617c5dd1ce46 (patch)
treeec2590692fef62fe4df9dc772e2552bb17e50892 /arch/arm/mach-mv78xx0
parent7e3819d820c9aa3536d15fe7310c054bef1f5f04 (diff)
ARM: orion: Consolidate I2C initialization.
Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'arch/arm/mach-mv78xx0')
-rw-r--r--arch/arm/mach-mv78xx0/common.c70
1 files changed, 3 insertions, 67 deletions
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index 0fd9a8329910..aa27c154cd0d 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -13,7 +13,6 @@
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/serial_8250.h> 14#include <linux/serial_8250.h>
15#include <linux/mbus.h> 15#include <linux/mbus.h>
16#include <linux/mv643xx_i2c.h>
17#include <linux/ata_platform.h> 16#include <linux/ata_platform.h>
18#include <linux/ethtool.h> 17#include <linux/ethtool.h>
19#include <asm/mach/map.h> 18#include <asm/mach/map.h>
@@ -346,75 +345,12 @@ void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data)
346} 345}
347 346
348/***************************************************************************** 347/*****************************************************************************
349 * I2C bus 0 348 * I2C
350 ****************************************************************************/ 349 ****************************************************************************/
351
352static struct mv64xxx_i2c_pdata mv78xx0_i2c_0_pdata = {
353 .freq_m = 8, /* assumes 166 MHz TCLK */
354 .freq_n = 3,
355 .timeout = 1000, /* Default timeout of 1 second */
356};
357
358static struct resource mv78xx0_i2c_0_resources[] = {
359 {
360 .start = I2C_0_PHYS_BASE,
361 .end = I2C_0_PHYS_BASE + 0x1f,
362 .flags = IORESOURCE_MEM,
363 }, {
364 .start = IRQ_MV78XX0_I2C_0,
365 .end = IRQ_MV78XX0_I2C_0,
366 .flags = IORESOURCE_IRQ,
367 },
368};
369
370
371static struct platform_device mv78xx0_i2c_0 = {
372 .name = MV64XXX_I2C_CTLR_NAME,
373 .id = 0,
374 .num_resources = ARRAY_SIZE(mv78xx0_i2c_0_resources),
375 .resource = mv78xx0_i2c_0_resources,
376 .dev = {
377 .platform_data = &mv78xx0_i2c_0_pdata,
378 },
379};
380
381/*****************************************************************************
382 * I2C bus 1
383 ****************************************************************************/
384
385static struct mv64xxx_i2c_pdata mv78xx0_i2c_1_pdata = {
386 .freq_m = 8, /* assumes 166 MHz TCLK */
387 .freq_n = 3,
388 .timeout = 1000, /* Default timeout of 1 second */
389};
390
391static struct resource mv78xx0_i2c_1_resources[] = {
392 {
393 .start = I2C_1_PHYS_BASE,
394 .end = I2C_1_PHYS_BASE + 0x1f,
395 .flags = IORESOURCE_MEM,
396 }, {
397 .start = IRQ_MV78XX0_I2C_1,
398 .end = IRQ_MV78XX0_I2C_1,
399 .flags = IORESOURCE_IRQ,
400 },
401};
402
403
404static struct platform_device mv78xx0_i2c_1 = {
405 .name = MV64XXX_I2C_CTLR_NAME,
406 .id = 1,
407 .num_resources = ARRAY_SIZE(mv78xx0_i2c_1_resources),
408 .resource = mv78xx0_i2c_1_resources,
409 .dev = {
410 .platform_data = &mv78xx0_i2c_1_pdata,
411 },
412};
413
414void __init mv78xx0_i2c_init(void) 350void __init mv78xx0_i2c_init(void)
415{ 351{
416 platform_device_register(&mv78xx0_i2c_0); 352 orion_i2c_init(I2C_0_PHYS_BASE, IRQ_MV78XX0_I2C_0, 8);
417 platform_device_register(&mv78xx0_i2c_1); 353 orion_i2c_1_init(I2C_1_PHYS_BASE, IRQ_MV78XX0_I2C_1, 8);
418} 354}
419 355
420/***************************************************************************** 356/*****************************************************************************