From: Guennadi Liakhovetski Date: Sun, 6 Apr 2008 21:08:15 +0000 (+0200) Subject: [ARM] pxa: Phycore pcm-990-specific code for the PXA270 Quick Capture driver X-Git-Tag: v2.6.26-rc1~1131^2~2^10 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58762e77aec49aa4b43a9ff62e7a3aee17720c41;p=linux-2.6 [ARM] pxa: Phycore pcm-990-specific code for the PXA270 Quick Capture driver Platform-specific code for Phytec's phyCORE-PXA270 platform Signed-off-by: Guennadi Liakhovetski Signed-off-by: Russell King --- diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c index 20b2974e39..e6be9d0aec 100644 --- a/arch/arm/mach-pxa/pcm990-baseboard.c +++ b/arch/arm/mach-pxa/pcm990-baseboard.c @@ -23,6 +23,13 @@ #include #include #include +#include + +#include + +#include +#include +#include #include #include #include @@ -258,6 +265,76 @@ static struct pxaohci_platform_data pcm990_ohci_platform_data = { .exit = NULL, }; +/* + * PXA27x Camera specific stuff + */ +#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE) +static int pcm990_pxacamera_init(struct device *dev) +{ + pxa_gpio_mode(GPIO98_CIF_DD_0_MD); + pxa_gpio_mode(GPIO105_CIF_DD_1_MD); + pxa_gpio_mode(GPIO104_CIF_DD_2_MD); + pxa_gpio_mode(GPIO103_CIF_DD_3_MD); + pxa_gpio_mode(GPIO95_CIF_DD_4_MD); + pxa_gpio_mode(GPIO94_CIF_DD_5_MD); + pxa_gpio_mode(GPIO93_CIF_DD_6_MD); + pxa_gpio_mode(GPIO108_CIF_DD_7_MD); + pxa_gpio_mode(GPIO107_CIF_DD_8_MD); + pxa_gpio_mode(GPIO106_CIF_DD_9_MD); + pxa_gpio_mode(GPIO42_CIF_MCLK_MD); + pxa_gpio_mode(GPIO45_CIF_PCLK_MD); + pxa_gpio_mode(GPIO43_CIF_FV_MD); + pxa_gpio_mode(GPIO44_CIF_LV_MD); + + return 0; +} + +/* + * CICR4: PCLK_EN: Pixel clock is supplied by the sensor + * MCLK_EN: Master clock is generated by PXA + * PCP: Data sampled on the falling edge of pixel clock + */ +struct pxacamera_platform_data pcm990_pxacamera_platform_data = { + .init = pcm990_pxacamera_init, + .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 | + PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/, + .mclk_10khz = 1000, +}; + +#include + +static struct pca953x_platform_data pca9536_data = { + .gpio_base = NR_BUILTIN_GPIO + 1, +}; + +static struct soc_camera_link iclink[] = { + { + .bus_id = 0, /* Must match with the camera ID above */ + .gpio = NR_BUILTIN_GPIO + 1, + }, { + .bus_id = 0, /* Must match with the camera ID above */ + } +}; + +/* Board I2C devices. */ +static struct i2c_board_info __initdata pcm990_i2c_devices[] = { + { + /* Must initialize before the camera(s) */ + I2C_BOARD_INFO("pca953x", 0x41), + .type = "pca9536", + .platform_data = &pca9536_data, + }, { + I2C_BOARD_INFO("mt9v022", 0x48), + .type = "mt9v022", + .platform_data = &iclink[0], /* With extender */ + }, { + I2C_BOARD_INFO("mt9m001", 0x5d), + .type = "mt9m001", + .platform_data = &iclink[0], /* With extender */ + }, +}; +#endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */ + /* * AC97 support * Note: The connected AC97 mixer also reports interrupts at PCM990_AC97_IRQ @@ -327,5 +404,14 @@ void __init pcm990_baseboard_init(void) /* USB host */ pxa_set_ohci_info(&pcm990_ohci_platform_data); + pxa_set_i2c_info(NULL); + +#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE) + pxa_set_camera_info(&pcm990_pxacamera_platform_data); + + i2c_register_board_info(0, pcm990_i2c_devices, + ARRAY_SIZE(pcm990_i2c_devices)); +#endif + printk(KERN_INFO"PCM-990 Evaluation baseboard initialized\n"); }