From 1451ba3a5fa52d874e03a3380d053f3e6a5fcae4 Mon Sep 17 00:00:00 2001 From: Roland Stigge Date: Sun, 22 Apr 2012 11:59:47 +0200 Subject: i2c-pnx.c: Use resources in platforms As a precondition for device tree conversion, the platforms using i2c-pnx.c are converted to using mem and irq resources instead of platform data. Signed-off-by: Roland Stigge Reviewed-by: Arnd Bergmann Signed-off-by: Wolfram Sang --- arch/arm/mach-pnx4008/i2c.c | 64 +++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 25 deletions(-) (limited to 'arch/arm/mach-pnx4008') diff --git a/arch/arm/mach-pnx4008/i2c.c b/arch/arm/mach-pnx4008/i2c.c index 8103f9644e2..550cfc2a1f2 100644 --- a/arch/arm/mach-pnx4008/i2c.c +++ b/arch/arm/mach-pnx4008/i2c.c @@ -16,48 +16,62 @@ #include #include #include -#include -static struct i2c_pnx_data i2c0_data = { - .name = I2C_CHIP_NAME "0", - .base = PNX4008_I2C1_BASE, - .irq = I2C_1_INT, +static struct resource i2c0_resources[] = { + { + .start = PNX4008_I2C1_BASE, + .end = PNX4008_I2C1_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, { + .start = I2C_1_INT, + .end = I2C_1_INT, + .flags = IORESOURCE_IRQ, + }, }; -static struct i2c_pnx_data i2c1_data = { - .name = I2C_CHIP_NAME "1", - .base = PNX4008_I2C2_BASE, - .irq = I2C_2_INT, +static struct resource i2c1_resources[] = { + { + .start = PNX4008_I2C2_BASE, + .end = PNX4008_I2C2_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, { + .start = I2C_2_INT, + .end = I2C_2_INT, + .flags = IORESOURCE_IRQ, + }, }; -static struct i2c_pnx_data i2c2_data = { - .name = "USB-I2C", - .base = (PNX4008_USB_CONFIG_BASE + 0x300), - .irq = USB_I2C_INT, +static struct resource i2c2_resources[] = { + { + .start = PNX4008_USB_CONFIG_BASE + 0x300, + .end = PNX4008_USB_CONFIG_BASE + 0x300 + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, { + .start = USB_I2C_INT, + .end = USB_I2C_INT, + .flags = IORESOURCE_IRQ, + }, }; static struct platform_device i2c0_device = { - .name = "pnx-i2c", + .name = "pnx-i2c.0", .id = 0, - .dev = { - .platform_data = &i2c0_data, - }, + .resource = i2c0_resources, + .num_resources = ARRAY_SIZE(i2c0_resources), }; static struct platform_device i2c1_device = { - .name = "pnx-i2c", + .name = "pnx-i2c.1", .id = 1, - .dev = { - .platform_data = &i2c1_data, - }, + .resource = i2c1_resources, + .num_resources = ARRAY_SIZE(i2c1_resources), }; static struct platform_device i2c2_device = { - .name = "pnx-i2c", + .name = "pnx-i2c.2", .id = 2, - .dev = { - .platform_data = &i2c2_data, - }, + .resource = i2c2_resources, + .num_resources = ARRAY_SIZE(i2c2_resources), }; static struct platform_device *devices[] __initdata = { -- cgit v1.2.3