ARM: orion: Consolidate I2C initialization.
Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
This commit is contained in:

کامیت شده توسط
Nicolas Pitre

والد
7e3819d820
کامیت
aac7ffa3ed
@@ -13,7 +13,6 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/serial_8250.h>
|
||||
#include <linux/mbus.h>
|
||||
#include <linux/mv643xx_i2c.h>
|
||||
#include <linux/ata_platform.h>
|
||||
#include <linux/ethtool.h>
|
||||
#include <asm/mach/map.h>
|
||||
@@ -346,75 +345,12 @@ void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data)
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* I2C bus 0
|
||||
* I2C
|
||||
****************************************************************************/
|
||||
|
||||
static struct mv64xxx_i2c_pdata mv78xx0_i2c_0_pdata = {
|
||||
.freq_m = 8, /* assumes 166 MHz TCLK */
|
||||
.freq_n = 3,
|
||||
.timeout = 1000, /* Default timeout of 1 second */
|
||||
};
|
||||
|
||||
static struct resource mv78xx0_i2c_0_resources[] = {
|
||||
{
|
||||
.start = I2C_0_PHYS_BASE,
|
||||
.end = I2C_0_PHYS_BASE + 0x1f,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_MV78XX0_I2C_0,
|
||||
.end = IRQ_MV78XX0_I2C_0,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
static struct platform_device mv78xx0_i2c_0 = {
|
||||
.name = MV64XXX_I2C_CTLR_NAME,
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(mv78xx0_i2c_0_resources),
|
||||
.resource = mv78xx0_i2c_0_resources,
|
||||
.dev = {
|
||||
.platform_data = &mv78xx0_i2c_0_pdata,
|
||||
},
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* I2C bus 1
|
||||
****************************************************************************/
|
||||
|
||||
static struct mv64xxx_i2c_pdata mv78xx0_i2c_1_pdata = {
|
||||
.freq_m = 8, /* assumes 166 MHz TCLK */
|
||||
.freq_n = 3,
|
||||
.timeout = 1000, /* Default timeout of 1 second */
|
||||
};
|
||||
|
||||
static struct resource mv78xx0_i2c_1_resources[] = {
|
||||
{
|
||||
.start = I2C_1_PHYS_BASE,
|
||||
.end = I2C_1_PHYS_BASE + 0x1f,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_MV78XX0_I2C_1,
|
||||
.end = IRQ_MV78XX0_I2C_1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
static struct platform_device mv78xx0_i2c_1 = {
|
||||
.name = MV64XXX_I2C_CTLR_NAME,
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(mv78xx0_i2c_1_resources),
|
||||
.resource = mv78xx0_i2c_1_resources,
|
||||
.dev = {
|
||||
.platform_data = &mv78xx0_i2c_1_pdata,
|
||||
},
|
||||
};
|
||||
|
||||
void __init mv78xx0_i2c_init(void)
|
||||
{
|
||||
platform_device_register(&mv78xx0_i2c_0);
|
||||
platform_device_register(&mv78xx0_i2c_1);
|
||||
orion_i2c_init(I2C_0_PHYS_BASE, IRQ_MV78XX0_I2C_0, 8);
|
||||
orion_i2c_1_init(I2C_1_PHYS_BASE, IRQ_MV78XX0_I2C_1, 8);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
مرجع در شماره جدید
Block a user