openwrt/staging/blogic.git
13 years ago[media] v4l2-ctrls: always send an event if a control changed implicitly
Hans Verkuil [Tue, 5 Jul 2011 10:09:26 +0000 (07:09 -0300)]
[media] v4l2-ctrls: always send an event if a control changed implicitly

By default no control events are sent to the application that caused the
control value or flags change (i.e. the control(s) passed to VIDIOC_S_CTRL
or VIDIOC_S_EXT_CTRLS). But if a change in one control causes a change in
another control that was not part of the control(s) in VIDIOC_S_CTRL or
S_EXT_CTRLS, then the application should be notified.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls.c: copy-and-paste error: user_to_new -> new_to_user
Hans Verkuil [Tue, 5 Jul 2011 09:56:37 +0000 (06:56 -0300)]
[media] v4l2-ctrls.c: copy-and-paste error: user_to_new -> new_to_user

The new values were never copied to userspace due to this copy and paste
error. This was introduced during the rewrite of this part of the code in
commit 3219f8a362640b7e4b7e2187b1094c4e46d85aa0.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: clean-up header files
Hans de Goede [Sun, 3 Jul 2011 19:26:52 +0000 (16:26 -0300)]
[media] pwc: clean-up header files

Remove unused pwc-ioctl.h (the copy in include/media is used everywhere)
Remove almost empty pwc-uncompress.h, move single define to pwc.h

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: Enable power-management by default on tested models
Hans de Goede [Sun, 3 Jul 2011 18:52:54 +0000 (15:52 -0300)]
[media] pwc: Enable power-management by default on tested models

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: Add a bunch of pwc custom API to feature-removal-schedule.txt
Hans de Goede [Sun, 3 Jul 2011 18:02:10 +0000 (15:02 -0300)]
[media] pwc: Add a bunch of pwc custom API to feature-removal-schedule.txt

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: Add v4l2 controls for pan/tilt on Logitech QuickCam Orbit/Sphere
Hans de Goede [Sun, 3 Jul 2011 15:23:24 +0000 (12:23 -0300)]
[media] pwc: Add v4l2 controls for pan/tilt on Logitech QuickCam Orbit/Sphere

This makes the API for this:
1) v4l2 spec compliant
2) match that of the UVC Logitech QuickCam Sphere models

For now this operates in parellel to the sysfs interface for this, but the
intend is to deprecate the sysfs interface and remove it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: Allow dqbuf / read to complete while waiting for controls
Hans de Goede [Sun, 3 Jul 2011 14:50:51 +0000 (11:50 -0300)]
[media] pwc: Allow dqbuf / read to complete while waiting for controls

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: Replace control code with v4l2-ctrls framework
Hans de Goede [Sun, 26 Jun 2011 15:52:01 +0000 (12:52 -0300)]
[media] pwc: Replace control code with v4l2-ctrls framework

Also remove all the converting from native range to 0-65535 and back
that was going on. This is no longer needed now that we no longer support
v4l1.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: properly allocate dma-able memory for ISO buffers
Hans de Goede [Sun, 26 Jun 2011 16:57:15 +0000 (13:57 -0300)]
[media] pwc: properly allocate dma-able memory for ISO buffers

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: Allow multiple opens
Hans de Goede [Sun, 26 Jun 2011 15:13:44 +0000 (12:13 -0300)]
[media] pwc: Allow multiple opens

Allow multiple opens of the /dev/video node so that control panel apps
can be open to-gether with streaming apps.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: Move various initialization to driver load and / or stream start
Hans de Goede [Sun, 26 Jun 2011 09:49:59 +0000 (06:49 -0300)]
[media] pwc: Move various initialization to driver load and / or stream start

Doing a bunch of initialization every time /dev/video is opened, and thus
for example when the udev rules probe for capabilities makes no sense,
do it at driver load, resp. stream start instead.

This is a preparation patch for allowing multiple opens of the /dev/video
node.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: Make power-saving a per device option
Hans de Goede [Sun, 26 Jun 2011 06:51:19 +0000 (03:51 -0300)]
[media] pwc: Make power-saving a per device option

  as vcinterface must be set before calling pwc_camera_power()

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: Remove some unused PWC_INT_PIPE left overs
Hans de Goede [Sat, 25 Jun 2011 20:42:55 +0000 (17:42 -0300)]
[media] pwc: Remove some unused PWC_INT_PIPE left overs

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: Get rid of error_status and unplugged variables
Hans de Goede [Sat, 25 Jun 2011 20:39:19 +0000 (17:39 -0300)]
[media] pwc: Get rid of error_status and unplugged variables

Having 2 ways of tracking disconnection is too much, remove both and
instead simply set pdev->udev to NULL on disconnect. Also check for
pdev->udev being NULL in all possible entry paths.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: Fix non CodingStyle compliant 3 space indent in pwc.h
Hans de Goede [Sat, 25 Jun 2011 20:10:51 +0000 (17:10 -0300)]
[media] pwc: Fix non CodingStyle compliant 3 space indent in pwc.h

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: Replace private buffer management code with videobuf2
Hans de Goede [Mon, 6 Jun 2011 18:33:44 +0000 (15:33 -0300)]
[media] pwc: Replace private buffer management code with videobuf2

Looking at the pwc buffer management code has made it clear to me it needed
some serious fixing. Not only was there a ton of code duplication even
internally to pwc (read and mmap wait for frame code was duplicated), the
code also was outright buggy. With the worst offender being dqbuf, which
just round robin returned all the mmap buffers, without paying any attention
to them being queued by the app with qbuf or not. And qbuf itself was a noop.

So I set out to fix this and already had some cleanups in place when
I read Jonathan Corbet's lwn article on videobuf2, this inspired me to just
rip out the buffer management code and replace it with videobuf2, greatly
reducing the amount of code, and fixing all bugs in one go:

Many thanks to Jonathan for the timely article on this !

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: remove __cplusplus guards from private header
Hans de Goede [Mon, 6 Jun 2011 18:35:54 +0000 (15:35 -0300)]
[media] pwc: remove __cplusplus guards from private header

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] pwc: Remove a bunch of bogus sanity checks / don't return EFAULT wrongly
Hans de Goede [Mon, 6 Jun 2011 18:25:18 +0000 (15:25 -0300)]
[media] pwc: Remove a bunch of bogus sanity checks / don't return EFAULT wrongly

The chances if any of these becoming NULL magically are 0% And if they
do become NULL oopsing is the right thing to do (so that the user logs a
bug with the kernel rather then with whatever app he was using).

Returning EFAULT to userspace should only be done when userspace supplies
a bad address, not on driver bugs / hw issues, so in the few cases where the
check is not bogus return something else.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] gspca: s/strncpy/strlcpy/
Hans de Goede [Sun, 5 Jun 2011 17:58:46 +0000 (14:58 -0300)]
[media] gspca: s/strncpy/strlcpy/

Just like in userspace strncpy does not guarantee 0 termination. Use strlcpy
instead which does guarantee 0 termination.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] gspca_sunplus: Fix streaming on logitech quicksmart 420
Hans de Goede [Tue, 17 May 2011 12:34:23 +0000 (09:34 -0300)]
[media] gspca_sunplus: Fix streaming on logitech quicksmart 420

Don't issue a stream stop to the camera at the end of sd_start, this fixes
streaming with this particular model.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] gspca: Add new se401 camera driver
Hans de Goede [Sun, 5 Jun 2011 10:44:34 +0000 (07:44 -0300)]
[media] gspca: Add new se401 camera driver

Based on the old v4l1 camera by Jeroen Vreeken driver which recently got
removed from the kernel.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] gspca: reset image_len to 0 on LAST_PACKET when discarding frame
Hans de Goede [Sun, 5 Jun 2011 06:44:43 +0000 (03:44 -0300)]
[media] gspca: reset image_len to 0 on LAST_PACKET when discarding frame

Reset image and image_len to NULL/0 on LAST_PACKET when we're in discard
frame mode, just like we do when not discarding the current frame.

The new se401 driver uses image_len for SOF/EOF detection and thus depends on
this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] videodev2.h Add SE401 compressed RGB format
Hans de Goede [Sun, 5 Jun 2011 11:32:27 +0000 (08:32 -0300)]
[media] videodev2.h Add SE401 compressed RGB format

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] gspca - ov519: Fix a LED inversion
Jean-François Moine [Sun, 3 Jul 2011 08:24:05 +0000 (05:24 -0300)]
[media] gspca - ov519: Fix a LED inversion

In the webcam 041e:405f, the LED is inverted.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] gspca - ov519: Fix sensor detection problems
Jean-François Moine [Sun, 3 Jul 2011 08:17:27 +0000 (05:17 -0300)]
[media] gspca - ov519: Fix sensor detection problems

The sensor of some webcams could not be detected due to timing problems
in sensor register reading. This patch adds bridge register readings
before sensor register reading.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] firedtv: change some -EFAULT returns to more fitting error codes
Stefan Richter [Wed, 6 Jul 2011 18:54:48 +0000 (15:54 -0300)]
[media] firedtv: change some -EFAULT returns to more fitting error codes

Mauro Carvalho Chehab wrote:
> I'm validating if all drivers are behaving equally with respect to the
> error codes returned to userspace, and double-checking with the API.
>
> On almost all places, -EFAULT code is used only to indicate when
> copy_from_user/copy_to_user fails. However, firedtv uses a lot of
> -EFAULT, where it seems to me that other error codes should be used
> instead (like -EIO for bus transfer errors and -EINVAL/-ERANGE for
> invalid/out of range parameters).

This concerns only the CI (CAM) related code of firedtv of which I know
little.  Let's just pass through the error returns of lower level I/O
code where applicable, and -EACCES (permission denied) when a seemingly
valid but negative FCP response or an unknown-to-firedtv CA message is
received.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Henrik Kurelid <henrik@kurelid.se>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] return -ENOTTY for unsupported ioctl's at legacy drivers
Mauro Carvalho Chehab [Sun, 26 Jun 2011 13:18:03 +0000 (10:18 -0300)]
[media] return -ENOTTY for unsupported ioctl's at legacy drivers

Those drivers are not relying at the V4L2 core to handle the ioctl's.
So, we need to manually patch them every time a change goes to the
core.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-By: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2 core: return -ENOTTY if an ioctl doesn't exist
Mauro Carvalho Chehab [Wed, 6 Jul 2011 17:08:08 +0000 (14:08 -0300)]
[media] v4l2 core: return -ENOTTY if an ioctl doesn't exist

Currently, -EINVAL is used to return either when an IOCTL is not
implemented, or if the ioctl was not implemented.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook/dvb: Use generic descriptions for the video API
Mauro Carvalho Chehab [Wed, 6 Jul 2011 16:51:51 +0000 (13:51 -0300)]
[media] DocBook/dvb: Use generic descriptions for the video API

While here, removes the bogus EINTERNAL error codes.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook/dvb: Use generic descriptions for the frontend API
Mauro Carvalho Chehab [Wed, 6 Jul 2011 16:42:08 +0000 (13:42 -0300)]
[media] DocBook/dvb: Use generic descriptions for the frontend API

Move generic stuff into gen-errors.xml, and remove them from
DVB API. While here, removes two bogus error codes that aren't
supported or used on Linux: EINTERNAL and ENOSIGNAL.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] dvb-bt8xx: Don't return -EFAULT when a device is not found
Mauro Carvalho Chehab [Wed, 6 Jul 2011 12:05:41 +0000 (09:05 -0300)]
[media] dvb-bt8xx: Don't return -EFAULT when a device is not found

When a device (or their PCI structs) are not found, the error should
be -ENODEV. -EFAULT is reserved for errors while copying arguments
from/to userspace.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook/demux.xml: Remove generic errors
Mauro Carvalho Chehab [Tue, 5 Jul 2011 16:39:38 +0000 (13:39 -0300)]
[media] DocBook/demux.xml: Remove generic errors

Remove generic errors from ioctl() descriptions. For other ioctl's,
there's no generic section. So, just keep whatever is there.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook/audio.xml: Remove generic errors
Mauro Carvalho Chehab [Tue, 5 Jul 2011 16:18:15 +0000 (13:18 -0300)]
[media] DocBook/audio.xml: Remove generic errors

Remove generic errors from ioctl() descriptions. For other ioctl's,
there's no generic section. So, just keep whatever is there.
Also remove the EINTERNAL error code, as no DVB driver returns
it, and this error code is not defined on POSIX or on Linux.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DVB: Point to the generic error chapter
Mauro Carvalho Chehab [Tue, 5 Jul 2011 15:36:01 +0000 (12:36 -0300)]
[media] DVB: Point to the generic error chapter

Just like the V4L, MC and LIRC API's, point to the generic error
chapter for ioctl's. This will allow moving generic error codes
to just one place inside all media API's.

A latter patch will remove the generic errors from each specific
ioctl.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] nxt6000: i2c bus error should return -EIO
Mauro Carvalho Chehab [Wed, 6 Jul 2011 15:41:21 +0000 (12:41 -0300)]
[media] nxt6000: i2c bus error should return -EIO

data from/to userspace. Don't mix it with I2C bus error (-EIO).

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] siano: bad parameter is -EINVAL and not -EFAULT
Mauro Carvalho Chehab [Wed, 6 Jul 2011 15:55:29 +0000 (12:55 -0300)]
[media] siano: bad parameter is -EINVAL and not -EFAULT

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook: Add return error codes to LIRC ioctl session
Mauro Carvalho Chehab [Tue, 5 Jul 2011 15:07:54 +0000 (12:07 -0300)]
[media] DocBook: Add return error codes to LIRC ioctl session

Add a reference for the generic error code chapter to LIRC ioctl
description.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook: Add an error code session for LIRC interface
Mauro Carvalho Chehab [Tue, 5 Jul 2011 15:02:12 +0000 (12:02 -0300)]
[media] DocBook: Add an error code session for LIRC interface

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook: Remove V4L generic error description for ioctl()
Mauro Carvalho Chehab [Tue, 5 Jul 2011 14:57:05 +0000 (11:57 -0300)]
[media] DocBook: Remove V4L generic error description for ioctl()

V4L ioctl function descripton also has a generic error chapter.
Remove it, as it is now obsoleted by a general, multi-API generic
error descriptions.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook/media-ioc-setup-link.xml: Remove EBUSY
Mauro Carvalho Chehab [Tue, 5 Jul 2011 14:39:53 +0000 (11:39 -0300)]
[media] DocBook/media-ioc-setup-link.xml: Remove EBUSY

The EBUSY is already described as a generic error condition, with a
similar text.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook: Use the generic error code page also for MC API
Mauro Carvalho Chehab [Tue, 5 Jul 2011 14:37:58 +0000 (11:37 -0300)]
[media] DocBook: Use the generic error code page also for MC API

Instead of having their own generic error codes at the MC API, move
its section to the generic one and be sure that all media ioctl's
will point to it.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook: Use the generic ioctl error codes for all V4L ioctl's
Mauro Carvalho Chehab [Tue, 5 Jul 2011 14:22:28 +0000 (11:22 -0300)]
[media] DocBook: Use the generic ioctl error codes for all V4L ioctl's

Be sure that all VIDIOC_* ioctl are using the return error macro, and
aren't specifying generic error codes internally.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook: Add a chapter to describe media errors
Mauro Carvalho Chehab [Tue, 5 Jul 2011 13:07:37 +0000 (10:07 -0300)]
[media] DocBook: Add a chapter to describe media errors

There are several errors reported by V4L that aren't described.
They can occur on almost all ioctl's. Instead of adding them
into each ioctl, create a new chapter.

For V4L, the new chapter will automatically be listed on all
places, as there's a macro used everywhere there.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] marvell-cam: use S/G DMA by default
Jonathan Corbet [Thu, 30 Jun 2011 20:05:28 +0000 (17:05 -0300)]
[media] marvell-cam: use S/G DMA by default

Scatter/gather DMA mode works nicely on this platform and is clearly the
best way of doing things.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] marvell-cam: Working s/g DMA
Jonathan Corbet [Thu, 30 Jun 2011 20:05:27 +0000 (17:05 -0300)]
[media] marvell-cam: Working s/g DMA

The core Marvell camera driver can now do scatter/gather DMA on controllers
which support that functionality.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls.c: add support for V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK
Hans Verkuil [Wed, 29 Jun 2011 11:56:22 +0000 (08:56 -0300)]
[media] v4l2-ctrls.c: add support for V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK

Normally no control events will go to the filehandle that called the
VIDIOC_S_CTRL/VIDIOC_S_EXT_CTRLS ioctls. This is to prevent a feedback
loop.

This can now be overridden by setting the new V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK
flag.

Based on suggestions from Mauro Carvalho Chehab <mchehab@redhat.com> and
Laurent Pinchart <laurent.pinchart@ideasonboard.com>.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-event.h: add overview documentation to the header
Hans Verkuil [Mon, 20 Jun 2011 15:00:36 +0000 (12:00 -0300)]
[media] v4l2-event.h: add overview documentation to the header

It's getting confusing who is linking to what, so add an overview at
the start of the header.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls/v4l2-events: small coding style cleanups
Hans Verkuil [Mon, 20 Jun 2011 14:56:24 +0000 (11:56 -0300)]
[media] v4l2-ctrls/v4l2-events: small coding style cleanups

Thanks to Laurent Pinchart <laurent.pinchart@ideasonboard.com>.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook: update V4L Event Interface section
Hans Verkuil [Sat, 18 Jun 2011 09:58:29 +0000 (06:58 -0300)]
[media] DocBook: update V4L Event Interface section

Starting with v3.1 the V4L2 API provides certain guarantees with respect to
events. Document these.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-framework.txt: update v4l2_event section
Hans Verkuil [Sat, 18 Jun 2011 09:14:42 +0000 (06:14 -0300)]
[media] v4l2-framework.txt: update v4l2_event section

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-framework.txt: updated v4l2_fh_init documentation
Hans Verkuil [Sat, 18 Jun 2011 08:13:55 +0000 (05:13 -0300)]
[media] v4l2-framework.txt: updated v4l2_fh_init documentation

v4l2_fh_init now returns void instead of int, updated the doc.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: v4l2_ctrl_handler_setup code simplification
Hans Verkuil [Tue, 14 Jun 2011 14:01:52 +0000 (11:01 -0300)]
[media] v4l2-ctrls: v4l2_ctrl_handler_setup code simplification

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: split try_or_set_ext_ctrls()
Hans Verkuil [Tue, 14 Jun 2011 13:56:42 +0000 (10:56 -0300)]
[media] v4l2-ctrls: split try_or_set_ext_ctrls()

Split try_or_set_ext_ctrls() into a validate_ctrls() part ('Phase 1')
and merge the second part ('Phase 2') into try_set_ext_ctrls().

This makes a lot more sense and it also does the validation before
trying to try/set the controls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: improve discovery of controls of the same cluster
Hans Verkuil [Tue, 14 Jun 2011 13:04:06 +0000 (10:04 -0300)]
[media] v4l2-ctrls: improve discovery of controls of the same cluster

The implementation of VIDIOC_G/S/TRY_EXT_CTRLS in the control framework has
to figure out which controls in the control list belong to the same cluster.
Since controls belonging to the same cluster need to be handled as a unit,
this is important information.

It did that by going over the controls in the list and for each control that
belonged to a multi-control cluster it would walk the remainder of the list
to try and find controls that belong to that same cluster.

This approach has two disadvantages:

1) it was a potentially quadratic algorithm (although highly unlikely that
it would ever be that bad in practice).
2) it took place with the control handler's lock held.

Since we want to make it possible in the future to change control values
from interrupt context, doing a lot of work while holding a lock is not a
good idea.

In the new code the algorithm is no longer quadratic but linear in the
number of controls in the list. Also, it now can be done beforehand.

Another change that was made was to so the try and set at the same time.
Before when S_TRY_EXT_CTRLS was called it would 'try' the controls first,
and then it would 'set' them. The idea was that any 'try' errors would
prevent the 'set' from happening, thus avoiding having partially set
control lists.

However, this caused more problems than it solved because between the 'try'
and the 'set' changes might have happened, so it had to try a second time,
and since actual controls with a try_ctrl op are very rare (and those that
we have just adjust values and do not return an error), I've decided to
drop that two-stage approach and just combine try and set.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: don't initially set CH_VALUE for write-only controls
Hans Verkuil [Tue, 14 Jun 2011 05:42:45 +0000 (02:42 -0300)]
[media] v4l2-ctrls: don't initially set CH_VALUE for write-only controls

When sending the SEND_INITIAL event for write-only controls the
V4L2_EVENT_CTRL_CH_VALUE flag should not be set. It's meaningless.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-event: add optional merge and replace callbacks
Hans Verkuil [Sat, 18 Jun 2011 10:02:20 +0000 (07:02 -0300)]
[media] v4l2-event: add optional merge and replace callbacks

When the event queue for a subscribed event is full, then the oldest
event is dropped. It would be nice if the contents of that oldest
event could be merged with the next-oldest. That way no information is
lost, only intermediate steps are lost.

This patch adds optional replace() (called when only one kevent was allocated)
and merge() (called when more than one kevent was allocated) callbacks that
will be called to do this job.

These two callbacks are implemented for the V4L2_EVENT_CTRL event.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-event/ctrls/fh: allocate events per fh and per type instead of just...
Hans Verkuil [Mon, 13 Jun 2011 22:24:17 +0000 (19:24 -0300)]
[media] v4l2-event/ctrls/fh: allocate events per fh and per type instead of just per-fh

The driver had to decide how many events to allocate when the v4l2_fh struct
was created. It was possible to add more events afterwards, but there was no
way to ensure that you wouldn't miss important events if the event queue
would fill up for that filehandle.

In addition, once there were no more free events, any new events were simply
dropped on the floor.

For the control event in particular this made life very difficult since
control status/value changes could just be missed if the number of allocated
events and the speed at which the application read events was too low to keep
up with the number of generated events. The application would have no idea
what the latest state was for a control since it could have missed the latest
control change.

So this patch makes some major changes in how events are allocated. Instead
of allocating events per-filehandle they are now allocated when subscribing an
event. So for that particular event type N events (determined by the driver)
are allocated. Those events are reserved for that particular event type.
This ensures that you will not miss events for a particular type altogether.

In addition, if there are N events in use and a new event is raised, then
the oldest event is dropped and the new one is added. So the latest event
is always available.

This can be further improved by adding the ability to merge the state of
two events together, ensuring that no data is lost at all. This will be
added in the next patch.

This also makes it possible to allow the user to determine the number of
events that will be allocated. This is not implemented at the moment, but
would be trivial.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls/event: remove struct v4l2_ctrl_fh, instead use v4l2_subscribed_event
Hans Verkuil [Mon, 13 Jun 2011 21:55:58 +0000 (18:55 -0300)]
[media] v4l2-ctrls/event: remove struct v4l2_ctrl_fh, instead use v4l2_subscribed_event

The v4l2_ctrl_fh struct connected v4l2_ctrl with v4l2_fh so the control
would know which filehandles subscribed to it. However, it is much easier
to use struct v4l2_subscribed_event directly for that and get rid of that
intermediate struct.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-events/fh: merge v4l2_events into v4l2_fh
Hans Verkuil [Mon, 13 Jun 2011 20:44:42 +0000 (17:44 -0300)]
[media] v4l2-events/fh: merge v4l2_events into v4l2_fh

Drivers that supported events used to be rare, but now that controls can also
raise events this will become much more common since almost all drivers have
controls.

This means that keeping struct v4l2_events as a separate struct make no more
sense. Merging it into struct v4l2_fh simplifies things substantially as it
is now an integral part of the filehandle struct.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: ov9740: Add suspend/resume
Andrew Chew [Thu, 23 Jun 2011 23:19:44 +0000 (20:19 -0300)]
[media] V4L: ov9740: Add suspend/resume

On suspend, remember whether we are streaming or not, and at what frame format,
so that on resume, we can start streaming again.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: ov9740: Reorder video and core ops
Andrew Chew [Thu, 23 Jun 2011 23:19:43 +0000 (20:19 -0300)]
[media] V4L: ov9740: Reorder video and core ops

This is to avoid needing a forward declaration when ov9740_s_power() (in the
subsequent patch) calls ov9740_s_fmt().

Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: ov9740: Remove hardcoded resolution regs
Andrew Chew [Thu, 23 Jun 2011 23:19:42 +0000 (20:19 -0300)]
[media] V4L: ov9740: Remove hardcoded resolution regs

Derive resolution-dependent register settings programmatically.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: ov9740: Fixed some settings
Andrew Chew [Thu, 23 Jun 2011 23:19:41 +0000 (20:19 -0300)]
[media] V4L: ov9740: Fixed some settings

Based on vendor feedback, should issue a software reset at start of day.

Also, OV9740_ANALOG_CTRL15 needs to be changed so the sensor does not begin
streaming until it is ready (otherwise, results in a nonsense frame for the
initial frame).

Added a comment on using discontinuous clock.

Finally, OV9740_ISP_CTRL19 needs to be changed to really use YUYV ordering
(the previous value was for VYUY).

Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: ov9740: Correct print in ov9740_reg_rmw()
Andrew Chew [Thu, 23 Jun 2011 23:19:40 +0000 (20:19 -0300)]
[media] V4L: ov9740: Correct print in ov9740_reg_rmw()

The register width of the ov9740 is 16-bits, so correct the debug print
to reflect this.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: ov9740: Cleanup hex casing inconsistencies
Andrew Chew [Thu, 23 Jun 2011 23:19:39 +0000 (20:19 -0300)]
[media] V4L: ov9740: Cleanup hex casing inconsistencies

Made all hex number casing use lower-case throughout the entire driver
for consistency.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: at91: add Atmel Image Sensor Interface (ISI) support
Josh Wu [Wed, 8 Jun 2011 01:40:19 +0000 (22:40 -0300)]
[media] V4L: at91: add Atmel Image Sensor Interface (ISI) support

This patch is to enable Atmel Image Sensor Interface (ISI) driver support.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: soc-camera: remove several now unused soc-camera client operations
Guennadi Liakhovetski [Tue, 7 Jun 2011 09:24:32 +0000 (06:24 -0300)]
[media] V4L: soc-camera: remove several now unused soc-camera client operations

This patch removes .enum_input(), .suspend() and .resume() soc-camera
client operations.

Functionality, provided by .enum_input(), if needed, can be implemented
using the v4l2-subdev API.

As for .suspend() and .resume(), the only client driver, implementing
these methods has been mt9m111, and the only host driver, using them
has been pxa-camera. Now that both those drivers have been converted
to the standard subdev .s_power() operation, .suspend() and .resume()
can be removed.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: mt9m111: switch to v4l2-subdev .s_power() method
Guennadi Liakhovetski [Sun, 5 Jun 2011 11:27:39 +0000 (08:27 -0300)]
[media] V4L: mt9m111: switch to v4l2-subdev .s_power() method

Eliminate soc-camera specific .suspend() and .restore() methods in favour
of the standard v4l2-subdev .s_power() method

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: mt9m111: propagate higher level abstraction down in functions
Guennadi Liakhovetski [Tue, 7 Jun 2011 09:47:30 +0000 (06:47 -0300)]
[media] V4L: mt9m111: propagate higher level abstraction down in functions

It is more convenient to propagate the higher level abstraction - the
struct mt9m111 object into functions and then retrieve a pointer to
the i2c client, if needed, than to do the reverse.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: soc-camera: MIPI flags are not sensor flags
Guennadi Liakhovetski [Sat, 4 Jun 2011 20:24:22 +0000 (17:24 -0300)]
[media] V4L: soc-camera: MIPI flags are not sensor flags

SOCAM_MIPI_[1234]LANE flags are not board-specific sensor flags, they
are bus configuration flags.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: tw9910: remove bogus ENUMINPUT implementation
Guennadi Liakhovetski [Sat, 4 Jun 2011 19:48:10 +0000 (16:48 -0300)]
[media] V4L: tw9910: remove bogus ENUMINPUT implementation

tw9910 is a TV decoder, it doesn't have a tuner. Besides, the
.enum_input soc-camera operation is optional and normally not needed.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: sh_mobile_ceu_camera: remove redundant calculations
Guennadi Liakhovetski [Sat, 4 Jun 2011 18:09:02 +0000 (15:09 -0300)]
[media] V4L: sh_mobile_ceu_camera: remove redundant calculations

soc_camera core now performs the standard .bytesperline and .sizeimage
calculations internally, no need to duplicate in drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: mx2_camera: .try_fmt shouldn't fail
Guennadi Liakhovetski [Sat, 4 Jun 2011 18:06:47 +0000 (15:06 -0300)]
[media] V4L: mx2_camera: .try_fmt shouldn't fail

If the user is requesting too large a frame, instead of failing
select an acceptable geometry, preserving the requested aspect ratio.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: pxa-camera: switch to using subdev .s_power() core operation
Guennadi Liakhovetski [Tue, 7 Jun 2011 08:50:15 +0000 (05:50 -0300)]
[media] V4L: pxa-camera: switch to using subdev .s_power() core operation

soc-camera specific .suspend() and .resume() methods are deprecated
and should be replaced by the subdev standard .s_power() operation.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: pxa-camera: try to force progressive video format
Guennadi Liakhovetski [Tue, 7 Jun 2011 08:44:19 +0000 (05:44 -0300)]
[media] V4L: pxa-camera: try to force progressive video format

The pxa-camera driver only supports progressive video so far. Passing
down to the client the same format, as what the user has requested can
result in interlaced video, even if the client supports both. This
patch avoids such cases.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: pxa_camera: remove redundant calculations
Guennadi Liakhovetski [Tue, 7 Jun 2011 08:42:57 +0000 (05:42 -0300)]
[media] V4L: pxa_camera: remove redundant calculations

soc_camera core now performs the standard .bytesperline and .sizeimage
calculations internally, no need to duplicate in drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: mx3_camera: remove redundant calculations
Guennadi Liakhovetski [Sat, 4 Jun 2011 17:11:10 +0000 (14:11 -0300)]
[media] V4L: mx3_camera: remove redundant calculations

soc_camera core now performs the standard .bytesperline and .sizeimage
calculations internally, no need to duplicate in drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: make manual_mode_value 8 bits and check against control range
Hans Verkuil [Tue, 28 Jun 2011 13:43:13 +0000 (10:43 -0300)]
[media] v4l2-ctrls: make manual_mode_value 8 bits and check against control range

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-compat-ioctl32: add VIDIOC_DQEVENT support
Hans Verkuil [Tue, 7 Jun 2011 14:43:57 +0000 (11:43 -0300)]
[media] v4l2-compat-ioctl32: add VIDIOC_DQEVENT support

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] ivtv: add control event support
Hans Verkuil [Tue, 28 Jun 2011 13:40:42 +0000 (10:40 -0300)]
[media] ivtv: add control event support

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] vivi: support control events
Hans Verkuil [Tue, 7 Jun 2011 13:20:23 +0000 (10:20 -0300)]
[media] vivi: support control events

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L2 spec: document control events
Hans Verkuil [Tue, 7 Jun 2011 12:53:37 +0000 (09:53 -0300)]
[media] V4L2 spec: document control events

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: simplify event subscription
Hans Verkuil [Fri, 10 Jun 2011 08:56:39 +0000 (05:56 -0300)]
[media] v4l2-ctrls: simplify event subscription

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: add control events
Hans Verkuil [Tue, 7 Jun 2011 14:13:44 +0000 (11:13 -0300)]
[media] v4l2-ctrls: add control events

Whenever a control changes value or state an event is sent to anyone
that subscribed to it.

This functionality is useful for control panels but also for applications
that need to wait for (usually status) controls to change value.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: add v4l2_fh pointer to the set control functions
Hans Verkuil [Tue, 7 Jun 2011 09:47:18 +0000 (06:47 -0300)]
[media] v4l2-ctrls: add v4l2_fh pointer to the set control functions

When an application changes a control you want to generate an event.
However, you want to avoid sending such an event back to the application
(file handle) that caused the change.

Add the filehandle to the various set control functions.

The filehandle isn't used yet, but the control event patches will need
this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] vivi: add autogain/gain support to test the autocluster functionality
Hans Verkuil [Tue, 7 Jun 2011 09:34:41 +0000 (06:34 -0300)]
[media] vivi: add autogain/gain support to test the autocluster functionality

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] Documentation: Improve cluster documentation and document the new autoclusters
Hans Verkuil [Tue, 7 Jun 2011 08:46:53 +0000 (05:46 -0300)]
[media] Documentation: Improve cluster documentation and document the new autoclusters

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: add v4l2_ctrl_auto_cluster to simplify autogain/gain scenarios
Hans Verkuil [Fri, 10 Jun 2011 08:44:36 +0000 (05:44 -0300)]
[media] v4l2-ctrls: add v4l2_ctrl_auto_cluster to simplify autogain/gain scenarios

It is a bit tricky to handle autogain/gain type scenerios correctly. Such
controls need to be clustered and the V4L2_CTRL_FLAG_UPDATE should be set on
the autofoo controls. In addition, the manual controls should be marked
inactive when the automatic mode is on, and active when the manual mode is on.
This also requires specialized volatile handling.

The chances of drivers doing all these things correctly are pretty remote.
So a new v4l2_ctrl_auto_cluster function was added that takes care of these
issues.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-controls.txt: update to latest v4l2-ctrl.c changes
Hans Verkuil [Fri, 27 May 2011 11:53:37 +0000 (08:53 -0300)]
[media] v4l2-controls.txt: update to latest v4l2-ctrl.c changes

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: fix and improve volatile control handling
Hans Verkuil [Fri, 10 Jun 2011 08:43:34 +0000 (05:43 -0300)]
[media] v4l2-ctrls: fix and improve volatile control handling

If you have a cluster of controls that is a mix of volatile and non-volatile
controls, then requesting the value of the volatile control would fail if the
master control of that cluster was non-volatile. The code assumed that the
volatile state of the master control was the same for all other controls in
the cluster.

This is now fixed.

In addition, it was clear from bugs in some drivers that it was confusing that
the ctrl->cur union had to be used in g_volatile_ctrl. Several drivers used the
'new' values instead. The framework was changed so that drivers now set the new
value instead of the current value.

This has an additional benefit as well: the volatile values are now only stored
in the 'new' value, leaving the current value alone. This is useful for
autofoo/foo control clusters where you want to have a 'foo' control act like a
volatile control if 'autofoo' is on, but as a normal control when it is off.

Since with this change the cur value is no longer overwritten when g_volatile_ctrl
is called, you can use it to remember the original 'foo' value. For example:

autofoo = 0, foo = 10 and foo is non-volatile.

Now autofoo is set to 1 and foo is marked volatile. Retrieving the foo value
will get the volatile value. Set autofoo back to 0, which marks foo as non-
volatile again, and retrieving foo will get the old current value of 10.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-subdev: implement per-filehandle control handlers
Hans Verkuil [Wed, 25 May 2011 11:52:13 +0000 (08:52 -0300)]
[media] v4l2-subdev: implement per-filehandle control handlers

To be consistent with v4l2-ioctl.c.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ioctl: add ctrl_handler to v4l2_fh
Hans Verkuil [Sat, 12 Mar 2011 11:54:43 +0000 (08:54 -0300)]
[media] v4l2-ioctl: add ctrl_handler to v4l2_fh

This is required to implement control events and is also needed to allow
for per-filehandle control handlers.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: drivers should be able to ignore the READ_ONLY flag
Hans Verkuil [Tue, 7 Jun 2011 07:50:31 +0000 (04:50 -0300)]
[media] v4l2-ctrls: drivers should be able to ignore the READ_ONLY flag

When applications try to set READ_ONLY controls an error should
be returned. However, when drivers do that it should be accepted.

Those controls could reflect some driver status which the application
can't change but the driver obviously has to be able to change it.

This is needed among others for future HDMI status controls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: simplify error_idx handling
Hans Verkuil [Tue, 7 Jun 2011 07:40:04 +0000 (04:40 -0300)]
[media] v4l2-ctrls: simplify error_idx handling

The lower-level prepare functions just set error_idx for each control that
might have an error. The high-level functions will override this with
cs->count in the get and set cases. Only try will keep the error_idx.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: introduce call_op define
Hans Verkuil [Wed, 25 May 2011 09:04:58 +0000 (06:04 -0300)]
[media] v4l2-ctrls: introduce call_op define

Add the call_op define to safely call the control ops. This also allows
for controls without any ops such as the 'control class' controls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook/v4l: Document the new system-wide version behavior
Mauro Carvalho Chehab [Sat, 25 Jun 2011 17:11:52 +0000 (14:11 -0300)]
[media] DocBook/v4l: Document the new system-wide version behavior

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] radio: Use the subsystem version control for VIDIOC_QUERYCAP
Mauro Carvalho Chehab [Sat, 25 Jun 2011 13:15:42 +0000 (10:15 -0300)]
[media] radio: Use the subsystem version control for VIDIOC_QUERYCAP

Just like the video drivers, the right thing to do is to use
the per-subsystem version control.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] Stop using linux/version.h on the remaining video drivers
Mauro Carvalho Chehab [Sat, 25 Jun 2011 14:28:37 +0000 (11:28 -0300)]
[media] Stop using linux/version.h on the remaining video drivers

Standardize the remaining video drivers to return the API version
for the VIDIOC_QUERYCAP version, instead of a per-driver version.

Those drivers had the version updated more recently or are SoC
drivers. Even so, it doesn't sound a good idea to keep a per-driver
version control, so, let's use the per-subsystem version control
instead.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] gspca: don't include linux/version.h
Mauro Carvalho Chehab [Tue, 28 Jun 2011 01:28:38 +0000 (22:28 -0300)]
[media] gspca: don't include linux/version.h

Instead of handling a per-driver driver version, use the
per-subsystem one.

As reviewed by Jean-Francois Moine <moinejf@free.fr>:
- the 'info' may be simplified:

Reviewed-by: Jean-Francois Moine <moinejf@free.fr>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] uvcvideo: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
Mauro Carvalho Chehab [Sat, 25 Jun 2011 16:50:37 +0000 (13:50 -0300)]
[media] uvcvideo: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP

uvcvideo doesn't use vidioc_ioctl2. As the API is changing to use
a common version for all drivers, we need to expliticly fix this
driver.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>