diff options
Diffstat (limited to 'arch/arm/mach-pxa/pcm990-baseboard.c')
-rw-r--r-- | arch/arm/mach-pxa/pcm990-baseboard.c | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c index 3dda16a20049..e6be9d0aeccf 100644 --- a/arch/arm/mach-pxa/pcm990-baseboard.c +++ b/arch/arm/mach-pxa/pcm990-baseboard.c | |||
@@ -23,8 +23,16 @@ | |||
23 | #include <linux/irq.h> | 23 | #include <linux/irq.h> |
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | #include <linux/ide.h> | 25 | #include <linux/ide.h> |
26 | #include <linux/i2c.h> | ||
27 | |||
28 | #include <media/soc_camera.h> | ||
29 | |||
30 | #include <asm/gpio.h> | ||
31 | #include <asm/arch/i2c.h> | ||
32 | #include <asm/arch/camera.h> | ||
26 | #include <asm/mach/map.h> | 33 | #include <asm/mach/map.h> |
27 | #include <asm/arch/pxa-regs.h> | 34 | #include <asm/arch/pxa-regs.h> |
35 | #include <asm/arch/pxa2xx-gpio.h> | ||
28 | #include <asm/arch/mmc.h> | 36 | #include <asm/arch/mmc.h> |
29 | #include <asm/arch/ohci.h> | 37 | #include <asm/arch/ohci.h> |
30 | #include <asm/arch/pcm990_baseboard.h> | 38 | #include <asm/arch/pcm990_baseboard.h> |
@@ -258,6 +266,76 @@ static struct pxaohci_platform_data pcm990_ohci_platform_data = { | |||
258 | }; | 266 | }; |
259 | 267 | ||
260 | /* | 268 | /* |
269 | * PXA27x Camera specific stuff | ||
270 | */ | ||
271 | #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE) | ||
272 | static int pcm990_pxacamera_init(struct device *dev) | ||
273 | { | ||
274 | pxa_gpio_mode(GPIO98_CIF_DD_0_MD); | ||
275 | pxa_gpio_mode(GPIO105_CIF_DD_1_MD); | ||
276 | pxa_gpio_mode(GPIO104_CIF_DD_2_MD); | ||
277 | pxa_gpio_mode(GPIO103_CIF_DD_3_MD); | ||
278 | pxa_gpio_mode(GPIO95_CIF_DD_4_MD); | ||
279 | pxa_gpio_mode(GPIO94_CIF_DD_5_MD); | ||
280 | pxa_gpio_mode(GPIO93_CIF_DD_6_MD); | ||
281 | pxa_gpio_mode(GPIO108_CIF_DD_7_MD); | ||
282 | pxa_gpio_mode(GPIO107_CIF_DD_8_MD); | ||
283 | pxa_gpio_mode(GPIO106_CIF_DD_9_MD); | ||
284 | pxa_gpio_mode(GPIO42_CIF_MCLK_MD); | ||
285 | pxa_gpio_mode(GPIO45_CIF_PCLK_MD); | ||
286 | pxa_gpio_mode(GPIO43_CIF_FV_MD); | ||
287 | pxa_gpio_mode(GPIO44_CIF_LV_MD); | ||
288 | |||
289 | return 0; | ||
290 | } | ||
291 | |||
292 | /* | ||
293 | * CICR4: PCLK_EN: Pixel clock is supplied by the sensor | ||
294 | * MCLK_EN: Master clock is generated by PXA | ||
295 | * PCP: Data sampled on the falling edge of pixel clock | ||
296 | */ | ||
297 | struct pxacamera_platform_data pcm990_pxacamera_platform_data = { | ||
298 | .init = pcm990_pxacamera_init, | ||
299 | .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 | | ||
300 | PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/, | ||
301 | .mclk_10khz = 1000, | ||
302 | }; | ||
303 | |||
304 | #include <linux/i2c/pca953x.h> | ||
305 | |||
306 | static struct pca953x_platform_data pca9536_data = { | ||
307 | .gpio_base = NR_BUILTIN_GPIO + 1, | ||
308 | }; | ||
309 | |||
310 | static struct soc_camera_link iclink[] = { | ||
311 | { | ||
312 | .bus_id = 0, /* Must match with the camera ID above */ | ||
313 | .gpio = NR_BUILTIN_GPIO + 1, | ||
314 | }, { | ||
315 | .bus_id = 0, /* Must match with the camera ID above */ | ||
316 | } | ||
317 | }; | ||
318 | |||
319 | /* Board I2C devices. */ | ||
320 | static struct i2c_board_info __initdata pcm990_i2c_devices[] = { | ||
321 | { | ||
322 | /* Must initialize before the camera(s) */ | ||
323 | I2C_BOARD_INFO("pca953x", 0x41), | ||
324 | .type = "pca9536", | ||
325 | .platform_data = &pca9536_data, | ||
326 | }, { | ||
327 | I2C_BOARD_INFO("mt9v022", 0x48), | ||
328 | .type = "mt9v022", | ||
329 | .platform_data = &iclink[0], /* With extender */ | ||
330 | }, { | ||
331 | I2C_BOARD_INFO("mt9m001", 0x5d), | ||
332 | .type = "mt9m001", | ||
333 | .platform_data = &iclink[0], /* With extender */ | ||
334 | }, | ||
335 | }; | ||
336 | #endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */ | ||
337 | |||
338 | /* | ||
261 | * AC97 support | 339 | * AC97 support |
262 | * Note: The connected AC97 mixer also reports interrupts at PCM990_AC97_IRQ | 340 | * Note: The connected AC97 mixer also reports interrupts at PCM990_AC97_IRQ |
263 | */ | 341 | */ |
@@ -326,5 +404,14 @@ void __init pcm990_baseboard_init(void) | |||
326 | /* USB host */ | 404 | /* USB host */ |
327 | pxa_set_ohci_info(&pcm990_ohci_platform_data); | 405 | pxa_set_ohci_info(&pcm990_ohci_platform_data); |
328 | 406 | ||
407 | pxa_set_i2c_info(NULL); | ||
408 | |||
409 | #if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE) | ||
410 | pxa_set_camera_info(&pcm990_pxacamera_platform_data); | ||
411 | |||
412 | i2c_register_board_info(0, pcm990_i2c_devices, | ||
413 | ARRAY_SIZE(pcm990_i2c_devices)); | ||
414 | #endif | ||
415 | |||
329 | printk(KERN_INFO"PCM-990 Evaluation baseboard initialized\n"); | 416 | printk(KERN_INFO"PCM-990 Evaluation baseboard initialized\n"); |
330 | } | 417 | } |