Skip to contentSkip to conversation

omap camera

PATCH In review David Cohen 3 participants 4 messages Feb 10, 2006 – Feb 11, 2006 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omap camera

Hi all,

I've updated the driver for OMAP 24xx camera from TI (kernel version 2.6.10). It is now working with the public omap tree.
Is there anybody else working with camera driver?
I don't think it is appropriate to use a common driver (camera_core) for the omap 2420 and 1611/1710. I guess creating a common driver for omap1 (current camera_core) and other for omap2 (an updated camera_core) could be better. Any comment?

BR,

David Cohen

drivers/media/video/Makefile +1 -1
index 93cfb54..5988ca3 100644
@@ -60,7 +60,7 @@ obj-$(CONFIG_VIDEO_BTCX)  += btcx-risc.o
 obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
 
 obj-$(CONFIG_VIDEO_M32R_AR_M64278) += arv.o
-obj-$(CONFIG_VIDEO_OMAP_CAMERA) += omap/
+obj-$(CONFIG_VIDEO_OMAP) += omap/
 
 obj-$(CONFIG_VIDEO_DECODER)     += saa7115.o cx25840/ saa7127.o
 
drivers/media/video/omap/Kconfig +6 -2
index 809193b..ecb7f53 100644
@@ -1,7 +1,11 @@
+config VIDEO_OMAP
+	tristate "Video devices for OMAP1/2"
+	select VIDEO_BUF
+	depends on VIDEO_DEV
+	
 config VIDEO_OMAP_CAMERA
 	tristate "OMAP Camera support (EXPERIMENTAL)"
-	select VIDEO_BUF
-	depends on VIDEO_DEV && (ARCH_OMAP16XX || ARCH_OMAP24XX)
+	depends on VIDEO_OMAP && (ARCH_OMAP16XX || ARCH_OMAP24XX)
 	help
 	  V4L2 camera driver support for OMAP1/2 based boards.
 	
drivers/media/video/omap/Makefile +5 -1
index c4c5a81..6c052ce 100644
@@ -2,12 +2,16 @@
 
 obj-$(CONFIG_VIDEO_OMAP_CAMERA) += omapcamera.o
 obj-$(CONFIG_VIDEO_CAMERA_SENSOR_OV9640) += sensor_ov9640.o
+obj-$(CONFIG_VIDEO_OMAP2_OUT) += omapvout.o
 
-objs-yy := camera_core.o
+objs-y$(CONFIG_ARCH_OMAP16XX) += camera_core.o
 
 objs-y$(CONFIG_ARCH_OMAP16XX) += omap16xxcam.o
+objs-y$(CONFIG_ARCH_OMAP24XX) += omap24xxcam.o
 objs-y$(CONFIG_MACH_OMAP_H3) += h3_sensor_power.o
+objs-$(CONFIG_ARCH_OMAP2)$(CONFIG_MACH_OMAP_H4) += omap24xxvout.o omap24xxlib.o
 
 omapcamera-objs := $(objs-yy)
+omapvout-objs := $(objs-yy)
 
 EXTRA_CFLAGS = -I$(src)/..
drivers/media/video/omap/omap24xxcam.c new file +2603 -0

2,603 lines not on this page · raw message

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

359 lines not on this page · raw message

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

269 lines not on this page · raw message

drivers/media/video/omap/omap24xxlib.h new file +34 -0
new file mode 100644
index 0000000..6c1f906

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

drivers/media/video/omap/sensor_if.h +42 -3

45 lines not on this page · raw message

include/asm-arm/arch-omap/irqs.h +1 -0
index 42098d9..4f47249 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.

#1 lore raw
Quoted 4 lines · David Cohen

I don't think it is appropriate to use a common driver (camera_core) for the omap 2420 and 1611/1710. I guess creating a common driver for omap1 (current camera_core) and other for omap2 (an updated camera_core) could be better. Any comment?

Perhaps you can explain a little more why you feel it's inappropriate for omap1 and omap2 to share the same camera_core?

Also, why is this driver doing its own scatter-gather processing rather than working with the DMA mapping API?

Plans for actually doing something wih the MMU?

#2 lore raw
Quoted 4 lines · --- Paul Mundt

Perhaps you can explain a little more why you feel it's inappropriate for
omap1 and omap2 to share the same camera_core?

You can look at the Jian's recent reply for the same thread, as well on the following thread.

http://linux.omap.com/pipermail/linux-omap-open-source/2005-November/005711.html

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

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

#3 lore raw
In reply to David Cohen

drivers/media/video/omap/omap24xxcam.c

Quoted 6 lines · --- David Cohen
drivers/media/video/omap/omap24xxcam.c new file +1 -0
new file mode 100644
index 0000000..8133804
 
+#include <asm/arch/display.h>

Where is this dispc library? It still needs discussion with Imre on how we can integrate video out driver.

drivers/media/video/omap/omap24xxcam.c line 98

Quoted 12 lines

*/

drivers/media/video/omap/omap24xxcam.c new file +11 -0
+#ifdef CONFIG_OMAP24XX_DPM
+#define omap24xxcam_suspend_lockout(s,f) \
+	if ((s)->suspended) {\
+		if ((f)->f_flags & O_NONBLOCK)\
+			return -EBUSY;\
+		wait_event_interruptible((s)->suspend_wq,\
+					(s)->suspended == 0);\
+	}
+#else
+#define omap24xxcam_suspend_lockout(s, f) do {} while(0)
+#endif

You may want to remove this for a while, until we come up with PM support for OMAP2.

drivers/media/video/omap/omap24xxcam.c line 128

Quoted 3 lines
drivers/media/video/omap/omap24xxcam.c new file +3 -0
+		/* always use the rising edger to trigger the acquisition
+		   in NOBT modes. This is recommended */
+		cam->cc_ctrl |= CC_CTRL_NOBT_SYNCHRO;

s/edger/edge

drivers/media/video/omap/omap24xxcam.c line 1418

Quoted 4 lines
drivers/media/video/omap/omap24xxcam.c new file +4 -0
+					omap2_disp_get_panel_size(
+					 omap2_disp_get_output_dev(cam->vid_preview),
+				  	 &(cam->fbuf.fmt.width),
+				  	 &(cam->fbuf.fmt.height));

Hmm...This patch doesn't have these functions.

drivers/media/video/omap/omap24xxcam.c line 1418

Quoted 8 lines
drivers/media/video/omap/omap24xxcam.c new file +8 -0
+					/* Get the panel parameters.
+					 * They can change from LCD to TV
+					 * or TV to LCD
+					 */
+					omap2_disp_get_panel_size(
+					 omap2_disp_get_output_dev(cam->vid_preview),
+				  	 &(cam->fbuf.fmt.width),
+				  	 &(cam->fbuf.fmt.height));

Ditto...

Quoted 7 lines
drivers/media/video/omap/omap24xxcam.c new file +7 -0
+					omap2_disp_get_dss();
+
+					/* Turn on the overlay window */
+					omap2_disp_config_vlayer(cam->
+								 vid_preview,
+								 &cam->pix,
+								 &cam->crop,

drivers/media/video/omap/omap24xxcam.c line 1760

Quoted 10 lines
drivers/media/video/omap/omap24xxcam.c new file +10 -0
+								 &cam->win, -1,
+								 0);
+					omap2_disp_start_vlayer(cam->
+								vid_preview,
+								&cam->pix,
+								&cam->crop,
+								cam->
+								overlay_base_phys,
+								-1, 0);
+					cam->previewing = fh;

Ditto..And all other places where you have dispc library dependancy. My suggestion is to leave those code references right now, and to have camera code working with file dump or previewing through fb driver, which can be handled then in user space application until we sort out video out driver integration. But it can be further delayed if we don't like OMAP2 dipsc hardware based color-space conversion, overlays ...and don't want to use it completely :)

drivers/media/video/omap/omap24xxcam.c

Quoted 4 lines
drivers/media/video/omap/omap24xxcam.c new file +1 -0
+	/* These are for power management */
 	int (*power_on)(void *);
 	int (*power_off)(void *);

You might want to add power functions through GPIO expander for H4 EVM.

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

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