diff options
| author | Deepak Saxena <dsaxena@plexity.net> | 2005-01-05 23:05:54 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2005-01-05 23:05:54 -0800 |
| commit | 57683a86839aaba3b861c3baa0da94a6140e0c36 (patch) | |
| tree | 3a88563b121d76fd26a14f60ccf703ddf24578f4 /include | |
| parent | 3e4e417311ebcb8499a8ee10c23e8b59ee97a4d6 (diff) | |
[PATCH] Update IOP3xx I2C bus driver
The following patch is a major cleanup of the IOP3xx I2C bus driver
that is found on Intel's IOP and IXP chipsets. The existing driver in
the 2.6 tree uses hardcoded I/O addresses based on board configuration
which is just going to get ugly as more chips use this unit. The update
switches to using the driver model and passing in the I/O addresses
via platform_device resources. The patch also updates the ID name to
more closely match the actual usage of the device.
I have tested this new driver on IXP46x systems and Dave Jiang has
tested it on both IOP321 and IOP331 systems. ARM-specific patches
to provide platform-level hooks will go upstream after this patch
is integrated.
An example of using the new driver (from IXP46x ARM code) follows:
static struct resource ixp46x_i2c_resources[] = {
[0] = {
.start = 0xc8011000,
.end = 0xc801101c,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_IXP4XX_I2C,
.end = IRQ_IXP4XX_I2C,
.flags = IORESOURCE_IRQ
}
};
static struct platform_device ixp46x_i2c_controller = {
.name = "IOP3xx-I2C",
.id = 0,
.num_resources = 2,
.resource = &ixp46x_i2c_resources
};
static struct platform_device *ixp46x_devices[] __initdata = {
&ixp46x_i2c_controller
};
void __init ixp4xx_init(void)
{
if (cpu_is_ixp46x()) {
platform_add_devices(ixp46x_devices,
ARRAY_SIZE(ixp46x_devices));
}
}
Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/i2c-id.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index a75f38041df5..802732f51a23 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -194,7 +194,7 @@ #define I2C_ALGO_MPC8XX 0x110000 /* MPC8xx PowerPC I2C algorithm */ #define I2C_ALGO_OCP 0x120000 /* IBM or otherwise On-chip I2C algorithm */ #define I2C_ALGO_BITHS 0x130000 /* enhanced bit style adapters */ -#define I2C_ALGO_OCP_IOP3XX 0x140000 /* XSCALE IOP3XX On-chip I2C alg */ +#define I2C_ALGO_IOP3XX 0x140000 /* XSCALE IOP3XX On-chip I2C alg */ #define I2C_ALGO_PCA 0x150000 /* PCA 9564 style adapters */ #define I2C_ALGO_SIBYTE 0x150000 /* Broadcom SiByte SOCs */ @@ -270,7 +270,7 @@ #define I2C_HW_SGI_MACE 0x01 /* --- XSCALE on-chip adapters */ -#define I2C_HW_IOP321 0x00 +#define I2C_HW_IOP3XX 0x00 /* --- SMBus only adapters */ #define I2C_HW_SMBUS_PIIX4 0x00 |
