From 024fafbac36b176d978ccd0fb1cae1fbc38c7fee Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Tue, 19 Oct 2010 21:32:11 -0300 Subject: [media] Add the via framebuffer camera controller driver Add a driver for the video capture port on VIA integrated chipsets. This version has a remaining OLPCism or two and expects to be talking to an ov7670; those can be improved as the need arises. This work was supported by the One Laptop Per Child project. Thanks to Laurent Pinchart for a number of useful comments. Cc: Florian Tobias Schandinat Signed-off-by: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab --- drivers/video/via/accel.c | 2 +- drivers/video/via/via-core.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/via/accel.c b/drivers/video/via/accel.c index e44893ea590d..04bec058569c 100644 --- a/drivers/video/via/accel.c +++ b/drivers/video/via/accel.c @@ -370,7 +370,7 @@ int viafb_init_engine(struct fb_info *info) viapar->shared->vq_vram_addr = viapar->fbmem_free; viapar->fbmem_used += VQ_SIZE; -#if defined(CONFIG_FB_VIA_CAMERA) || defined(CONFIG_FB_VIA_CAMERA_MODULE) +#if defined(CONFIG_VIDEO_VIA_CAMERA) || defined(CONFIG_VIDEO_VIA_CAMERA_MODULE) /* * Set aside a chunk of framebuffer memory for the camera * driver. Someday this driver probably needs a proper allocator diff --git a/drivers/video/via/via-core.c b/drivers/video/via/via-core.c index 66f403033111..27d7260d4f50 100644 --- a/drivers/video/via/via-core.c +++ b/drivers/video/via/via-core.c @@ -94,6 +94,13 @@ void viafb_irq_disable(u32 mask) EXPORT_SYMBOL_GPL(viafb_irq_disable); /* ---------------------------------------------------------------------- */ +/* + * Currently, the camera driver is the only user of the DMA code, so we + * only compile it in if the camera driver is being built. Chances are, + * most viafb systems will not need to have this extra code for a while. + * As soon as another user comes long, the ifdef can be removed. + */ +#if defined(CONFIG_VIDEO_VIA_CAMERA) || defined(CONFIG_VIDEO_VIA_CAMERA_MODULE) /* * Access to the DMA engine. This currently provides what the camera * driver needs (i.e. outgoing only) but is easily expandable if need @@ -322,7 +329,7 @@ int viafb_dma_copy_out_sg(unsigned int offset, struct scatterlist *sg, int nsg) return 0; } EXPORT_SYMBOL_GPL(viafb_dma_copy_out_sg); - +#endif /* CONFIG_VIDEO_VIA_CAMERA */ /* ---------------------------------------------------------------------- */ /* @@ -507,7 +514,12 @@ static struct viafb_subdev_info { }, { .name = "viafb-i2c", - } + }, +#if defined(CONFIG_VIDEO_VIA_CAMERA) || defined(CONFIG_VIDEO_VIA_CAMERA_MODULE) + { + .name = "viafb-camera", + }, +#endif }; #define N_SUBDEVS ARRAY_SIZE(viafb_subdevs) -- cgit v1.2.3