98
98
WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name);
100
return IS_ERR(od) ? PTR_ERR(od) : 0;
102
102
postcore_initcall(omap4_l3_init);
104
104
#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
106
static struct resource cam_resources[] = {
106
static struct resource omap2cam_resources[] = {
108
108
.start = OMAP24XX_CAMERA_BASE,
109
109
.end = OMAP24XX_CAMERA_BASE + 0xfff,
118
static struct platform_device omap_cam_device = {
118
static struct platform_device omap2cam_device = {
119
119
.name = "omap24xxcam",
121
.num_resources = ARRAY_SIZE(cam_resources),
122
.resource = cam_resources,
121
.num_resources = ARRAY_SIZE(omap2cam_resources),
122
.resource = omap2cam_resources,
125
static inline void omap_init_camera(void)
127
platform_device_register(&omap_cam_device);
130
#elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
132
126
static struct resource omap3isp_resources[] = {
136
130
.flags = IORESOURCE_MEM,
139
.start = OMAP3430_ISP_CBUFF_BASE,
140
.end = OMAP3430_ISP_CBUFF_END,
141
.flags = IORESOURCE_MEM,
144
133
.start = OMAP3430_ISP_CCP2_BASE,
145
134
.end = OMAP3430_ISP_CCP2_END,
146
135
.flags = IORESOURCE_MEM,
176
165
.flags = IORESOURCE_MEM,
179
.start = OMAP3430_ISP_CSI2A_BASE,
180
.end = OMAP3430_ISP_CSI2A_END,
181
.flags = IORESOURCE_MEM,
184
.start = OMAP3430_ISP_CSI2PHY_BASE,
185
.end = OMAP3430_ISP_CSI2PHY_END,
168
.start = OMAP3430_ISP_CSI2A_REGS1_BASE,
169
.end = OMAP3430_ISP_CSI2A_REGS1_END,
170
.flags = IORESOURCE_MEM,
173
.start = OMAP3430_ISP_CSIPHY2_BASE,
174
.end = OMAP3430_ISP_CSIPHY2_END,
175
.flags = IORESOURCE_MEM,
178
.start = OMAP3630_ISP_CSI2A_REGS2_BASE,
179
.end = OMAP3630_ISP_CSI2A_REGS2_END,
180
.flags = IORESOURCE_MEM,
183
.start = OMAP3630_ISP_CSI2C_REGS1_BASE,
184
.end = OMAP3630_ISP_CSI2C_REGS1_END,
185
.flags = IORESOURCE_MEM,
188
.start = OMAP3630_ISP_CSIPHY1_BASE,
189
.end = OMAP3630_ISP_CSIPHY1_END,
190
.flags = IORESOURCE_MEM,
193
.start = OMAP3630_ISP_CSI2C_REGS2_BASE,
194
.end = OMAP3630_ISP_CSI2C_REGS2_END,
186
195
.flags = IORESOURCE_MEM,
198
207
.resource = omap3isp_resources,
201
static inline void omap_init_camera(void)
203
platform_device_register(&omap3isp_device);
206
static inline void omap_init_camera(void)
210
int omap3_init_camera(struct isp_platform_data *pdata)
212
omap3isp_device.dev.platform_data = pdata;
213
return platform_device_register(&omap3isp_device);
216
static inline void omap_init_camera(void)
218
#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
219
if (cpu_is_omap24xx())
220
platform_device_register(&omap2cam_device);
211
#ifdef CONFIG_ARCH_OMAP4 /* KEYBOARD */
213
224
struct omap_device_pm_latency omap_keyboard_latency[] = {
221
static int omap4_init_keypad(struct omap_hwmod *oh, void *user)
223
struct omap_device *od;
224
struct omap4_keypad_platform_data *sdp4430_keypad_data;
225
unsigned int id = -1;
226
char *name = "omap4-keypad";
228
sdp4430_keypad_data = user;
230
od = omap_device_build(name, id, oh, sdp4430_keypad_data,
231
sizeof(struct omap4_keypad_platform_data),
232
omap_keyboard_latency,
233
ARRAY_SIZE(omap_keyboard_latency), 0);
234
WARN(IS_ERR(od), "Could not build omap_device for %s %s\n",
241
#endif /* KEYBOARD CONFIG_ARCH_OMAP4 */
243
#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
245
#define MBOX_REG_SIZE 0x120
247
#ifdef CONFIG_ARCH_OMAP2
248
static struct resource omap2_mbox_resources[] = {
250
.start = OMAP24XX_MAILBOX_BASE,
251
.end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
252
.flags = IORESOURCE_MEM,
258
int __init omap4_keypad_initialization(struct omap4_keypad_platform_data
232
int __init omap4_keyboard_init(struct omap4_keypad_platform_data
259
233
*sdp4430_keypad_data)
261
235
struct omap_device *od;
279
253
ARRAY_SIZE(omap_keyboard_latency), 0);
281
255
if (IS_ERR(od)) {
282
WARN(1, "Cant build omap_device for %s:%s.\n",
256
WARN(1, "Can't build omap_device for %s:%s.\n",
284
258
return PTR_ERR(od);
290
//#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
264
#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
291
265
static struct omap_device_pm_latency mbox_latencies[] = {
293
267
.activate_func = omap_device_enable_hwmods,
432
406
od = omap_device_build(name, spi_num, oh, pdata,
433
407
sizeof(*pdata), omap_mcspi_latency,
434
408
ARRAY_SIZE(omap_mcspi_latency), 0);
435
WARN(IS_ERR(od), "Cant build omap_device for %s:%s\n",
409
WARN(IS_ERR(od), "Can't build omap_device for %s:%s\n",
732
706
static inline void omap_init_vout(void) {}
735
static struct omap_device_pm_latency omap_gpu_latency[] = {
737
.deactivate_func = omap_device_idle_hwmods,
738
.activate_func = omap_device_enable_hwmods,
739
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
743
static struct platform_device omap_omaplfb_device = {
749
static void omap_init_gpu(void)
751
struct omap_hwmod *oh;
752
struct omap_device *od;
753
int max_omap_gpu_hwmod_name_len = 16;
754
char oh_name[max_omap_gpu_hwmod_name_len];
756
struct gpu_platform_data *pdata;
757
char *name = "pvrsrvkm";
759
l = snprintf(oh_name, max_omap_gpu_hwmod_name_len,
761
WARN(l >= max_omap_gpu_hwmod_name_len,
762
"String buffer overflow in GPU device setup\n");
764
oh = omap_hwmod_lookup(oh_name);
767
pr_err("omap_init_gpu: Could not look up %s\n", oh_name);
771
pdata = kzalloc(sizeof(struct gpu_platform_data),
774
pr_err("omap_init_gpu: Platform data memory allocation failed\n");
778
pdata->device_enable = omap_device_enable;
779
pdata->device_idle = omap_device_idle;
780
pdata->device_shutdown = omap_device_shutdown;
782
od = omap_device_build(name, 0, oh, pdata,
783
sizeof(struct gpu_platform_data),
784
omap_gpu_latency, ARRAY_SIZE(omap_gpu_latency), 0);
785
WARN(IS_ERR(od), "Could not build omap_device for %s %s\n",
789
platform_device_register(&omap_omaplfb_device);
792
709
/*-------------------------------------------------------------------------*/
794
711
static int __init omap2_init_devices(void)
843
759
od = omap_device_build(dev_name, id, oh, NULL, 0,
844
760
omap_wdt_latency,
845
761
ARRAY_SIZE(omap_wdt_latency), 0);
846
WARN(IS_ERR(od), "Cant build omap_device for %s:%s.\n",
762
WARN(IS_ERR(od), "Can't build omap_device for %s:%s.\n",
847
763
dev_name, oh->name);