aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRoland Stigge <stigge@antcom.de>2012-04-22 05:59:47 -0400
committerRoland Stigge <stigge@antcom.de>2012-04-22 05:59:47 -0400
commit1451ba3a5fa52d874e03a3380d053f3e6a5fcae4 (patch)
treee40a2b10951eabace15836d658eea8848d47564c /arch/arm
parentc4cea7fc1bfd8a36d08f8114efcb11d649d97d5a (diff)
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 <stigge@antcom.de> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-lpc32xx/common.c67
-rw-r--r--arch/arm/mach-pnx4008/i2c.c64
2 files changed, 81 insertions, 50 deletions
diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c
index bbbf063a74c2..6f255600fc97 100644
--- a/arch/arm/mach-lpc32xx/common.c
+++ b/arch/arm/mach-lpc32xx/common.c
@@ -27,7 +27,6 @@
27 27
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29 29
30#include <mach/i2c.h>
31#include <mach/hardware.h> 30#include <mach/hardware.h>
32#include <mach/platform.h> 31#include <mach/platform.h>
33#include "common.h" 32#include "common.h"
@@ -53,46 +52,64 @@ struct platform_device lpc32xx_watchdog_device = {
53/* 52/*
54 * I2C busses 53 * I2C busses
55 */ 54 */
56static struct i2c_pnx_data i2c0_data = { 55static struct resource i2c0_resources[] = {
57 .name = I2C_CHIP_NAME "1", 56 [0] = {
58 .base = LPC32XX_I2C1_BASE, 57 .start = LPC32XX_I2C1_BASE,
59 .irq = IRQ_LPC32XX_I2C_1, 58 .end = LPC32XX_I2C1_BASE + 0x100 - 1,
59 .flags = IORESOURCE_MEM,
60 },
61 [1] = {
62 .start = IRQ_LPC32XX_I2C_1,
63 .end = IRQ_LPC32XX_I2C_1,
64 .flags = IORESOURCE_IRQ,
65 },
60}; 66};
61 67
62static struct i2c_pnx_data i2c1_data = { 68static struct resource i2c1_resources[] = {
63 .name = I2C_CHIP_NAME "2", 69 [0] = {
64 .base = LPC32XX_I2C2_BASE, 70 .start = LPC32XX_I2C2_BASE,
65 .irq = IRQ_LPC32XX_I2C_2, 71 .end = LPC32XX_I2C2_BASE + 0x100 - 1,
72 .flags = IORESOURCE_MEM,
73 },
74 [1] = {
75 .start = IRQ_LPC32XX_I2C_2,
76 .end = IRQ_LPC32XX_I2C_2,
77 .flags = IORESOURCE_IRQ,
78 },
66}; 79};
67 80
68static struct i2c_pnx_data i2c2_data = { 81static struct resource i2c2_resources[] = {
69 .name = "USB-I2C", 82 [0] = {
70 .base = LPC32XX_OTG_I2C_BASE, 83 .start = LPC32XX_OTG_I2C_BASE,
71 .irq = IRQ_LPC32XX_USB_I2C, 84 .end = LPC32XX_OTG_I2C_BASE + 0x100 - 1,
85 .flags = IORESOURCE_MEM,
86 },
87 [1] = {
88 .start = IRQ_LPC32XX_USB_I2C,
89 .end = IRQ_LPC32XX_USB_I2C,
90 .flags = IORESOURCE_IRQ,
91 },
72}; 92};
73 93
74struct platform_device lpc32xx_i2c0_device = { 94struct platform_device lpc32xx_i2c0_device = {
75 .name = "pnx-i2c", 95 .name = "pnx-i2c.0",
76 .id = 0, 96 .id = 0,
77 .dev = { 97 .num_resources = ARRAY_SIZE(i2c0_resources),
78 .platform_data = &i2c0_data, 98 .resource = i2c0_resources,
79 },
80}; 99};
81 100
82struct platform_device lpc32xx_i2c1_device = { 101struct platform_device lpc32xx_i2c1_device = {
83 .name = "pnx-i2c", 102 .name = "pnx-i2c.1",
84 .id = 1, 103 .id = 1,
85 .dev = { 104 .num_resources = ARRAY_SIZE(i2c1_resources),
86 .platform_data = &i2c1_data, 105 .resource = i2c1_resources,
87 },
88}; 106};
89 107
90struct platform_device lpc32xx_i2c2_device = { 108struct platform_device lpc32xx_i2c2_device = {
91 .name = "pnx-i2c", 109 .name = "pnx-i2c.2",
92 .id = 2, 110 .id = 2,
93 .dev = { 111 .num_resources = ARRAY_SIZE(i2c2_resources),
94 .platform_data = &i2c2_data, 112 .resource = i2c2_resources,
95 },
96}; 113};
97 114
98/* TSC (Touch Screen Controller) */ 115/* TSC (Touch Screen Controller) */
diff --git a/arch/arm/mach-pnx4008/i2c.c b/arch/arm/mach-pnx4008/i2c.c
index 8103f9644e2d..550cfc2a1f2e 100644
--- a/arch/arm/mach-pnx4008/i2c.c
+++ b/arch/arm/mach-pnx4008/i2c.c
@@ -16,48 +16,62 @@
16#include <linux/err.h> 16#include <linux/err.h>
17#include <mach/platform.h> 17#include <mach/platform.h>
18#include <mach/irqs.h> 18#include <mach/irqs.h>
19#include <mach/i2c.h>
20 19
21static struct i2c_pnx_data i2c0_data = { 20static struct resource i2c0_resources[] = {
22 .name = I2C_CHIP_NAME "0", 21 {
23 .base = PNX4008_I2C1_BASE, 22 .start = PNX4008_I2C1_BASE,
24 .irq = I2C_1_INT, 23 .end = PNX4008_I2C1_BASE + SZ_4K - 1,
24 .flags = IORESOURCE_MEM,
25 }, {
26 .start = I2C_1_INT,
27 .end = I2C_1_INT,
28 .flags = IORESOURCE_IRQ,
29 },
25}; 30};
26 31
27static struct i2c_pnx_data i2c1_data = { 32static struct resource i2c1_resources[] = {
28 .name = I2C_CHIP_NAME "1", 33 {
29 .base = PNX4008_I2C2_BASE, 34 .start = PNX4008_I2C2_BASE,
30 .irq = I2C_2_INT, 35 .end = PNX4008_I2C2_BASE + SZ_4K - 1,
36 .flags = IORESOURCE_MEM,
37 }, {
38 .start = I2C_2_INT,
39 .end = I2C_2_INT,
40 .flags = IORESOURCE_IRQ,
41 },
31}; 42};
32 43
33static struct i2c_pnx_data i2c2_data = { 44static struct resource i2c2_resources[] = {
34 .name = "USB-I2C", 45 {
35 .base = (PNX4008_USB_CONFIG_BASE + 0x300), 46 .start = PNX4008_USB_CONFIG_BASE + 0x300,
36 .irq = USB_I2C_INT, 47 .end = PNX4008_USB_CONFIG_BASE + 0x300 + SZ_4K - 1,
48 .flags = IORESOURCE_MEM,
49 }, {
50 .start = USB_I2C_INT,
51 .end = USB_I2C_INT,
52 .flags = IORESOURCE_IRQ,
53 },
37}; 54};
38 55
39static struct platform_device i2c0_device = { 56static struct platform_device i2c0_device = {
40 .name = "pnx-i2c", 57 .name = "pnx-i2c.0",
41 .id = 0, 58 .id = 0,
42 .dev = { 59 .resource = i2c0_resources,
43 .platform_data = &i2c0_data, 60 .num_resources = ARRAY_SIZE(i2c0_resources),
44 },
45}; 61};
46 62
47static struct platform_device i2c1_device = { 63static struct platform_device i2c1_device = {
48 .name = "pnx-i2c", 64 .name = "pnx-i2c.1",
49 .id = 1, 65 .id = 1,
50 .dev = { 66 .resource = i2c1_resources,
51 .platform_data = &i2c1_data, 67 .num_resources = ARRAY_SIZE(i2c1_resources),
52 },
53}; 68};
54 69
55static struct platform_device i2c2_device = { 70static struct platform_device i2c2_device = {
56 .name = "pnx-i2c", 71 .name = "pnx-i2c.2",
57 .id = 2, 72 .id = 2,
58 .dev = { 73 .resource = i2c2_resources,
59 .platform_data = &i2c2_data, 74 .num_resources = ARRAY_SIZE(i2c2_resources),
60 },
61}; 75};
62 76
63static struct platform_device *devices[] __initdata = { 77static struct platform_device *devices[] __initdata = {