Skip to contentSkip to conversation

OMAP2: camera update

PATCH New Komal Shah 1 participant 1 message Apr 24, 2006

Subsystems (4)
lore
Share & tools
lore

Komal Shah

author
#0 lore raw

PATCH 1/1 OMAP2: camera update

Tony/David,

I have attached the camera patch which works with latest changes of v4l in 2.6.17-rc1.

Preview and capture works with H4.

- Added new map/unmap/dma_sync_sg functions.
- whitespace cleanups. Earlier patches had lot's of whitepsace problems.
- use video_get_drvdata(...)
- generic dma api names from pci ones.

Future plan:

- Better sysfs representation of sensor entry. So, that camera controls can take benefit of it.
- Add map/unmap/dma_sync_sg entries in camera_core.c
- Merge back omap24xxcamlib.c to omap24xxcam.c. Let's not think about multiplane support through videoout at all :)

This patch is just for review, and not for inclusion in tree. As I am not feeling well these days, I may not be able to reply on review comments for few days.

---Komal Shah
http://komalshah.blogspot.com/

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

arch/arm/mach-omap2/devices.c +35 -0
index fb7f91d..f189f2c 100644
@@ -25,6 +25,40 @@
 #include <asm/arch/mux.h>
 #include <asm/arch/gpio.h>
 
+
+/*-------------------------------------------------------------------------*/
+#if defined(CONFIG_VIDEO_OMAP_CAMERA) || defined(CONFIG_VIDEO_OMAP_CAMERA_MODULE)
+
+#define OMAP2_CAM_BASE		0x48052000
+#define OMAP2_CAM_MPU_IRQ	24
+
+static struct resource cam_resources[] = {
+	{
+		.start		= OMAP2_CAM_BASE,
+		.end		= OMAP2_CAM_BASE + 0xfff,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP2_CAM_MPU_IRQ,
+		.flags		= IORESOURCE_IRQ,
+	}
+};
+
+static struct platform_device omap_cam_device = {
+	.name		= "cam_omap",
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(cam_resources),
+	.resource	= cam_resources,
+};
+
+static inline void omap_init_camera(void)
+{
+	platform_device_register(&omap_cam_device);
+}
+#else
+static inline void omap_init_camera(void) {}
+#endif
+
 #if 	defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
 
 #define OMAP2_I2C_BASE2		0x48072000
@@ -112,6 +146,7 @@
 	/* please keep these calls, and their implementations above,
 	 * in alphabetical order so they're easier to sort through.
 	 */
+	omap_init_camera();
 	omap_init_i2c();
 	omap_init_sti();
 
drivers/media/video/omap/Makefile +2 -3
index 10987be..454b056 100644
@@ -3,9 +3,8 @@
 obj-$(CONFIG_VIDEO_OMAP_CAMERA) += omapcamera.o
 obj-$(CONFIG_VIDEO_CAMERA_SENSOR_OV9640) += sensor_ov9640.o
 
-objs-yy := camera_core.o
-
-objs-y$(CONFIG_ARCH_OMAP16XX) += omap16xxcam.o
+objs-y$(CONFIG_ARCH_OMAP16XX) += camera_core.o omap16xxcam.o
+objs-y$(CONFIG_ARCH_OMAP24XX) += omap24xxcam.o omap24xxlib.o
 objs-y$(CONFIG_MACH_OMAP_H3) += h3_sensor_power.o
 objs-y$(CONFIG_MACH_OMAP_H4) += h4_sensor_power.o
 
drivers/media/video/omap/camera_core.c +2 -2
index f5f916d..d605a47 100644
@@ -324,7 +324,7 @@
 camera_core_vbq_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
 {
 	videobuf_waiton(vb, 0, 0);
-	videobuf_dma_pci_unmap(NULL, &vb->dma);
+	videobuf_dma_unmap(NULL, &vb->dma);
 	videobuf_dma_free(&vb->dma);
 
 	vb->state = STATE_NEEDS_INIT;
@@ -1054,7 +1054,7 @@
 	cam->xclk = cam->cam_hardware->set_xclk(cam->xclk, cam->hardware_data);
 
 	/* initialize the sensor and define a default capture format cam->pix */
-	cam->sensor_data = cam->cam_sensor->init(&cam->pix);
+	cam->sensor_data = cam->cam_sensor->init(&cam->pix, &cam->pix2, pdev);
 	if (!cam->sensor_data) {
 		cam->cam_hardware->disable(cam->hardware_data);
 		printk(KERN_ERR CAM_NAME ": cannot initialize sensor\n");
drivers/media/video/omap/camera_core.h +1 -0
index 9ab336f..cffc263 100644
@@ -104,6 +104,7 @@
 	 * VIDIOC_S_FMT/VIDIOC_G_FMT ioctls with a CAPTURE buffer type.
 	 */
 	struct v4l2_pix_format pix;
+	struct v4l2_pix_format pix2;
 
 	/* crop defines the size and offset of the video overlay source window 
 	 * within the framebuffer.  These parameters are set/queried by the 
drivers/media/video/omap/omap24xxcam.c new file +2949 -0

2,919 lines not on this page · raw message

drivers/media/video/omap/omap24xxcam.h new file +870 -0

870 lines not on this page · raw message

drivers/media/video/omap/omap24xxlib.c new file +264 -0

264 lines not on this page · raw message

drivers/media/video/omap/omap24xxlib.h new file +39 -0
new file mode 100644
index 0000000..f778291

Lines of this file are not shown. View the raw message.

drivers/media/video/omap/sensor_if.h +46 -4

50 lines not on this page · raw message

drivers/media/video/omap/sensor_ov9640.c +38 -9

47 lines not on this page · raw message

drivers/media/video/video-buf.c +0 -0
drivers/media/video/vivi.c +0 -0
include/asm-arm/arch-omap/memory.h +1 -0
index df50dd5..9814ecd 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.