aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/devices.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r--arch/arm/mach-omap2/devices.c70
1 files changed, 42 insertions, 28 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 0d2d6a9c303c..7b8558564591 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -35,6 +35,7 @@
35 35
36#include "mux.h" 36#include "mux.h"
37#include "control.h" 37#include "control.h"
38#include "devices.h"
38 39
39#define L3_MODULES_MAX_LEN 12 40#define L3_MODULES_MAX_LEN 12
40#define L3_MODULES 3 41#define L3_MODULES 3
@@ -65,7 +66,7 @@ static int __init omap3_l3_init(void)
65 66
66 WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name); 67 WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name);
67 68
68 return PTR_ERR(od); 69 return IS_ERR(od) ? PTR_ERR(od) : 0;
69} 70}
70postcore_initcall(omap3_l3_init); 71postcore_initcall(omap3_l3_init);
71 72
@@ -102,7 +103,7 @@ postcore_initcall(omap4_l3_init);
102 103
103#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) 104#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
104 105
105static struct resource cam_resources[] = { 106static struct resource omap2cam_resources[] = {
106 { 107 {
107 .start = OMAP24XX_CAMERA_BASE, 108 .start = OMAP24XX_CAMERA_BASE,
108 .end = OMAP24XX_CAMERA_BASE + 0xfff, 109 .end = OMAP24XX_CAMERA_BASE + 0xfff,
@@ -114,19 +115,13 @@ static struct resource cam_resources[] = {
114 } 115 }
115}; 116};
116 117
117static struct platform_device omap_cam_device = { 118static struct platform_device omap2cam_device = {
118 .name = "omap24xxcam", 119 .name = "omap24xxcam",
119 .id = -1, 120 .id = -1,
120 .num_resources = ARRAY_SIZE(cam_resources), 121 .num_resources = ARRAY_SIZE(omap2cam_resources),
121 .resource = cam_resources, 122 .resource = omap2cam_resources,
122}; 123};
123 124#endif
124static inline void omap_init_camera(void)
125{
126 platform_device_register(&omap_cam_device);
127}
128
129#elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
130 125
131static struct resource omap3isp_resources[] = { 126static struct resource omap3isp_resources[] = {
132 { 127 {
@@ -135,11 +130,6 @@ static struct resource omap3isp_resources[] = {
135 .flags = IORESOURCE_MEM, 130 .flags = IORESOURCE_MEM,
136 }, 131 },
137 { 132 {
138 .start = OMAP3430_ISP_CBUFF_BASE,
139 .end = OMAP3430_ISP_CBUFF_END,
140 .flags = IORESOURCE_MEM,
141 },
142 {
143 .start = OMAP3430_ISP_CCP2_BASE, 133 .start = OMAP3430_ISP_CCP2_BASE,
144 .end = OMAP3430_ISP_CCP2_END, 134 .end = OMAP3430_ISP_CCP2_END,
145 .flags = IORESOURCE_MEM, 135 .flags = IORESOURCE_MEM,
@@ -175,13 +165,33 @@ static struct resource omap3isp_resources[] = {
175 .flags = IORESOURCE_MEM, 165 .flags = IORESOURCE_MEM,
176 }, 166 },
177 { 167 {
178 .start = OMAP3430_ISP_CSI2A_BASE, 168 .start = OMAP3430_ISP_CSI2A_REGS1_BASE,
179 .end = OMAP3430_ISP_CSI2A_END, 169 .end = OMAP3430_ISP_CSI2A_REGS1_END,
180 .flags = IORESOURCE_MEM, 170 .flags = IORESOURCE_MEM,
181 }, 171 },
182 { 172 {
183 .start = OMAP3430_ISP_CSI2PHY_BASE, 173 .start = OMAP3430_ISP_CSIPHY2_BASE,
184 .end = OMAP3430_ISP_CSI2PHY_END, 174 .end = OMAP3430_ISP_CSIPHY2_END,
175 .flags = IORESOURCE_MEM,
176 },
177 {
178 .start = OMAP3630_ISP_CSI2A_REGS2_BASE,
179 .end = OMAP3630_ISP_CSI2A_REGS2_END,
180 .flags = IORESOURCE_MEM,
181 },
182 {
183 .start = OMAP3630_ISP_CSI2C_REGS1_BASE,
184 .end = OMAP3630_ISP_CSI2C_REGS1_END,
185 .flags = IORESOURCE_MEM,
186 },
187 {
188 .start = OMAP3630_ISP_CSIPHY1_BASE,
189 .end = OMAP3630_ISP_CSIPHY1_END,
190 .flags = IORESOURCE_MEM,
191 },
192 {
193 .start = OMAP3630_ISP_CSI2C_REGS2_BASE,
194 .end = OMAP3630_ISP_CSI2C_REGS2_END,
185 .flags = IORESOURCE_MEM, 195 .flags = IORESOURCE_MEM,
186 }, 196 },
187 { 197 {
@@ -197,15 +207,19 @@ static struct platform_device omap3isp_device = {
197 .resource = omap3isp_resources, 207 .resource = omap3isp_resources,
198}; 208};
199 209
200static inline void omap_init_camera(void) 210int omap3_init_camera(struct isp_platform_data *pdata)
201{ 211{
202 platform_device_register(&omap3isp_device); 212 omap3isp_device.dev.platform_data = pdata;
213 return platform_device_register(&omap3isp_device);
203} 214}
204#else 215
205static inline void omap_init_camera(void) 216static inline void omap_init_camera(void)
206{ 217{
207} 218#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
219 if (cpu_is_omap24xx())
220 platform_device_register(&omap2cam_device);
208#endif 221#endif
222}
209 223
210struct omap_device_pm_latency omap_keyboard_latency[] = { 224struct omap_device_pm_latency omap_keyboard_latency[] = {
211 { 225 {
@@ -239,7 +253,7 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data
239 ARRAY_SIZE(omap_keyboard_latency), 0); 253 ARRAY_SIZE(omap_keyboard_latency), 0);
240 254
241 if (IS_ERR(od)) { 255 if (IS_ERR(od)) {
242 WARN(1, "Cant build omap_device for %s:%s.\n", 256 WARN(1, "Can't build omap_device for %s:%s.\n",
243 name, oh->name); 257 name, oh->name);
244 return PTR_ERR(od); 258 return PTR_ERR(od);
245 } 259 }
@@ -359,7 +373,7 @@ static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
359 od = omap_device_build(name, spi_num, oh, pdata, 373 od = omap_device_build(name, spi_num, oh, pdata,
360 sizeof(*pdata), omap_mcspi_latency, 374 sizeof(*pdata), omap_mcspi_latency,
361 ARRAY_SIZE(omap_mcspi_latency), 0); 375 ARRAY_SIZE(omap_mcspi_latency), 0);
362 WARN(IS_ERR(od), "Cant build omap_device for %s:%s\n", 376 WARN(IS_ERR(od), "Can't build omap_device for %s:%s\n",
363 name, oh->name); 377 name, oh->name);
364 kfree(pdata); 378 kfree(pdata);
365 return 0; 379 return 0;
@@ -711,7 +725,7 @@ static int __init omap_init_wdt(void)
711 od = omap_device_build(dev_name, id, oh, NULL, 0, 725 od = omap_device_build(dev_name, id, oh, NULL, 0,
712 omap_wdt_latency, 726 omap_wdt_latency,
713 ARRAY_SIZE(omap_wdt_latency), 0); 727 ARRAY_SIZE(omap_wdt_latency), 0);
714 WARN(IS_ERR(od), "Cant build omap_device for %s:%s.\n", 728 WARN(IS_ERR(od), "Can't build omap_device for %s:%s.\n",
715 dev_name, oh->name); 729 dev_name, oh->name);
716 return 0; 730 return 0;
717} 731}