aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@pengutronix.de>2008-04-06 17:08:15 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 12:14:30 -0400
commit58762e77aec49aa4b43a9ff62e7a3aee17720c41 (patch)
tree5928579b1c198011a5adb8889a7fb66ad5b5b3ad /arch
parent3f3acefb63dc70d767f730045ab7ebaa81938d77 (diff)
[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 <g.liakhovetski@pengutronix.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c86
1 files changed, 86 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index 20b2974e3960..e6be9d0aeccf 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -23,6 +23,13 @@
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>
28#include <asm/arch/pxa2xx-gpio.h> 35#include <asm/arch/pxa2xx-gpio.h>
@@ -259,6 +266,76 @@ static struct pxaohci_platform_data pcm990_ohci_platform_data = {
259}; 266};
260 267
261/* 268/*
269 * PXA27x Camera specific stuff
270 */
271#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
272static 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 */
297struct 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
306static struct pca953x_platform_data pca9536_data = {
307 .gpio_base = NR_BUILTIN_GPIO + 1,
308};
309
310static 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. */
320static 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/*
262 * AC97 support 339 * AC97 support
263 * 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
264 */ 341 */
@@ -327,5 +404,14 @@ void __init pcm990_baseboard_init(void)
327 /* USB host */ 404 /* USB host */
328 pxa_set_ohci_info(&pcm990_ohci_platform_data); 405 pxa_set_ohci_info(&pcm990_ohci_platform_data);
329 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
330 printk(KERN_INFO"PCM-990 Evaluation baseboard initialized\n"); 416 printk(KERN_INFO"PCM-990 Evaluation baseboard initialized\n");
331} 417}