diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-12-19 08:32:14 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-08-14 06:40:52 -0400 |
commit | f420db843b7756e5d0d052b00472c94154f50c93 (patch) | |
tree | 67fa6c593055a95db57e2a561ae8191d0bf043df /arch/arm/mach-mx2 | |
parent | 88b05647171460b1d479371690876f8ac5957d42 (diff) |
MX2: Add SPI devices/resources
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx2')
-rw-r--r-- | arch/arm/mach-mx2/devices.c | 68 | ||||
-rw-r--r-- | arch/arm/mach-mx2/devices.h | 4 |
2 files changed, 72 insertions, 0 deletions
diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c index 4ecf0977beb4..62810cbe4e30 100644 --- a/arch/arm/mach-mx2/devices.c +++ b/arch/arm/mach-mx2/devices.c | |||
@@ -40,6 +40,74 @@ | |||
40 | #include "devices.h" | 40 | #include "devices.h" |
41 | 41 | ||
42 | /* | 42 | /* |
43 | * SPI master controller | ||
44 | * | ||
45 | * - i.MX1: 2 channel (slighly different register setting) | ||
46 | * - i.MX21: 2 channel | ||
47 | * - i.MX27: 3 channel | ||
48 | */ | ||
49 | static struct resource mxc_spi_resources0[] = { | ||
50 | { | ||
51 | .start = CSPI1_BASE_ADDR, | ||
52 | .end = CSPI1_BASE_ADDR + SZ_4K - 1, | ||
53 | .flags = IORESOURCE_MEM, | ||
54 | }, { | ||
55 | .start = MXC_INT_CSPI1, | ||
56 | .end = MXC_INT_CSPI1, | ||
57 | .flags = IORESOURCE_IRQ, | ||
58 | }, | ||
59 | }; | ||
60 | |||
61 | static struct resource mxc_spi_resources1[] = { | ||
62 | { | ||
63 | .start = CSPI2_BASE_ADDR, | ||
64 | .end = CSPI2_BASE_ADDR + SZ_4K - 1, | ||
65 | .flags = IORESOURCE_MEM, | ||
66 | }, { | ||
67 | .start = MXC_INT_CSPI2, | ||
68 | .end = MXC_INT_CSPI2, | ||
69 | .flags = IORESOURCE_IRQ, | ||
70 | }, | ||
71 | }; | ||
72 | |||
73 | #ifdef CONFIG_MACH_MX27 | ||
74 | static struct resource mxc_spi_resources2[] = { | ||
75 | { | ||
76 | .start = CSPI3_BASE_ADDR, | ||
77 | .end = CSPI3_BASE_ADDR + SZ_4K - 1, | ||
78 | .flags = IORESOURCE_MEM, | ||
79 | }, { | ||
80 | .start = MXC_INT_CSPI3, | ||
81 | .end = MXC_INT_CSPI3, | ||
82 | .flags = IORESOURCE_IRQ, | ||
83 | }, | ||
84 | }; | ||
85 | #endif | ||
86 | |||
87 | struct platform_device mxc_spi_device0 = { | ||
88 | .name = "spi_imx", | ||
89 | .id = 0, | ||
90 | .num_resources = ARRAY_SIZE(mxc_spi_resources0), | ||
91 | .resource = mxc_spi_resources0, | ||
92 | }; | ||
93 | |||
94 | struct platform_device mxc_spi_device1 = { | ||
95 | .name = "spi_imx", | ||
96 | .id = 1, | ||
97 | .num_resources = ARRAY_SIZE(mxc_spi_resources1), | ||
98 | .resource = mxc_spi_resources1, | ||
99 | }; | ||
100 | |||
101 | #ifdef CONFIG_MACH_MX27 | ||
102 | struct platform_device mxc_spi_device2 = { | ||
103 | .name = "spi_imx", | ||
104 | .id = 2, | ||
105 | .num_resources = ARRAY_SIZE(mxc_spi_resources2), | ||
106 | .resource = mxc_spi_resources2, | ||
107 | }; | ||
108 | #endif | ||
109 | |||
110 | /* | ||
43 | * General Purpose Timer | 111 | * General Purpose Timer |
44 | * - i.MX21: 3 timers | 112 | * - i.MX21: 3 timers |
45 | * - i.MX27: 6 timers | 113 | * - i.MX27: 6 timers |
diff --git a/arch/arm/mach-mx2/devices.h b/arch/arm/mach-mx2/devices.h index 6e91b4e3509d..d315406d6725 100644 --- a/arch/arm/mach-mx2/devices.h +++ b/arch/arm/mach-mx2/devices.h | |||
@@ -23,3 +23,7 @@ extern struct platform_device mxc_otg_udc_device; | |||
23 | extern struct platform_device mxc_otg_host; | 23 | extern struct platform_device mxc_otg_host; |
24 | extern struct platform_device mxc_usbh1; | 24 | extern struct platform_device mxc_usbh1; |
25 | extern struct platform_device mxc_usbh2; | 25 | extern struct platform_device mxc_usbh2; |
26 | extern struct platform_device mxc_spi_device0; | ||
27 | extern struct platform_device mxc_spi_device1; | ||
28 | extern struct platform_device mxc_spi_device2; | ||
29 | |||