summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/ov7670.c
AgeCommit message (Collapse)Author
2009-03-18ov7670: add support to get/set registersHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Jonathan Corbet <corbet@lwn.net>
2009-03-18ov7670: cleanup and remove legacy code.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> v4l2-i2c-drv-legacy.h and ov7670_command are no longer needed after the cafe driver is converted to use v4l2_subdev. Rather than using a large ov7670_control array, just call the handlers via a simple switch and use v4l2_ctrl_query_fill() to handle queryctrl. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Jonathan Corbet <corbet@lwn.net>
2009-03-18ov7670: convert to v4l2_subdevHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Jonathan Corbet <corbet@lwn.net>
2009-03-10avoid loading the entire videodev.h header for drivers that are already V4L2 ↵Mauro Carvalho Chehab
only From: Mauro Carvalho Chehab <mchehab@redhat.com> Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07backport commit b305271861219f0ce162eb565f0f28f4c781299dMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Author: Jean Delvare <khali@linux-fr.org> i2c: Drop I2C_CLASS_CAM_DIGITAL There are a number of drivers which set their i2c bus class to I2C_CLASS_CAM_DIGITAL, however no chip driver actually checks for this flag, so we might as well drop it now. kernel-sync: Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30v4l2: debugging API changed to match against driver name instead of ID.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Since the i2c driver ID will be removed in the near future we have to modify the v4l2 debugging API to use the driver name instead of driver ID. Note that this API is not used in applications other than v4l2-dbg.cpp as it is for debugging and testing only. Should anyone use the old VIDIOC_G_CHIP_IDENT, then this will be logged with a warning that it is deprecated and will be removed in 2.6.30. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-17ov7670: fix compile warningsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-06-30OV7670: don't reject unsupported settingsMauro Carvalho Chehab
From: Daniel Drake <dsd@laptop.org> For VIDIOC_G_FMT/VIDIOC_TRY_FMT, the V4L2 API spec states: "Drivers should not return an error code unless the input is ambiguous" "Very simple, inflexible devices may even ignore all input and always return the default parameters." "When the requested buffer type is not supported drivers return an EINVAL error code." i.e. returning errors for unsupported fields is bad, and it's ok to unconditionally overwrite user-requested settings This patch makes ov7670 meet that behaviour, and brings it in line with other drivers e.g. stk-webcam. It also fixes compatibility with (unpatched) gstreamer. Signed-off-by: Daniel Drake <dsd@laptop.org> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-11ov7670: clean up ov7670_read semanticsMauro Carvalho Chehab
From: Andres Salomon <dilinger@queued.net> Cortland Setlow pointed out a bug in ov7670.c where the result from ov7670_read() was just being checked for !0, rather than <0. This made me realize that ov7670_read's semantics were rather confusing; it both fills in 'value' with the result, and returns it. This is goes against general kernel convention; so rather than fixing callers, let's fix the function. This makes ov7670_read return <0 in the case of an error, and 0 upon success. Thus, code like: res = ov7670_read(...); if (!res) goto error; ..will work properly. Signed-off-by: Cortland Setlow <csetlow@tower-research.com> Signed-off-by: Andres Salomon <dilinger@debian.org> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-08-21Cleanup: remove linux/moduleparam.h from drivers/media filesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Since at least kernel 2.6.12-rc2, module.h includes moduleparm.h. This patch removes all occurences of moduleparm.h from drivers/media files. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-08-17Get rid of an ill-behaved msleep in i2c writeMauro Carvalho Chehab
From: Jonathan Corbet <corbet@lwn.net> Configuring the OLPC camera requires something over 150 register writes. Unfortunately, querying the CAFE i2c controller too soon after a write causes the hardware to flake. The problem had been "solved" with an msleep() call, but, between the number of registers and how msleep() behaves, that resulted in a 3-second delay on camera initialization. Instead, we hand-code a wait for the completion interrupt which avoids reading the status registers. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-02Fix v4l-dvb backward compatibilityMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Due to several internal API changes on kernel, kernel backward compatibility were lost. Basically, compat.h should be the last include for it to work properly. This patch basically reorders kernel headers to allow backward compat to work fine. Also: Some includes were added after some non-include macros, on old drivers. Better to keep all includes at the beginning of the files. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-06-05Replace C code with calls to ARRAY_SIZE macro.Mauro Carvalho Chehab
From: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-05-22Ov7670: reset clkrc in rgb565 modeMauro Carvalho Chehab
From: Jonathan Corbet <corbet@lwn.net> A bug in the ov7670 sensor causes it to introduce noise unless the CLKRC register is rewritten *after* setting the image mode. Naturally, resetting CLKRC in this way will cause other modes to fail. So carefully poke the register only when indicated. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27Backport copyright changesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-03-256/7 Add raw bayer support to the ov7670 driverMauro Carvalho Chehab
From: Jonathan Corbet <corbet@lwn.net> Add raw bayer support to the ov7670 driver Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-03-255/7 Don't mirror ov7670 images by defaultMauro Carvalho Chehab
From: Jonathan Corbet <corbet@lwn.net> Don't mirror ov7670 images by default The ov7670 sensor driver sets the mirror bit by default, which is not the desired mode. OLPC has been running with this patch for a while. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-27Improve VIDIOC_G_CHIP_IDENT (better diagnostics)Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Simplify the VIDIOC_G_CHIP_IDENT implementation by adding a single common function. The ident can now also return NONE: not found, UNKNOWN: found, but we don't know what chip it is, and AMBIGUOUS: multiple chips were matched so the match values were too general. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-02-24Add support for VIDIOC_G_CHIP_IDENTHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> VIDIOC_G_CHIP_IDENT improves debugging of card problems: it can be used to detect which chips are on the board and based on that information selected register dumps can be made, making it easy to debug complicated media chips containing tens or hundreds of registers. This ioctl replaces the internal VIDIOC_INT_G_CHIP_IDENT ioctl. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> CC: Jonathan Corbet <corbet@lwn.net>
2006-12-27Backport some changes that happened at mainstreamMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Basic changes: - replaced i2c_bit_del_bus() to i2c_del_adapter(); - Fixed MODULE_AUTHOR on ov7670 - Updates on drivers not maintained on this tree: i2c-id.h and sound/* kernel-sync: drivers/media/dvb/pluto2/pluto2.c | 8 ++++---- drivers/media/video/bt8xx/bttv-i2c.c | 6 +----- drivers/media/video/cx88/cx88-core.c | 2 +- drivers/media/video/cx88/cx88-vp3054-i2c.c | 2 +- drivers/media/video/ov7670.c | 2 +- drivers/media/video/vino.c | 2 +- drivers/media/video/zoran_card.c | 2 +- include/linux/i2c-id.h | 18 ++++++------------ sound/pci/bt87x.c | 4 ++-- Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-01Add s/g_parm to cafe_ccicMauro Carvalho Chehab
From: Jonathan Corbet <corbet@lwn.net> Add s/g_parm support allowing applications to tweak the frame rate. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-01Remove the fake RGB32 format from cafe_ccicMauro Carvalho Chehab
From: Jonathan Corbet <corbet@lwn.net> Remove RGB32, useful for debugging, but with no place in production. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-11-19Updated camera driverMauro Carvalho Chehab
From: Jonathan Corbet <corbet@lwn.net> A couple of Cafe driver fixes, and support for the hue and saturation controls. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-11-04Whitespace cleanupsMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-11-04Make ov7670 and cafe_ccic compile at v4l-dvb treeMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Those driver are developed using some stuff from newer kernels. Maybe they may compile with kernels lower than 2.6.19, but upper than 2.6.16. Anyway,since the targeted OLPC hardware is not available yet, IMO, it doesn't make much sense to work on backporting the drivers to kernels lower than kernel 2.6.19. CC: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-11-04OmniVision OV7670 driverMauro Carvalho Chehab
From: Jonathan Corbet <corbet-v4l@lwn.net> This patch adds a V4L2 driver for the OmniVision OV7670 camera. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>