]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
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 agoMerge branch 'tmp/for_3.0-rc6' into staging/for_v3.1
Mauro Carvalho Chehab [Thu, 7 Jul 2011 20:49:22 +0000 (17:49 -0300)]
Merge branch 'tmp/for_3.0-rc6' into staging/for_v3.1

* tmp/for_3.0-rc6: (46 commits)
  [media] rc: call input_sync after scancode reports
  [media] imon: allow either proto on unknown 0xffdc
  [media] imon: auto-config ffdc 7e device
  [media] saa7134: fix raw IR timeout value
  [media] rc: fix ghost keypresses with certain hw
  [media] [staging] lirc_serial: allocate irq at init time
  [media] lirc_zilog: fix spinning rx thread
  [media] keymaps: fix table for pinnacle pctv hd devices
  [media] ite-cir: 8709 needs to use pnp resource 2
  [media] V4L: mx1-camera: fix uninitialized variable
  [media] omap_vout: Added check in reqbuf & mmap for buf_size allocation
  [media] OMAP_VOUT: Change hardcoded device node number to -1
  [media] OMAP_VOUTLIB: Fix wrong resizer calculation
  [media] uvcvideo: Disable the queue when failing to start
  [media] uvcvideo: Remove buffers from the queues when freeing
  [media] uvcvideo: Ignore entities for terminals with no supported format
  [media] v4l: Don't access media entity after is has been destroyed
  [media] media: omap3isp: fix a potential NULL deref
  [media] media: vb2: fix allocation failure check
  [media] media: vb2: reset queued_count value during queue reinitialization
  ...

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] rc: call input_sync after scancode reports
Jarod Wilson [Thu, 23 Jun 2011 13:40:55 +0000 (10:40 -0300)]
[media] rc: call input_sync after scancode reports

Due to commit cdda911c34006f1089f3c87b1a1f31ab3a4722f2, evdev only
becomes readable when the buffer contains an EV_SYN/SYN_REPORT event. If
we get a repeat or a scancode we don't have a mapping for, we never call
input_sync, and thus those events don't get reported in a timely
fashion.

For example, take an mceusb transceiver with a default rc6 keymap. Press
buttons on an rc5 remote while monitoring with ir-keytable, and you'll
see nothing. Now press a button on the rc6 remote matching the keymap.
You'll suddenly get the rc5 key scancodes, the rc6 scancode and the rc6
key spit out all at the same time.

Pressing and holding a button on a remote we do have a keymap for also
works rather unreliably right now, due to repeat events also happening
without a call to input_sync (we bail from ir_do_keydown before getting
to the point where it calls input_sync).

Easy fix though, just add two strategically placed input_sync calls
right after our input_event calls for EV_MSC, and all is well again.
Technically, we probably should have been doing this all along, its just
that it never caused any functional difference until the referenced
change went into the input layer.

input_sync once per IR signal. There was another hidden bug in the code
where we were calling input_report_key using last_keycode instead of our
just discovered keycode, which manifested with the reordering of calling
input_report_key and setting last_keycode.

Reported-by: Stephan Raue <sraue@openelec.tv>
CC: Stephan Raue <sraue@openelec.tv>
CC: Mauro Carvalho Chehab <mchehab@redhat.com>
CC: Jeff Brown <jeffbrown@android.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] imon: allow either proto on unknown 0xffdc
Jarod Wilson [Mon, 20 Jun 2011 03:07:13 +0000 (00:07 -0300)]
[media] imon: allow either proto on unknown 0xffdc

While 0xffdc devices have their IR protocol hard-coded into the firmware
of the device, we have no known way of telling what it is if we don't
have the device's config byte already in the driver. Unknown devices
default to the imon native protocol, but might actually be rc6, so we
should set the driver up such that the user can load the rc6 keytable
from userspace and still have a working device ahead of its config byte
being added to the driver.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] imon: auto-config ffdc 7e device
Jarod Wilson [Mon, 20 Jun 2011 03:04:05 +0000 (00:04 -0300)]
[media] imon: auto-config ffdc 7e device

Another device with the 0xffdc device id, this one with 0x7e in the
config byte. Its an iMON VFD + RC6 IR, in a CoolerMaster 260 case.

Reported-by: Filip Streibl <filip@streibl.cz>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] saa7134: fix raw IR timeout value
Jarod Wilson [Thu, 16 Jun 2011 20:30:48 +0000 (17:30 -0300)]
[media] saa7134: fix raw IR timeout value

The comment says "wait 15ms", but the code says jiffies_to_msecs(15)
instead of msecs_to_jiffies(15). Fix that. Tested, works fine with both
rc5 and rc6 decode, in-kernel and via lirc userspace, with an HVR-1150.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] rc: fix ghost keypresses with certain hw
Jarod Wilson [Thu, 16 Jun 2011 19:18:37 +0000 (16:18 -0300)]
[media] rc: fix ghost keypresses with certain hw

With hardware that has to use ir_raw_event_store_edge to collect IR
sample durations, we were not doing an event reset unless
IR_MAX_DURATION had passed. That's around 4 seconds. So if someone
presses up, then down, with less than 4 seconds in between, they'd get
the initial up, then up and down upon pressing down.

To fix this, I've lowered the "send a reset event" logic's threshold to
the input device's REP_DELAY (defaults to 500ms), and with an
saa7134-based GPIO-driven IR receiver in a Hauppauge HVR-1150, I get
*much* better behavior out of the remote now. Special thanks to Devin
for providing the hardware to investigate this issue.

CC: stable@kernel.org
CC: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] [staging] lirc_serial: allocate irq at init time
Jarod Wilson [Mon, 13 Jun 2011 18:32:26 +0000 (15:32 -0300)]
[media] [staging] lirc_serial: allocate irq at init time

There's really no good reason not to just grab the desired IRQ at driver
init time, instead of every time the lirc device node is accessed. This
also improves the speed and reliability with which a serial transmitter
can operate, as back-to-back transmission attempts (i.e., channel change
to a multi-digit channel) don't have to spend time acquiring and then
releasing the IRQ for every digit, sometimes multiple times, if lircd
has been told to use the min_repeat parameter.

CC: devel@driverdev.osuosl.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] lirc_zilog: fix spinning rx thread
Jarod Wilson [Wed, 8 Jun 2011 21:56:56 +0000 (18:56 -0300)]
[media] lirc_zilog: fix spinning rx thread

We were calling schedule_timeout with the rx thread's task state still
at TASK_RUNNING, which it shouldn't be. Make sure we call
set_current_state(TASK_INTERRUPTIBLE) *before* schedule_timeout, and
we're all good here. I believe this problem was mistakenly introduced in
commit 5bd6b0464b68d429bc8a3fe6595d19c39dfc4d95, and I'm not sure how I
missed it before, as I swear I tested the patchset that was included in,
but alas, stuff happens...

Acked-by: Andy Walls <awalls@md.metrocast.net>
CC: stable@kernel.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] keymaps: fix table for pinnacle pctv hd devices
Jarod Wilson [Wed, 8 Jun 2011 18:00:01 +0000 (15:00 -0300)]
[media] keymaps: fix table for pinnacle pctv hd devices

Both consumers of RC_MAP_PINNACLE_PCTV_HD send along full RC-5
scancodes, so this update makes this keymap actually *have* full
scancodes, heisted from rc-dib0700-rc5.c. This should fix out of the box
remote functionality for the Pinnacle PCTV HD 800i (cx88 pci card) and
PCTV HD Pro 801e (em28xx usb stick).

CC: stable@kernel.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] ite-cir: 8709 needs to use pnp resource 2
Jarod Wilson [Tue, 7 Jun 2011 21:45:17 +0000 (18:45 -0300)]
[media] ite-cir: 8709 needs to use pnp resource 2

Thanks to the intrepid testing and debugging of Matthijs van Drunen, it
was uncovered that at least some variants of the ITE8709 need to use pnp
resource 2, rather than 0, for things to function properly. Resource 0
has a length of only 1, and if you try to bypass the pnp_port_len check
and use it anyway (with either a length of 1 or 2), the system in
question's trackpad ceased to function.

The circa lirc 0.8.7 lirc_ite8709 driver used resource 2, but the value
was (amusingly) changed to 0 by way of a patch from ITE themselves, so I
don't know if there may be variants where 0 actually *is* correct, but
at least in this case and in the original lirc_ite8709 driver author's
case, it sure looks like 2 is the right value.

This fix should probably be applied to all stable kernels with the
ite-cir driver, lest we nuke more people's trackpads.

Tested-by: Matthijs van Drunen
CC: Juan Jesús García de Soria <skandalfo@gmail.com>
CC: stable@kernel.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] V4L: mx1-camera: fix uninitialized variable
Andre Bartke [Fri, 10 Jun 2011 10:57:54 +0000 (07:57 -0300)]
[media] V4L: mx1-camera: fix uninitialized variable

mx1_camera_add_device() can return an uninitialized value of ret.

Signed-off-by: Andre Bartke <andre.bartke@gmail.com>
[g.liakhovetski@gmx.de: modified the fix to remove "ret" completely]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] omap_vout: Added check in reqbuf & mmap for buf_size allocation
Vaibhav Hiremath [Thu, 14 Apr 2011 16:42:34 +0000 (13:42 -0300)]
[media] omap_vout: Added check in reqbuf & mmap for buf_size allocation

The usecase where, user allocates small size of buffer
through bootargs (video1_bufsize/video2_bufsize) and later from application
tries to set the format which requires larger buffer size, driver doesn't
check for insufficient buffer size and allows application to map extra buffer.
This leads to kernel crash, when user application tries to access memory
beyond the allocation size.

Added check in both mmap and reqbuf call back function,
and return error if the size of the buffer allocated by user through
bootargs is less than the S_FMT size.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] OMAP_VOUT: Change hardcoded device node number to -1
Vaibhav Hiremath [Thu, 16 Jun 2011 18:32:07 +0000 (15:32 -0300)]
[media] OMAP_VOUT: Change hardcoded device node number to -1

With addition of media-controller framework, now we have various
device nodes (/dev/videoX) getting created, so hardcoding
minor number in video_register_device() is not recommended.

So let V4L2 framework choose free minor number for the device.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] OMAP_VOUTLIB: Fix wrong resizer calculation
Vladimir Pantelic [Tue, 26 Apr 2011 07:28:11 +0000 (04:28 -0300)]
[media] OMAP_VOUTLIB: Fix wrong resizer calculation

The omap_vout_new_crop() function has possible bug, uses uninitialized
variable "crop.width/height" which is actually output of the function.
Instead we should be using "try_crop.width/height" to calculate the
resizer value.

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] uvcvideo: Disable the queue when failing to start
Sjoerd Simons [Mon, 30 May 2011 18:02:00 +0000 (15:02 -0300)]
[media] uvcvideo: Disable the queue when failing to start

When failing to start the camera we should disable the queue again, to
rollback into the same initial state. Otherwise re-trying will always
hit -EBUSY

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] uvcvideo: Remove buffers from the queues when freeing
Sjoerd Simons [Tue, 24 May 2011 15:22:03 +0000 (12:22 -0300)]
[media] uvcvideo: Remove buffers from the queues when freeing

When freeing memory for the video buffers also remove them from the
irq & main queues.

This fixes an oops when doing the following:

open ("/dev/video", ..)
VIDIOC_REQBUFS
VIDIOC_QBUF
VIDIOC_REQBUFS
close ()

As the second VIDIOC_REQBUFS will cause the list entries of the buffers
to be cleared while they still hang around on the main and irc queues

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] uvcvideo: Ignore entities for terminals with no supported format
Laurent Pinchart [Tue, 28 Jun 2011 21:17:48 +0000 (18:17 -0300)]
[media] uvcvideo: Ignore entities for terminals with no supported format

If a streaming interface has no supported format, the driver won't
create a video device for the associated terminal. Fix an oops by
ignoring that terminal when creating links between entities.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l: Don't access media entity after is has been destroyed
Laurent Pinchart [Wed, 15 Jun 2011 08:20:34 +0000 (05:20 -0300)]
[media] v4l: Don't access media entity after is has been destroyed

Entities associated with video device nodes are unregistered in
video_unregister_device(). This destroys the entity even though it can
still be accessed through open video device nodes.

Move the media_device_unregister_entity() call from
video_unregister_device() to v4l2_device_release() to ensure that the
entity isn't unregistered until the last reference to the video device
is released.

Also remove the media_entity_get()/put() calls from v4l2-dev.c. Those
functions were designed for subdevs, to avoid a parent module from being
removed while still accessible through board code. They're not currently
needed for video device nodes, and will oops when a hotpluggable device
is disconnected during streaming, as media_entity_put() called in
v4l2_device_release() tries to access entity->parent->dev->driver which
is set to NULL when the device is disconnected.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] media: omap3isp: fix a potential NULL deref
Ohad Ben-Cohen [Wed, 1 Jun 2011 16:39:46 +0000 (13:39 -0300)]
[media] media: omap3isp: fix a potential NULL deref

Fix a potential NULL pointer dereference by skipping registration of
external entities in case none are provided.

This is useful at least when testing mere memory-to-memory scenarios.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] media: vb2: fix allocation failure check
Marek Szyprowski [Tue, 28 Jun 2011 11:29:02 +0000 (08:29 -0300)]
[media] media: vb2: fix allocation failure check

__vb2_queue_alloc function returns the number of successfully allocated
buffers. There is no point in checking if the returned value is negative.
If this function returns 0, videobuf2 should just return -ENOMEM to
userspace, because no driver can work without memory buffers.

Reported-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] media: vb2: reset queued_count value during queue reinitialization
Marek Szyprowski [Fri, 10 Jun 2011 11:58:42 +0000 (08:58 -0300)]
[media] media: vb2: reset queued_count value during queue reinitialization

queued_count variable was left untouched during the queue reinitialization
in __vb2_queue_cancel, what might lead to mismatch between the real number
of queued buffers and queued_count variable.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] Revert "[media] v4l2: vb2: one more fix for REQBUFS()"
Marek Szyprowski [Wed, 8 Jun 2011 09:15:05 +0000 (06:15 -0300)]
[media] Revert "[media] v4l2: vb2: one more fix for REQBUFS()"

This reverts commit 31901a078af29c33c736dcbf815656920e904632.

Queue should be reinitialized on each REQBUFS() call even if the memory
access method and buffer count have not been changed. The user might have
changed the format and if we go the short path introduced in that commit,
the memory buffer will not be reallocated to fit with new format.

The previous patch was just over-engineered optimization, which just
introduced a bug to videobuf2.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] media: vb2: add __GFP_NOWARN to dma-sg allocator
Marek Szyprowski [Wed, 1 Jun 2011 15:57:37 +0000 (12:57 -0300)]
[media] media: vb2: add __GFP_NOWARN to dma-sg allocator

Add __GFP_NOWARN parameter to videobuf2 dma-sg allocator to prevent
kernel warning and stack dump if there is not enough memory available.
Videobuf2 and drivers should correctly handle no memory case, so there
is no need for stack dump and extensive log.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.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>