openwrt/staging/blogic.git
13 years ago[media] drxk: fix warning: ‘status’ may be used uninitialized in this function
Mauro Carvalho Chehab [Sun, 3 Jul 2011 21:21:59 +0000 (18:21 -0300)]
[media] drxk: fix warning: ‘status’ may be used uninitialized in this function

One of the problems of the old CHECK_ERROR is that it was hiding
the status parameter. Maybe due to that, on a few places, the return
code might lead to return incorrect status:

drivers/media/dvb/frontends/drxk_hard.c: In function ‘load_microcode.clone.0’:
drivers/media/dvb/frontends/drxk_hard.c:1281: warning: ‘status’ may be used uninitialized in this function
drivers/media/dvb/frontends/drxk_hard.c:1281: note: ‘status’ was declared here
drivers/media/dvb/frontends/drxk_hard.c: In function ‘GetLockStatus’:
drivers/media/dvb/frontends/drxk_hard.c:1792: warning: ‘status’ may be used uninitialized in this function
drivers/media/dvb/frontends/drxk_hard.c: In function ‘Start.clone.7’:
drivers/media/dvb/frontends/drxk_hard.c:1734: warning: ‘status’ may be used uninitialized in this function

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] drxk: Return -EINVAL if an invalid bandwidth is used
Mauro Carvalho Chehab [Sun, 3 Jul 2011 21:18:14 +0000 (18:18 -0300)]
[media] drxk: Return -EINVAL if an invalid bandwidth is used

drivers/media/dvb/frontends/drxk_hard.c: In function ‘SetDVBT’:
drivers/media/dvb/frontends/drxk_hard.c:3766: warning: enumeration value ‘BANDWIDTH_5_MHZ’ not handled in switch
drivers/media/dvb/frontends/drxk_hard.c:3766: warning: enumeration value ‘BANDWIDTH_10_MHZ’ not handled in switch
drivers/media/dvb/frontends/drxk_hard.c:3766: warning: enumeration value ‘BANDWIDTH_1_712_MHZ’ not handled in switch

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] tda18271c2dd: Remove the CHK_ERROR macro
Mauro Carvalho Chehab [Sun, 3 Jul 2011 21:12:26 +0000 (18:12 -0300)]
[media] tda18271c2dd: Remove the CHK_ERROR macro

The CHK_ERROR macro does a flow control, violating chapter 12
of the Documentation/CodingStyle. Doing flow controls inside
macros is a bad idea, as it hides what's happening. It also
hides the var "status" with is also a bad idea.

The changes were done by this small perl script:
my $blk=0;
while (<>) {
s/^\s+// if ($blk);
$f =~ s/\s+$// if ($blk && /^\(/);
$blk = 1 if (!m/\#/ && m/CHK_ERROR/);
$blk=0 if ($blk && m/\;/);
s/\n/ / if ($blk);
$f.=$_;
};
$f=~ s,\n(\t+)CHK_ERROR\((.*)\)\;([^\n]*),\n\1status = \2;\3\n\1if (status < 0)\n\1\tbreak;,g;

print $f;

And manually fixed.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] drxk: Remove the CHK_ERROR macro
Mauro Carvalho Chehab [Sun, 3 Jul 2011 21:06:07 +0000 (18:06 -0300)]
[media] drxk: Remove the CHK_ERROR macro

The CHK_ERROR macro does a flow control, violating chapter 12
of the Documentation/CodingStyle. Doing flow controls inside
macros is a bad idea, as it hides what's happening. It also
hides the var "status" with is also a bad idea.

The changes were done by this small perl script:
my $blk=0;
while (<>) {
s /^\s+// if ($blk);
$f =~ s/\s+$// if ($blk && /^\(/);
$blk = 1 if (!m/\#/ && m/CHK_ERROR/);
$blk=0 if ($blk && m/\;/);
s/\n/ / if ($blk);
$f.=$_;
};
$f=~ s,\n(\t+)CHK_ERROR\((.*)\)\;([^\n]*),\n\1status = \2;\3\n\1if (status < 0)\n\1\tbreak;,g;
print $f;

And manually fixed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] drxd/drxk: Don't export MulDiv32 symbol
Mauro Carvalho Chehab [Sun, 3 Jul 2011 20:18:57 +0000 (17:18 -0300)]
[media] drxd/drxk: Don't export MulDiv32 symbol

/home/v4l/v4l/patchwork/drivers/media/dvb/frontends/drxk_hard.c:181: multiple definition of `MulDiv32'
drivers/media/dvb/frontends/drxd.o:/home/v4l/v4l/patchwork/drivers/media/dvb/frontends/drxd_hard.c:236: first defined here

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] ngene: Strip dummy packets inserted by the driver
Oliver Endriss [Sun, 3 Jul 2011 17:04:46 +0000 (14:04 -0300)]
[media] ngene: Strip dummy packets inserted by the driver

As the CI requires a continuous data stream, the driver inserts dummy
packets when necessary. Do not pass these packets to userspace anymore.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] ngene: Update for latest cxd2099
Oliver Endriss [Sun, 3 Jul 2011 17:03:49 +0000 (14:03 -0300)]
[media] ngene: Update for latest cxd2099

Modifications for latest cxd2099.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] cxd2099: Codingstyle fixes
Oliver Endriss [Sun, 3 Jul 2011 17:02:24 +0000 (14:02 -0300)]
[media] cxd2099: Codingstyle fixes

Codingstyle fixes.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] cxd2099: Update to latest version
Ralph Metzler [Sun, 3 Jul 2011 17:00:57 +0000 (14:00 -0300)]
[media] cxd2099: Update to latest version

Import latest driver from ddbridge-0.6.1.tar.bz2.

Signed-off-by: Ralph Metzler <rmetzler@digitaldevices.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] ngene: Support DuoFlex CT attached to CineS2 and SaTiX-S2
Oliver Endriss [Sun, 3 Jul 2011 16:59:30 +0000 (13:59 -0300)]
[media] ngene: Support DuoFlex CT attached to CineS2 and SaTiX-S2

Support DuoFlex CT with Digital Devices CineS2 and Mystique SaTiX-S2.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] ngene: Fix name of Digital Devices PCIe/miniPCIe
Oliver Endriss [Sun, 3 Jul 2011 16:58:22 +0000 (13:58 -0300)]
[media] ngene: Fix name of Digital Devices PCIe/miniPCIe

Fix name of Digital Devices PCIe/miniPCIe.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] ngene: Fix return code if no demux was found
Oliver Endriss [Sun, 3 Jul 2011 16:57:26 +0000 (13:57 -0300)]
[media] ngene: Fix return code if no demux was found

Fix return code if no demux was found (cineS2_probe).

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] ngene: Codingstyle fixes
Oliver Endriss [Sun, 3 Jul 2011 16:56:28 +0000 (13:56 -0300)]
[media] ngene: Codingstyle fixes

Codingstyle fixes

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] ngene: Support Digital Devices DuoFlex CT
Ralph Metzler [Sun, 3 Jul 2011 16:55:06 +0000 (13:55 -0300)]
[media] ngene: Support Digital Devices DuoFlex CT

Support Digital Devices DuoFlex CT with ngene.

Signed-off-by: Ralph Metzler <rmetzler@digitaldevices.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] get_dvb_firmware: Get DRX-K firmware for Digital Devices DVB-CT cards
Oliver Endriss [Sun, 3 Jul 2011 16:53:50 +0000 (13:53 -0300)]
[media] get_dvb_firmware: Get DRX-K firmware for Digital Devices DVB-CT cards

Get DRX-K firmware for Digital Devices DVB-CT cards

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DRX-K, TDA18271c2: Add build support
Oliver Endriss [Sun, 3 Jul 2011 16:51:43 +0000 (13:51 -0300)]
[media] DRX-K, TDA18271c2: Add build support

Add both drivers to Makefile and Kconfig.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DRX-K: Tons of coding-style fixes
Oliver Endriss [Sun, 3 Jul 2011 16:49:44 +0000 (13:49 -0300)]
[media] DRX-K: Tons of coding-style fixes

Tons of coding-style fixes

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DRX-K: Shrink size of drxk_map.h
Oliver Endriss [Sun, 3 Jul 2011 11:51:32 +0000 (08:51 -0300)]
[media] DRX-K: Shrink size of drxk_map.h

Deleted all unused symbold from drxk_map.h,
which reduced the size from 1.1M to 37K!

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DRX-K: Initial check-in
Ralph Metzler [Sun, 3 Jul 2011 16:42:18 +0000 (13:42 -0300)]
[media] DRX-K: Initial check-in

Driver for the DRX-K DVB-C/T demodulator.

Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] tda18271c2dd: Lots of coding-style fixes
Oliver Endriss [Sun, 3 Jul 2011 16:37:31 +0000 (13:37 -0300)]
[media] tda18271c2dd: Lots of coding-style fixes

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] tda18271c2dd: Initial check-in
Ralph Metzler [Sun, 3 Jul 2011 16:36:17 +0000 (13:36 -0300)]
[media] tda18271c2dd: Initial check-in

Driver for the NXP TDA18271c2 silicon tuner.

Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: Fix a merge conflict
Mauro Carvalho Chehab [Sun, 10 Jul 2011 19:34:48 +0000 (16:34 -0300)]
[media] v4l2-ctrls: Fix a merge conflict

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrl: add codec controls support to the control framework
Kamil Debski [Tue, 14 Jun 2011 13:46:22 +0000 (10:46 -0300)]
[media] v4l2-ctrl: add codec controls support to the control framework

Add support for the codec controls to the v4l2 control framework.

[mchehab@redhat.com: Fix merge conflicts and removed some hunks that were
 adding blank lines without a good reason]
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l: add control definitions for codec devices
Kamil Debski [Tue, 14 Jun 2011 13:31:04 +0000 (10:31 -0300)]
[media] v4l: add control definitions for codec devices

Add control definitions and documentation for controls
specific to codec devices.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l: add fourcc definitions for compressed formats
Kamil Debski [Mon, 4 Jul 2011 16:25:50 +0000 (13:25 -0300)]
[media] v4l: add fourcc definitions for compressed formats

Add fourcc definitions and documentation for the following
compressed formats: H264, H264 without start codes,
MPEG1/2/4 ES, XVID, VC1 Annex G and Annex L compliant.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l: Document V4L2 control endianness as machine endianness
Sakari Ailus [Mon, 4 Jul 2011 08:37:21 +0000 (05:37 -0300)]
[media] v4l: Document V4L2 control endianness as machine endianness

Document V4L2 control endianness as machine endianness.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] adp1653: Add driver for LED flash controller
Sakari Ailus [Thu, 5 May 2011 18:39:25 +0000 (15:39 -0300)]
[media] adp1653: Add driver for LED flash controller

This patch adds the driver for the adp1653 LED flash controller. This
controller supports a high power led in flash and torch modes and an
indicator light, sometimes also called privacy light.

The adp1653 is used on the Nokia N900.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Tuukka Toivonen <tuukkat76@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: David Cohen <dacohen@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l: Add flash control documentation
Sakari Ailus [Wed, 4 May 2011 13:45:58 +0000 (10:45 -0300)]
[media] v4l: Add flash control documentation

Add documentation for V4L2 flash controls.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l: Add a class and a set of controls for flash devices
Sakari Ailus [Mon, 21 Mar 2011 15:52:51 +0000 (12:52 -0300)]
[media] v4l: Add a class and a set of controls for flash devices

Add a control class and a set of controls to support LED and Xenon flash
devices. An example of such a device is the adp1653.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook: document V4L2_CTRL_TYPE_BITMASK
Hans Verkuil [Mon, 23 May 2011 10:36:55 +0000 (07:36 -0300)]
[media] DocBook: document V4L2_CTRL_TYPE_BITMASK

[mchehab@redhat.com: Fix a merge conflict and make compat.xml coherent with v4l2.xml]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] vivi: add bitmask test control
Hans Verkuil [Tue, 29 Mar 2011 19:33:11 +0000 (16:33 -0300)]
[media] vivi: add bitmask test control

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] v4l2-ctrls: add new bitmask control type
Hans Verkuil [Mon, 23 May 2011 07:07:05 +0000 (04:07 -0300)]
[media] v4l2-ctrls: add new bitmask control type

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] vivi: Fix sleep-in-atomic-context
Hans Verkuil [Tue, 5 Jul 2011 10:19:23 +0000 (07:19 -0300)]
[media] vivi: Fix sleep-in-atomic-context

Fix sleep-in-atomic-context bug in vivi:

Jun 28 18:14:39 tschai kernel: [   80.970478] BUG: sleeping function called from invalid context at kernel/mutex.c:271
Jun 28 18:14:39 tschai kernel: [   80.970483] in_atomic(): 0, irqs_disabled(): 1, pid: 2854, name: vivi-000
Jun 28 18:14:39 tschai kernel: [   80.970485] INFO: lockdep is turned off.
Jun 28 18:14:39 tschai kernel: [   80.970486] irq event stamp: 0
Jun 28 18:14:39 tschai kernel: [   80.970487] hardirqs last  enabled at (0): [<          (null)>]           (null)
Jun 28 18:14:39 tschai kernel: [   80.970490] hardirqs last disabled at (0): [<ffffffff8109a90b>] copy_process+0x61b/0x1440
Jun 28 18:14:39 tschai kernel: [   80.970495] softirqs last  enabled at (0): [<ffffffff8109a90b>] copy_process+0x61b/0x1440
Jun 28 18:14:39 tschai kernel: [   80.970498] softirqs last disabled at (0): [<          (null)>]           (null)
Jun 28 18:14:39 tschai kernel: [   80.970502] Pid: 2854, comm: vivi-000 Tainted: P            3.0.0-rc1-tschai #372
Jun 28 18:14:39 tschai kernel: [   80.970504] Call Trace:
Jun 28 18:14:39 tschai kernel: [   80.970509]  [<ffffffff81089be3>] __might_sleep+0xf3/0x130
Jun 28 18:14:39 tschai kernel: [   80.970512]  [<ffffffff8176967f>] mutex_lock_nested+0x2f/0x60
Jun 28 18:14:39 tschai kernel: [   80.970517]  [<ffffffffa0acee3e>] vivi_fillbuff+0x20e/0x3f0 [vivi]
Jun 28 18:14:39 tschai kernel: [   80.970520]  [<ffffffff81407004>] ? do_raw_spin_lock+0x54/0x150
Jun 28 18:14:39 tschai kernel: [   80.970524]  [<ffffffff8104ef5e>] ? read_tsc+0xe/0x20
Jun 28 18:14:39 tschai kernel: [   80.970528]  [<ffffffff810c9d87>] ? getnstimeofday+0x57/0xe0
Jun 28 18:14:39 tschai kernel: [   80.970531]  [<ffffffffa0acf1b1>] vivi_thread+0x191/0x2f0 [vivi]
Jun 28 18:14:39 tschai kernel: [   80.970534]  [<ffffffff81093aa0>] ? try_to_wake_up+0x2d0/0x2d0
Jun 28 18:14:39 tschai kernel: [   80.970537]  [<ffffffffa0acf020>] ? vivi_fillbuff+0x3f0/0x3f0 [vivi]
Jun 28 18:14:39 tschai kernel: [   80.970541]  [<ffffffff810bff46>] kthread+0xb6/0xc0
Jun 28 18:14:39 tschai kernel: [   80.970544]  [<ffffffff817743e4>] kernel_thread_helper+0x4/0x10
Jun 28 18:14:39 tschai kernel: [   80.970547]  [<ffffffff8176b4d4>] ? retint_restore_args+0x13/0x13
Jun 28 18:14:39 tschai kernel: [   80.970550]  [<ffffffff810bfe90>] ? __init_kthread_worker+0x70/0x70
Jun 28 18:14:39 tschai kernel: [   80.970552]  [<ffffffff817743e0>] ? gs_change+0x13/0x13

This bug was introduced in 2.6.39.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 years ago[media] DocBook: fix typo: vl42_plane_pix_format -> v4l2_plane_pix_format
Hans Verkuil [Tue, 5 Jul 2011 10:17:39 +0000 (07:17 -0300)]
[media] DocBook: fix typo: vl42_plane_pix_format -> v4l2_plane_pix_format

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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>