Commit Graph

10294 Commits

Author SHA1 Message Date
Michael Grzeschik
45f4d4e879 V4L/DVB: mx2_camera: add informative camera clock frequency printout
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:18 -02:00
Baruch Siach
7c6b731970 V4L/DVB: mx2_camera: implement forced termination of active buffer for mx25
This allows userspace to terminate a capture without waiting for the current
frame to complete.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:17 -02:00
Baruch Siach
88bfd0bd7f V4L/DVB: mx2_camera: fix comment typo
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:17 -02:00
Michael Grzeschik
7c3a2066aa V4L/DVB: mx2_camera: remove emma limitation for RGB565
In the current source status the emma has no limitation for any PIXFMT
since the data is parsed raw and unprocessed into the memory.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:17 -02:00
Michael Grzeschik
ec73365bd4 V4L/DVB: mt9m111: register cleanup hex to dec bitoffset
Signed-off-by: Philipp Wiesner <p.wiesner@phytec.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:17 -02:00
Hans Verkuil
873ecd8f8f V4L/DVB: cpia2: remove V4L1 support from this driver
V4L1 is deprecated and will be removed completely soon.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:17 -02:00
Mauro Carvalho Chehab
401e5f8d38 V4L/DVB: em28xx: fix a compilation warning
drivers/media/video/em28xx/em28xx-video.c: In function ‘vidioc_s_register’:
drivers/media/video/em28xx/em28xx-video.c:1617: warning: unused variable ‘rc’

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:16 -02:00
Hans Verkuil
361ae54fc7 V4L/DVB: radio-mr800: remove BKL
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:15 -02:00
Hans Verkuil
d5906dd656 V4L/DVB: em28xx: the default std was not passed on to the subdevs
The initial em28xx std (PAL) was not passed on to the subdevs. This led to
these tvp5150 kernel log errors when running v4l2-ctl --all:

tvp5150 0-005c: VBI can't be configured without knowing number of lines

The reason was that tvp5150 was still using its own internal default: STD_ALL.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:15 -02:00
Hans Verkuil
0499a5aa77 V4L/DVB: em28xx: remove BKL
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:15 -02:00
Hans Verkuil
fedc6c81fa V4L/DVB: vivi: remove BKL
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:15 -02:00
Hans Verkuil
0e0809a588 V4L/DVB: videobuf: add queue argument to videobuf_waiton()
videobuf_waiton() must unlock and relock ext_lock if it has to wait.
For that to happen it needs the videobuf_queue pointer.

Don't attempt to unlock/relock q->ext_lock unless it was locked in the
first place.

vb->state has to be protected by a spinlock to be safe.

This patch is based on code from Mauro Carvalho Chehab <mchehab@redhat.com>.

[mchehab@redhat.com: add extra argument to a few missing places]
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:14 -02:00
Hans Verkuil
08bff03ed6 V4L/DVB: videobuf: add ext_lock argument to the queue init functions
Add an ext_lock argument to the videobuf init functions. This allows
drivers to pass the vdev->lock pointer (or any other externally held lock)
to videobuf. For now all drivers just pass NULL.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:14 -02:00
Hans Verkuil
9739768788 V4L/DVB: videobuf: prepare to make locking optional in videobuf
Currently videobuf uses the vb_lock mutex to lock its data structures.
But this locking will (optionally) move into the v4l2 core, which means
that in that case vb_lock shouldn't be used since the external lock is already
held.

Prepare for this by adding a pointer to such an external mutex and
don't lock if that pointer is set.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:14 -02:00
Hans Verkuil
ee6869afc9 V4L/DVB: v4l2: add core serialization lock
Drivers can optionally set a pointer to a mutex in struct video_device.
The core will use that to lock before calling open, read, write, unlocked_ioctl,
poll, mmap or release.

Updated the documentation as well and ensure that v4l2-event knows about the
lock: it will unlock it before doing a blocking wait on an event and relock it
afterwards.

Ensure that the 'video_is_registered' check is done when the lock is held:
a typical disconnect will take the lock as well before unregistering the
device nodes, so to prevent race conditions the video_is_registered check
should also be done with the lock held.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:14 -02:00
Hans Verkuil
c29fcff3da V4L/DVB: v4l2-dev: remove get_unmapped_area
The get_unmapped_area file operation is unused. Remove.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:14 -02:00
Hans Verkuil
d69f27186c V4L/DVB: v4l2-dev: after a disconnect any ioctl call will be blocked
Until now all fops except release and (unlocked_)ioctl returned an error
after the device node was unregistered. Extend this as well to the ioctl
fops. There is nothing useful that an application can do here and it
complicates the driver code unnecessarily.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:14 -02:00
Mauro Carvalho Chehab
96322b80e2 V4L/DVB: Deprecate stradis driver
The driver author seems to not worked on this driver since its conversion
from 2.2 to 2.4. Nobody is known to have a stradis hardware for testing. As
it still uses V4L1 API, BKL and probably some other old stuff, someone would
need to work on it to preserve the driver. Instead of investing time and
efforts to keep porting it to work with new API's, it seems better to just
drop the driver.

So, let's move it to drivers/staging and label it to die at 2.6.38, if nobody
cares enough to port parallel port support to gspca or to create a new driver
that uses the same gspca-cpia sub-driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:13 -02:00
Mauro Carvalho Chehab
7af97effb3 V4L/DVB: Deprecate cpia driver (used for parallel port webcams)
cpia driver were re-written inside gspca driver, for USB devices. The only
functionality that were not migrated is the support for parallel port,
as:
	1) the developer didn't find any hardware;
	2) it doesn't  seem important to keep support for a parallel port webcam,
	   as this is an obsolete technology;
	3) the changes at gspca for it to work with parallel port would be very large;
	4) this driver still uses BKL.

So, let's move it to drivers/staging and label it to die at 2.6.38, if nobody
cares enough to port parallel port support to gspca or to create a new driver
that uses the same gspca-cpia sub-driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:13 -02:00
Mauro Carvalho Chehab
da497e30c1 V4L/DVB: cx88: Remove BKL
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:13 -02:00
Mauro Carvalho Chehab
8979e9d42b V4L/DVB: bttv: use unlocked ioctl
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:13 -02:00
Mauro Carvalho Chehab
c37db91fd0 V4L/DVB: bttv: fix driver lock and remove explicit calls to BKL
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:13 -02:00
Mauro Carvalho Chehab
ca960bfe13 V4L/DVB: bttv: Fix mutex unbalance at bttv_poll
Don't do double mutex_unlock when reading a stream at bttv_poll.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:12 -02:00
Mauro Carvalho Chehab
8822f0d60b V4L/DVB: bttv-driver: document functions using mutex_lock
There are a few ancillary static routines used by ioctl functions
that takes bttv lock internally. As we'll be adding the same lock
for all ioctl's that need, we need to properly document them, to
avoid doing double locks

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:12 -02:00
Mauro Carvalho Chehab
f2f8e8503e V4L/DVB: radio-si470x: use unlocked ioctl
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:12 -02:00
Mauro Carvalho Chehab
cf9b475d5f V4L/DVB: radio-si470x: remove the BKL lock used internally at the driver
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:12 -02:00
Anatolij Gustschin
e69e34e9d9 V4L/DVB: v4l: fsl-viu.c: add slab.h include to fix compile breakage
mpc512x kernel configurations without SPI support do not build:

drivers/media/video/fsl-viu.c: In function 'viu_open':
drivers/media/video/fsl-viu.c:1248: error: implicit declaration of function 'kzalloc'
drivers/media/video/fsl-viu.c:1248: warning: assignment makes pointer from integer without a cast
drivers/media/video/fsl-viu.c: In function 'viu_release':
drivers/media/video/fsl-viu.c:1335: error: implicit declaration of function 'kfree'

If CONFIG_SPI is enabled, the slab.h will be included in
linux/spi/spi.h which is included by media/v4l2-common.h
and the fsl_viu.c driver builds.

Let's incluce linux/slab.h directly to fix the build breakage.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:12 -02:00
Arnd Bergmann
104a698657 V4L/DVB: dvb/bt8xx: kill the big kernel lock
The bt8xx driver only uses the big kernel lock in its dst_ca_ioctl
function and never to serialize against other code, so we can
trivially replace it with a private mutex.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:12 -02:00
Arnd Bergmann
e4e62b35b8 V4L/DVB: dvb-core: kill the big kernel lock
The dvb core only uses the big kernel lock in the open
and ioctl functions, which means it can be replaced with
a dvb specific mutex. Fortunately, all the ioctl functions
go through dvb_usercopy, so we can move the serialization
in there.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:11 -02:00
Joe Perches
634c693163 V4L/DVB: drivers/media/video/zoran: Don't use initialized char array
Just fill the array as necessary and terminate with 0

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:11 -02:00
Andy Shevchenko
5cac1f665f V4L/DVB: media: cx23885: use '%pM' format to print MAC address
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:11 -02:00
Jean Delvare
f89ca6fae2 V4L/DVB: cx22702: Simplify cx22702_set_tps()
Code in function cx22702_set_tps() can be slightly simplified.
Apparently gcc was smart enough to optimize it anyway, but it can't
hurt to make the code more readable.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:10 -02:00
Jean Delvare
bdc6fad341 V4L/DVB: cx22702: Some things never change
The init sequence never changes so it can be marked const. Likewise,
cx22702_ops is a template and can thus be made read-only.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:10 -02:00
Jean Delvare
27f84acf0b V4L/DVB: cx22702: Avoid duplicating code in branches
Calling the same functions in if/else or switch/case branches is
inefficient. Refactor the code for a smaller binary and increased
readability.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:10 -02:00
Mauro Carvalho Chehab
896c1422ed V4L/DVB: saa7134: split RC code into a different module
This allows the removal of CONFIG_INPUT from saa7134, and
helps to create a better Kconfig dependency hierarchy.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:09 -02:00
Mauro Carvalho Chehab
e051f69ae3 V4l/DVB: saa7134: properly mark some functions as static
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:09 -02:00
Hans Verkuil
92d474bd29 V4L/DVB: tvaudio: remove obsolete tda8425 initialization
The tda8425 initialization function sets up the inputmap for riva boards.
After some digging I discovered that this was for the V4L rivatv driver
that is found on sourceforge. This driver hasn't been maintained since the
last 5 years and will no longer work with the current v4l framework.

So we can safely remove this.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:09 -02:00
Jean Delvare
5b9a6f37ab V4L/DVB: cx22702: Drop useless initializations to 0
These variables are either unconditionally set right afterward, or
already set to 0 by kzalloc.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:09 -02:00
Jean Delvare
24764107ec V4L/DVB: cx22702: Clean up register access functions
* Avoid temporary variables.
* Optimize success paths.
* Make error messages consistently verbose.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:09 -02:00
Thomas Gleixner
a0a4714c40 V4L/DVB: dvb: Convert "mutex" to semaphore
Get rid of init_MUTEX[_LOCKED]() and use sema_init() instead.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:08 -02:00
Jarod Wilson
df1868e4ee V4L/DVB: IR/lirc_dev: check for valid irctl in unregister path
Prompted by Red Hat bugzilla #633023

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:08 -02:00
Jarod Wilson
04292fc003 V4L/DVB: IR/imon: set up mce-only devices w/mce keytable
Currently, they get set up with the pad keytable, which they can't
actually use at all. Also add another variant of volume scancodes from
another 0xffdc device, and properly set up the 0x9e 0xffdc device as an
iMON VFD w/MCE proto IR.

Based on data and a prior patch from Anders Eriksson on the lirc list.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:08 -02:00
Jarod Wilson
693508df98 V4L/DVB: IR/imon: protect ictx's kc and last_keycode w/spinlock
Lest we get our keycodes wrong... Thus far, in practice, I've not found
it to actually matter, but its one of the issues raised in
https://bugzilla.kernel.org/show_bug.cgi?id=16351 that wasn't addressed
by converting to using native IR keydown/up functions.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:07 -02:00
David Härdeman
eaf2bcc923 V4L/DVB: imon: split mouse events to a separate input dev
This is a stab at separating the mouse (and front panel/knob) events
out to a separate input device. This is necessary in preparation for
the next patch which makes the rc-core input dev opaque to rc
drivers.

I can't verify the correctness of the patch beyond the fact that it
compiles without warnings. The driver has resisted most of my
attempts at understanding it properly...for example, the double calls
to le64_to_cpu() and be64_to_cpu() which are applied in
imon_incoming_packet() and imon_panel_key_lookup() would amount
to a bswab64() call, irregardless of the cpu endianness, and I think
the code wouldn't have worked on a big-endian machine...

- Minor alterations to apply with minimal core IR changes
- Use timer for imon keys too, since its entirely possible for the
  receiver to miss release codes (either by way of another key being
  pressed while the first is held or by the remote pointing away from
  the recevier when the key is release. yes, I know, its ugly).
- Bump driver version number, since this is a fairly significant change
  (for the much much better).
Tested successfully w/an imon knob receiver.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:07 -02:00
Jarod Wilson
ee08940531 V4L/DVB: IR: export ir_keyup so imon driver can use it directly
The imon driver currently reimplements its own version of ir_keyup
(along with key release timer functionality also already present in the
core IR code). A follow-up imon patch will make use of ir_keyup and the
IR stack's key release code.

Trivial extraction from David Härdeman's pending rc-core merge and
device interface abstraction patchset to facilitate merging a patch
based on his imon input dev split patch ahead of the larger churn, which
is slated for post-2.6.37-rc1 (after Dmitry's large keycode patches are
merged in mainline).

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:07 -02:00
Mauro Carvalho Chehab
c72ba8e6ae V4L/DVB: saa7134: get rid of I2C_HW_SAA7134
The only reason for keeping I2C_HW_SAA7134 is to allow setting a
per-device polling interval. Just move this info to the platform
data, allowing drivers to change it per device, where needed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:07 -02:00
Mauro Carvalho Chehab
44243fc2ef V4L/DVB: Remove the usage of I2C_HW_B_CX2388x on ir-kbd-i2c.c
Move the cx88 specific initialization for Hauppauge XVR remotes
into cx88-input, removing the need for test it inside ir-kbd-i2c.

The reference at cx88 for this symbol, at:

drivers/media/video/cx88/cx88-i2c.c:    core->i2c_adap.id = I2C_HW_B_CX2388x;
drivers/media/video/cx88/cx88-vp3054-i2c.c:     vp3054_i2c->adap.id = I2C_HW_B_CX2388x;

Can't be removed yet, since lirc-i2c still uses it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:07 -02:00
Mauro Carvalho Chehab
c0c4682627 V4L/DVB: bttv: Move PV951 IR to the right driver
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:07 -02:00
Hans Verkuil
8403472f19 V4L/DVB: usbvision: remove BKL from usbvision
Removed the BKL from usbvision.

There was an initialization bug as well where the i2c bus was registered twice.

Although when the BKL was present no oops was generated, I did run into
other i2c problems. Now that I protect against duplicate i2c registration
that bug is now gone as well.

But trying to disconnect the USB cable while someone is still using the device
still leads to a crash.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:06 -02:00
Hans Verkuil
a40231a67c V4L/DVB: ir-kbd-i2c: remove obsolete I2C_HW_B_CX2341X test
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:05 -02:00
Hans Verkuil
a644c072ea V4L/DVB: saa7146/tuner: remove mxb hack
Remove a hack in the tuner code for the mxb board. This hack is no longer
needed since the tuner is now probed on its correct address as specified
by the mxb driver.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:05 -02:00
Hans Verkuil
1edc246c32 V4L/DVB: v4l: remove unused i2c-id.h headers
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:05 -02:00
Hans Verkuil
978cff6bf3 V4L/DVB: au8522_decoder: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:04 -02:00
Hans Verkuil
da48a8dd32 V4L/DVB: ks0127: remove obsolete v4l2_i2c_drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:04 -02:00
Hans Verkuil
c9611802b6 V4L/DVB: adv7170: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:04 -02:00
Hans Verkuil
ad62cdfe39 V4L/DVB: cx25840: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:04 -02:00
Hans Verkuil
96209a202a V4L/DVB: saa7127: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:04 -02:00
Hans Verkuil
37a0cfcb47 V4L/DVB: upd64083: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:03 -02:00
Hans Verkuil
c771145bf3 V4L/DVB: tvp5150: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:03 -02:00
Hans Verkuil
c2d999f316 V4L/DVB: vpx3220: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:03 -02:00
Hans Verkuil
50337aceff V4L/DVB: cs53l32a: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:03 -02:00
Hans Verkuil
e2c52ba680 V4L/DVB: tea6420: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:03 -02:00
Hans Verkuil
5b9f80af0c V4L/DVB: tda7432: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:03 -02:00
Hans Verkuil
ff6e5422e4 V4L/DVB: saa7110: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:02 -02:00
Hans Verkuil
cd5882c531 V4L/DVB: tda9875: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:02 -02:00
Hans Verkuil
02a2098adb V4L/DVB: tuner: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:02 -02:00
Hans Verkuil
8e71ff0a48 V4L/DVB: tlv320aic23b: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:02 -02:00
Hans Verkuil
3f4172007a V4L/DVB: bt856: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:02 -02:00
Hans Verkuil
534d4f832f V4L/DVB: saa7191: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:02 -02:00
Hans Verkuil
dc71443f46 V4L/DVB: adv7175: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:01 -02:00
Hans Verkuil
a5b2c49386 V4L/DVB: wm8775: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:01 -02:00
Hans Verkuil
7a004d135c V4L/DVB: tvaudio: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:00 -02:00
Hans Verkuil
0c748826fe V4L/DVB: tea6415c: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:00 -02:00
Hans Verkuil
7a49e54018 V4L/DVB: bt866: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:00 -02:00
Hans Verkuil
61a489c8ba V4L/DVB: msp3400: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:00 -02:00
Hans Verkuil
dfc5a0161f V4L/DVB: saa7185: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:59 -02:00
Hans Verkuil
d30f60b3d6 V4L/DVB: m52790: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:59 -02:00
Hans Verkuil
9f490cd632 V4L/DVB: indycam: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:59 -02:00
Hans Verkuil
00cc8db8ee V4L/DVB: bt819: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:59 -02:00
Hans Verkuil
099bd5e3be V4L/DVB: saa6752hs: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:59 -02:00
Hans Verkuil
440d051616 V4L/DVB: saa6588: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:59 -02:00
Hans Verkuil
962961ef72 V4L/DVB: upd64031a: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:58 -02:00
Hans Verkuil
6ce58bead3 V4L/DVB: mt9v011: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:58 -02:00
Hans Verkuil
ef2ac770cd V4L/DVB: ov7670: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:58 -02:00
Hans Verkuil
cb595b5160 V4L/DVB: tda9840: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:58 -02:00
Hans Verkuil
aac235384d V4L/DVB: saa7115: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:58 -02:00
Hans Verkuil
720d916e64 V4L/DVB: saa717x: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:58 -02:00
Hans Verkuil
51e868466d V4L/DVB: cs5345: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:57 -02:00
Hans Verkuil
49facfaaf5 V4L/DVB: wm8739: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:57 -02:00
Hans Verkuil
1f3526673f V4L/DVB: vp27smpx: remove obsolete v4l2-i2c-drv.h header
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:57 -02:00
Hans Verkuil
7074f40719 V4L/DVB: pwc: remove BKL
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:57 -02:00
Hans Verkuil
479567ce3a V4L/DVB: pwc: fully convert driver to V4L2
Remove the V4L1 API from this driver, making it fully V4L2.

Also fix a bug where the /dev/videoX device was created too early, which led
to initialization problems of the camera, making it unable to capture video.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:57 -02:00
Andy Walls
47399d98e7 V4L/DVB: gspca_cpia1: Disable illuminator controls if not an Intel Play QX3
The illuminator controls should only be available to the user for the Intel
Play QX3 microscope.  The implementation to inhibit the controls is intended to
be consistent with the other gspca driver implementations.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:55 -02:00
Andy Walls
c67be3ccd7 V4L/DVB: gspca_cpia1: Restore QX3 illuminators' state on resume
Turn the lights of the QX3 on (or off) as needed when resuming and at module load.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:55 -02:00
Andy Walls
51513353ec V4L/DVB: gspca_cpia1: Add basic v4l2 illuminator controls for the Intel Play QX3
This patch adds basic V4L2 controls for the illuminators on the Intel
Play QX3 microscope.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:55 -02:00
Jean-François Moine
008d35f2f5 V4L/DVB: v4l2: Add illuminator controls
Some media devices (microscopes) may have one or many illuminators.
This patch makes them controlable by the applications.

Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:54 -02:00
Alexander Goncharov
2a3b501ffd V4L/DVB: gspca - sonixj: Add webcam 0c45:612b
Signed-off-by: Alexander Goncharov <alexzandersss@gmail.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:54 -02:00
Jean-François Moine
860e7f474c V4L/DVB: gspca - sonixj: Webcam 0c45:6102 added
Tested-by: Simon Danner <simon@danner-urloffen.de>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:54 -02:00
Jean-François Moine
9b1d3caea9 V4L/DVB: gspca - sn9c20x: Better image sizes
When compressed, the images take less than one byte per pixel.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:54 -02:00
Jean-François Moine
b1e4665b66 V4L/DVB: gspca - sn9c20x: Fix the number of bytes per line
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:54 -02:00
Jean-François Moine
0b656321f3 V4L/DVB: gspca - all modules: Display error messages when gspca debug disabled
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:53 -02:00
Jean-François Moine
548264375b V4L/DVB: gspca - all modules: Remove useless module load/unload messages
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:52 -02:00
Antti Palosaari
ed19a5db78 V4L/DVB: af9015: use value from config instead hardcoded one
Replace 2nd demod default address 0x3a with value got from eeprom config.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:52 -02:00
Antti Palosaari
9b22edd4b0 V4L/DVB: af9013: optimize code size
Optimize af9013_set_coeff(). Move configuration values to own table.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:52 -02:00
Antti Palosaari
d3bb73de97 V4L/DVB: af9015: reimplement remote controller
Remove HID and polling via firmware API. Implement direct access to remote codes via memory read and write.

HID and polling via firmware api never worked 100% well and there was also some limitations which tied used remote and device together.

After that it is possible to use upcoming kernel remote controller core.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:52 -02:00
Antti Palosaari
2ec01b41e3 V4L/DVB: af9015: map TerraTec Cinergy T Stick Dual RC remote to device ID
Detect TerraTec Cinergy T Stick Dual RC	remote config using device
USB ID instead of device EEPROM hash. It was found that there is
devices	with slightly different EEPROM content...

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:52 -02:00
Antti Palosaari
86dcab6445 V4L/DVB: af9015: add remote support for TerraTec Cinergy T Stick Dual RC
Thanks to the TerraTec!

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:52 -02:00
Antti Palosaari
ab07fdd691 V4L/DVB: af9015: add support for TerraTec Cinergy T Stick Dual RC
Add USB ID [0ccd:0099] for TerraTec Cinergy T Stick Dual RC.
Device is based for AF9015 + AF9013 + 2 x MxL5007T chips.

Thanks to the TerraTec!

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:51 -02:00
Antti Palosaari
a4f31d0da5 V4L/DVB: af9013: add support for MaxLinear MxL5007T tuner
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:51 -02:00
Antti Palosaari
76391a7154 V4L/DVB: af9015: fix bug introduced by commit 490ade7e3f4474f626a8f5d778ead4e599b94fbc
Commit 490ade7e3f4474f626a8f5d778ead4e599b94fbc	merge conflict fix
leads situation	where last nine device definitions were overridden mistakenly.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:51 -02:00
Antti Palosaari
a44b91d9fe V4L/DVB: af9015: simple comment update
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:50 -02:00
Mats Randgaard
11382f3d8a V4L/DVB: vpif_cap: don't ignore return code of videobuf_poll_stream()
Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:50 -02:00
Mats Randgaard
1f8766b4e3 V4L/DVB: vpif_cap/disp: Replaced kmalloc with kzalloc
Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:49 -02:00
Mats Randgaard
ffa1b391c6 V4L/DVB: vpif_cap/disp: Removed section mismatch warning
Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:49 -02:00
Hans Verkuil
226c0eeaea V4L/DVB: videotext: remove this obsolete API
Remove the vtx (aka videotext aka teletext) API from the v4l2 core.
This API was scheduled for removal in kernel 2.6.35.

The vtx device nodes have been superseded by vbi device nodes
for many years. No applications exist that use the vtx support.
Of the two i2c drivers that actually support this API the saa5249
has been impossible to use for a year now and no known hardware
that supports this device exists. The saa5246a is theoretically
supported by the old mxb boards, but it never actually worked.

In summary: there is no hardware that can use this API and there
are no applications actually implementing this API.

The vtx support still reserves minors 192-223 and we would really
like to reuse those for upcoming new functionality. In the unlikely
event that new hardware appears that wants to use the functionality
provided by the vtx API, then that functionality should be build
around the sliced VBI API instead.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:48 -02:00
Hans Verkuil
563711f16f V4L/DVB: saa5246a/saa5249: Remove obsolete teletext drivers
These old i2c teletext drivers are not supported by any hardware and cannot be
tested anymore.

Note that while the mxb board seemingly used the saa5246a driver, in reality
this teletext driver never worked.

These drivers are removed as part of the vtx feature removal, originally
scheduled for 2.6.35.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:05:48 -02:00
Malcolm Priestley
be96624a38 V4L/DVB: STV0288 Incorrect bit sample for Vitterbi status
bit 3(LK) indicates that the Vstatus is locked.
Currently using bit 7(CF) which is usually present, results in early
aborted search in FEC_AUTO and missing channels.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:58 -02:00
Malcolm Priestley
d2f918bba7 V4L/DVB: Support or LME2510(C) DM04/QQBOX USB DVB-S BOXES
DM04/QQBOX DVB-S USB BOX with LME2510C+SHARP:BS2F7HZ7395 or LME2510+LGTDQT-P001F tuner.

[mchehab@redhat.com: Fix merge conflicts/compilation and CodingStyle issues]
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:54 -02:00
Mauro Carvalho Chehab
9d10f3d7e7 V4L/DVB: ix2505v: make scripts/checkpatch.pl happy
WARNING: please, no space before tabs
+ *  ^IPOR = Power on Reset (VCC H=<2.2v L=>2.2v)$

WARNING: unnecessary whitespace before a quoted newline
+	deb_info("Frq=%d x=%d N=%d A=%d \n", frequency, x, N, A);

WARNING: please, no space before tabs
+^Ielse ^I^I/*frequency up to 2150000*/$

WARNING: unnecessary whitespace before a quoted newline
+	deb_info("Data 0=[%x%x%x%x] \n", data[0], data[1], data[2], data[3]);

WARNING: unnecessary whitespace before a quoted newline
+	deb_info("Data 2=[%x%x] \n", data[2], data[3]);

Cc: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:53 -02:00
Malcolm Priestley
1ae2c5893d V4L/DVB: Support for Sharp IX2505V (marked B0017) DVB-S silicon tuner
Tuner used in Sharp BS2F7VZ7395 dvbs module.
When ix2505v tuner is attached to stv0288 form this module.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:53 -02:00
Julia Lawall
f78729b40a V4L/DVB: drivers/media/dvb/siano: Remove double test
The same expression is tested twice and the result is the same each time.

The sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@expression@
expression E;
@@

(
* E
  || ... || E
|
* E
  && ... && E
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:53 -02:00
Julia Lawall
6b81bef8cd V4L/DVB: drivers/media/video/em28xx: Remove potential NULL dereference
If the NULL test is necessary, the initialization involving a dereference of
the tested value should be moved after the NULL test.

The sematic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
expression E;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E
      when != i
  if (E == NULL) S
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:53 -02:00
Stefan Lippers-Hollmann
d7ef485daa V4L/DVB: af9015: add USB ID for Terratec Cinergy T Stick RC MKII
Adding the USB ID for my TerraTec Electronic GmbH Cinergy T RC MKII
[0ccd:0097] and hooking it up into af9015, on top of your new NXP TDA18218
patches, makes it work for me.

Just the shipped IR remote control doesn't seem to create keycode events
yet (tested with different remote=%d parameters), are there any hints to
add support for that?

[    2.250022] usb 1-10: new high speed USB device using ehci_hcd and address 5
[    2.369287] usb 1-10: New USB device found, idVendor=0ccd, idProduct=0097
[    2.369290] usb 1-10: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.369293] usb 1-10: Product: USB2.0 DVB-T TV Stick
[    2.369294] usb 1-10: Manufacturer: NEWMI
[    2.369296] usb 1-10: SerialNumber: 010101010600001
[    2.534023] usbcore: registered new interface driver hiddev
[    2.537235] input: NEWMI USB2.0 DVB-T TV Stick as /devices/pci0000:00/0000:00:02.1/usb1/1-10/1-10:1.1/input/input0
[    2.537323] generic-usb 0003:0CCD:0097.0001: input,hidraw0: USB HID v1.01 Keyboard [NEWMI USB2.0 DVB-T TV Stick] on usb-0000:00:02.1-10/input1
[    2.537349] usbcore: registered new interface driver usbhid
[    2.537351] usbhid: USB HID core driver
[    3.263177] generic-usb 0003:04D9:1603.0002: input,hidraw1: USB HID v1.10 Keyboard [  USB Keyboard] on usb-0000:00:02.0-8.1/input0
[    3.286946] generic-usb 0003:04D9:1603.0003: input,hidraw2: USB HID v1.10 Device [  USB Keyboard] on usb-0000:00:02.0-8.1/input1
[    3.467136] generic-usb 0003:046D:C050.0004: input,hidraw3: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:02.0-8.2/input0
[    3.660890] generic-usb 0003:10D5:000D.0005: input,hidraw4: USB HID v1.10 Keyboard [No brand SP02-A1] on usb-0000:00:02.0-8.3/input0
[    5.567632] dvb-usb: found a 'TerraTec Cinergy T Stick RC' in cold state, will try to load a firmware
[    5.693497] dvb-usb: downloading firmware from file 'dvb-usb-af9015.fw'
[    5.773109] dvb-usb: found a 'TerraTec Cinergy T Stick RC' in warm state.
[    5.773168] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[    5.774290] DVB: registering new adapter (TerraTec Cinergy T Stick RC)
[    6.007696] af9013: firmware version:5.1.0
[    6.010843] DVB: registering adapter 0 frontend 0 (Afatech AF9013 DVB-T)...
[    6.032697] tda18218: NXP TDA18218HN successfully identified.
[    6.034442] dvb-usb: TerraTec Cinergy T Stick RC successfully initialized and connected.
[    6.040612] usbcore: registered new interface driver dvb_usb_af9015

[mchehab@redhat.com: Fix merge conflict with another board addition]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:52 -02:00
lawrence rust
2e4e98e788 V4L/DVB: drivers/media: Make static data tables and strings const
Making static data const avoids allocation of additional r/w memory and
reduces initialisation time.  It also provides some additional opportunities
for compiler optimisations.

Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:52 -02:00
Mauro Carvalho Chehab
b6b85ff87b V4L/DVB: cx88: Fix some gcc warnings
drivers/media/video/cx88/cx88-dsp.c: In function ‘detect_a2_a2m_eiaj’:
drivers/media/video/cx88/cx88-dsp.c:158: warning: ‘carrier_freq’ may be used uninitialized in this function
drivers/media/video/cx88/cx88-dsp.c:158: warning: ‘stereo_freq’ may be used uninitialized in this function
drivers/media/video/cx88/cx88-dsp.c:158: warning: ‘dual_freq’ may be used uninitialized in this function

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:52 -02:00
Laurent Pinchart
c4ce6d14b9 V4L/DVB: v4l: Use v4l2_get_subdevdata instead of accessing v4l2_subdev::priv
Replace direct access to the v4l2_subdev priv field with the inline
v4l2_get_subdevdata method.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:51 -02:00
lawrence rust
d06b49ed18 V4L/DVB: cx88: convert core->tvaudio into an enum
Using an enum and removing the default case from switch statements accessing
the value enables the compiler to emit a warning (enabled with -Wall) when an
audio mode is not handled.

This highlights an omission in the function cx88_dsp_detect_stereo_sap()
(in cx88-dsp.c) not handling WW_EIAJ and WW_M.

Signed-off-by: Lawrence Rust <lawrence@softsystem.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:49 -02:00
Julia Lawall
3053814c1c V4L/DVB: drivers/media/video: Use available error codes
Error codes are stored in rc, but the return value is always 0.  Return rc
instead.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
local idexpression x;
constant C;
@@

if (...) { ...
  x = -C
  ... when != x
(
  return <+...x...+>;
|
  return NULL;
|
  return;
|
* return ...;
)
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:48 -02:00
Julia Lawall
f277097929 V4L/DVB: drivers/media: Use available error codes
In each case, error codes are stored in rc, but the return value is always
0.  Return rc instead.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
local idexpression x;
constant C;
@@

if (...) { ...
  x = -C
  ... when != x
(
  return <+...x...+>;
|
  return NULL;
|
  return;
|
* return ...;
)
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:48 -02:00
Julia Lawall
46a7a3cc9f V4L/DVB: drivers/media/video/zoran: Use available error codes
Error codes are stored in res, but the return value is always 0.  Return
res instead.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
local idexpression x;
constant C;
@@

if (...) { ...
  x = -C
  ... when != x
(
  return <+...x...+>;
|
  return NULL;
|
  return;
|
* return ...;
)
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:48 -02:00
Julia Lawall
473d802473 V4L/DVB: drivers/media/video: Adjust confusing if indentation
In cx23885/cx23885-video.c, cx88/cx88-video.c, davinci/vpif_capture.c, and
davinci/vpif_display.c, group the aligned code into a single if branch.

In saa7134/saa7134-video.c, outdent the code following the if.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable braces4@
position p1,p2;
statement S1,S2;
@@

(
if (...) { ... }
|
if (...) S1@p1 S2@p2
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

if (p1[0].column == p2[0].column):
  cocci.print_main("branch",p1)
  cocci.print_secs("after",p2)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:48 -02:00
Guennadi Liakhovetski
6c2d4dd139 V4L/DVB: V4L2: avoid name conflicts in macros
"sd" and "err" are too common names to be used in macros for local variables.
Prefix them with an underscore to avoid name clashing.

[mchehab@redhat.com: whitespace cleanups]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Reviewed-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:48 -02:00
Jarod Wilson
7a569f524d V4L/DVB: IR/streamzap: functional in-kernel decoding
This patch makes in-kernel decoding with the stock Streamzap PC Remote
work out of the box. There are quite a few things going on in this
patch, all related to getting this working:

1) I had to enable reporting of a long space at the end of each signal,
   or I had weird buffering and keybounce issues.

2) The keymap has been reworked slightly to match actual decoded values,
   the first edition was missing the pre-data bits present in the lirc
   config file for this remote.

3) There's a whole new decoder included, specifically for the
   not-quite-RC5 15-bit protocol variant used by the Streamzap PC
   Remote. The decoder, while usable with other recievers (tested with
   an mceusb receiver), will only be loaded by the streamzap driver, as
   its likely not of use in almost all other situations. This can be
   revisited if/when all keytable loading (and disabling of unneeded
   protocol decoder engines) is moved to userspace, but for now, I think
   this makes the most sense.

Note that I did try to enable handling the streamzap RC5-ish protocol in
the current RC5 decoder, but there's no particularly easy way to tell if
its 14-bit RC5 or 15-bit Streamzap until we see bit 14, and even then,
in testing an attempted decoder merge, only 2/3 of the keys were
properly recognized as being the 15-bit variant and decoded correctly,
the rest were close enough to compliant with 14-bit that they were
decoded as such (but they have overlap with one another, and thus we
can't just shrug and use the 14-bit decoded values).

Also of note in this patch is the removal of the streamzap driver's
internal delay buffer. Per discussion w/Christoph, it shouldn't be
needed by lirc any longer anyway, and it doesn't seem to make any
difference to the in-kernel decoder engine. That being the case, I'm
yanking it all out, as it greatly simplifies the driver code.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:47 -02:00
Mauro Carvalho Chehab
76e241d421 gspca/konica: Fix compilation merge conflict
drivers/media/video/gspca/konica.c: In function ‘sd_start’:
drivers/media/video/gspca/konica.c:322: error: implicit declaration of function ‘usb_buffer_alloc’
drivers/media/video/gspca/konica.c:325: warning: assignment makes pointer from integer without a cast
make[3]: ** [drivers/media/video/gspca/konica.o] Erro 1

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:46 -02:00
Hans de Goede
41f424ba4d V4L/DVB: gspca_xirlink_cit: adjust ibm netcam pro framerate for available bandwidth
gspca_xirlink_cit: adjust ibm netcam pro framerate for available bandwidth

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:46 -02:00
Hans de Goede
b517af7228 V4L/DVB: gspca_konica: New gspca subdriver for konica chipset using cams
This new driver replaces the (known to not work / crash) usbvideo konicawc
driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:46 -02:00
Hans de Goede
1fddcf0e8b V4L/DVB: gspca_*: correct typo in my email address in various subdrivers
gspca_*: correct typo in my email address in various subdrivers

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:46 -02:00
Hans de Goede
7b7736c451 V4L/DVB: Mark usbvideo ibmcam driver as deprecated
Mark usbvideo ibmcam driver as deprecated, it is replaced by the new
gscpa xirlink_cit driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:45 -02:00
Hans de Goede
59f8b0bf3c V4L/DVB: gspca_xirlink_cit: support bandwidth changing for devices with 1 alt setting
Some xirlink_cit models have only 1 alt setting, but the actual used
bandwidth can be programmed through a register use this to allow streaming
while other isoc streams (for example sound) are active at the same time.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:45 -02:00
Hans de Goede
55c1b7d357 V4L/DVB: gspca_xirlink_cit: Use alt setting -> fps formula for model 1 cams too
gspca_xirlink_cit: Use alt setting -> fps formula for model 1 cams too

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:45 -02:00
Hans de Goede
659fefa0eb V4L/DVB: gspca_xirlink_cit: Add support for camera with a bcd version of 0.01
Add support for camera with a bcd version of 0.01, I've dupped these
Model0 cams.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:45 -02:00
Hans de Goede
59f90a01e8 V4L/DVB: gspca_xirlink_cit: Add support for Model 1, 2 & 4 cameras
Note this is untested as I don't have hardware to test, but all
initsequences were taken over 1 on 1 from the old ibmcam driver so things
should work.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:45 -02:00
Hans de Goede
1f33de0f8b V4L/DVB: gspca_xirlink_cit: New gspca subdriver replacing v4l1 usbvideo/ibmcam.c
The old usbvideo ibmcam driver needs to be replaced with a v4l2 driver
preferably using the gspca webcam framework rather then the old usbvideo
framework.

This new gspca sub driver sets a first step in that direction. The ibmcam
driver supports 4 different model webcams. This new driver (for now) only
supports Model 3 cameras, as my test cam is a Model 3 cam, or so I thought.

Upon reading:
http://www.linux-usb.org/ibmcam/
I learned that the IBM Netcamera Pro I have even though having the same
usb id and the same bcd version is different from the Model 3 cameras
supported by the ibmcam driver. So this new gscpa subdriver supports Model 3
cameras (untested), and the IBM Netcamera Pro. Currently use with the
IBM Netcamera Pro requires a module parameter. I hope to be able to
autodetect which is which in the future.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:44 -02:00
Antti Palosaari
f1edeea6c2 V4L/DVB: af9015: add missing TDA18218 Kconfig option
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:42 -02:00
Antti Palosaari
ee3d440c0c V4L/DVB: af9015: add support for tda18218 silicon tuner
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:42 -02:00
Antti Palosaari
2158e5090b V4L/DVB: af9013: add support for tda18218 silicon tuner
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:42 -02:00
Antti Palosaari
51ff2e2c8e V4L/DVB: NXP TDA18218 silicon tuner driver
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:42 -02:00
Hans Verkuil
aabb541118 V4L/DVB: ov7670: remove obsolete enum/try/s_fmt ops
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:41 -02:00
Hans Verkuil
1e42622883 V4L/DVB: cafe_ccic: convert to the mediabus API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:41 -02:00
Hans Verkuil
959f3bdadf V4L/DVB: ov7670: add enum/try/s_mbus_fmt support
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:41 -02:00
Hans Verkuil
515d93fb23 V4L/DVB: tvp7002: remove obsolete enum/try/s/g_fmt
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:38 -02:00
Hans Verkuil
8f56aaa3e6 V4L/DVB: tvp514x: remove obsolete enum/try/s/g_fmt
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:37 -02:00
Hans Verkuil
d3ca77595f V4L/DVB: vpfe_capture: convert to new mediabus API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:37 -02:00
Hans Verkuil
db7b546040 V4L/DVB: tvp7002: add support for enum/try/g/s_mbus_fmt
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:37 -02:00
Hans Verkuil
838119138e V4L/DVB: tvp514x: add support for enum/g/try/s_mbus_fmt
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:36 -02:00
Arnd Bergmann
7ff52efdca dabusb: remove the BKL
The dabusb device driver is sufficiently serialized using
its own mutex, no need for the big kernel lock here
in addition.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
2010-10-19 11:30:00 +02:00
Arnd Bergmann
72024f1ec5 dvb-core: kill the big kernel lock
The dvb core only uses the big kernel lock in the open
and ioctl functions, which means it can be replaced with
a dvb specific mutex. Fortunately, all the ioctl functions
go through dvb_usercopy, so we can move the serialization
in there.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: linux-media@vger.kernel.org
2010-10-19 11:29:56 +02:00
Arnd Bergmann
adfedd216d dvb/bt8xx: kill the big kernel lock
The bt8xx driver only uses the big kernel lock in its dst_ca_ioctl
function and never to serialize against other code, so we can
trivially replace it with a private mutex.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: linux-media@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
2010-10-19 11:29:55 +02:00
Justin P. Mattock
631dd1a885 Update broken web addresses in the kernel.
The patch below updates broken web addresses in the kernel

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Finn Thain <fthain@telegraphics.com.au>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Dimitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Acked-by: Ben Pfaff <blp@cs.stanford.edu>
Acked-by: Hans J. Koch <hjk@linutronix.de>
Reviewed-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-10-18 11:03:14 +02:00
Linus Torvalds
3e645d6b48 v4l1: fix 32-bit compat microcode loading translation
The compat code for the VIDIOCSMICROCODE ioctl is totally buggered.
It's only used by the VIDEO_STRADIS driver, and that one is scheduled to
staging and eventually removed unless somebody steps up to maintain it
(at which point it should use request_firmware() rather than some magic
ioctl).  So we'll get rid of it eventually.

But in the meantime, the compatibility ioctl code is broken, and this
tries to get it to at least limp along (even if Mauro suggested just
deleting it entirely, which may be the right thing to do - I don't think
the compatibility translation code has ever worked unless you were very
lucky).

Reported-by: Kees Cook <kees.cook@canonical.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-15 11:12:38 -07:00
Arnd Bergmann
6038f373a3 llseek: automatically add .llseek fop
All file_operations should get a .llseek operation so we can make
nonseekable_open the default for future file operations without a
.llseek pointer.

The three cases that we can automatically detect are no_llseek, seq_lseek
and default_llseek. For cases where we can we can automatically prove that
the file offset is always ignored, we use noop_llseek, which maintains
the current behavior of not returning an error from a seek.

New drivers should normally not use noop_llseek but instead use no_llseek
and call nonseekable_open at open time.  Existing drivers can be converted
to do the same when the maintainer knows for certain that no user code
relies on calling seek on the device file.

The generated code is often incorrectly indented and right now contains
comments that clarify for each added line why a specific variant was
chosen. In the version that gets submitted upstream, the comments will
be gone and I will manually fix the indentation, because there does not
seem to be a way to do that using coccinelle.

Some amount of new code is currently sitting in linux-next that should get
the same modifications, which I will do at the end of the merge window.

Many thanks to Julia Lawall for helping me learn to write a semantic
patch that does all this.

===== begin semantic patch =====
// This adds an llseek= method to all file operations,
// as a preparation for making no_llseek the default.
//
// The rules are
// - use no_llseek explicitly if we do nonseekable_open
// - use seq_lseek for sequential files
// - use default_llseek if we know we access f_pos
// - use noop_llseek if we know we don't access f_pos,
//   but we still want to allow users to call lseek
//
@ open1 exists @
identifier nested_open;
@@
nested_open(...)
{
<+...
nonseekable_open(...)
...+>
}

@ open exists@
identifier open_f;
identifier i, f;
identifier open1.nested_open;
@@
int open_f(struct inode *i, struct file *f)
{
<+...
(
nonseekable_open(...)
|
nested_open(...)
)
...+>
}

@ read disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
<+...
(
   *off = E
|
   *off += E
|
   func(..., off, ...)
|
   E = *off
)
...+>
}

@ read_no_fpos disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
... when != off
}

@ write @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
<+...
(
  *off = E
|
  *off += E
|
  func(..., off, ...)
|
  E = *off
)
...+>
}

@ write_no_fpos @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
... when != off
}

@ fops0 @
identifier fops;
@@
struct file_operations fops = {
 ...
};

@ has_llseek depends on fops0 @
identifier fops0.fops;
identifier llseek_f;
@@
struct file_operations fops = {
...
 .llseek = llseek_f,
...
};

@ has_read depends on fops0 @
identifier fops0.fops;
identifier read_f;
@@
struct file_operations fops = {
...
 .read = read_f,
...
};

@ has_write depends on fops0 @
identifier fops0.fops;
identifier write_f;
@@
struct file_operations fops = {
...
 .write = write_f,
...
};

@ has_open depends on fops0 @
identifier fops0.fops;
identifier open_f;
@@
struct file_operations fops = {
...
 .open = open_f,
...
};

// use no_llseek if we call nonseekable_open
////////////////////////////////////////////
@ nonseekable1 depends on !has_llseek && has_open @
identifier fops0.fops;
identifier nso ~= "nonseekable_open";
@@
struct file_operations fops = {
...  .open = nso, ...
+.llseek = no_llseek, /* nonseekable */
};

@ nonseekable2 depends on !has_llseek @
identifier fops0.fops;
identifier open.open_f;
@@
struct file_operations fops = {
...  .open = open_f, ...
+.llseek = no_llseek, /* open uses nonseekable */
};

// use seq_lseek for sequential files
/////////////////////////////////////
@ seq depends on !has_llseek @
identifier fops0.fops;
identifier sr ~= "seq_read";
@@
struct file_operations fops = {
...  .read = sr, ...
+.llseek = seq_lseek, /* we have seq_read */
};

// use default_llseek if there is a readdir
///////////////////////////////////////////
@ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier readdir_e;
@@
// any other fop is used that changes pos
struct file_operations fops = {
... .readdir = readdir_e, ...
+.llseek = default_llseek, /* readdir is present */
};

// use default_llseek if at least one of read/write touches f_pos
/////////////////////////////////////////////////////////////////
@ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read.read_f;
@@
// read fops use offset
struct file_operations fops = {
... .read = read_f, ...
+.llseek = default_llseek, /* read accesses f_pos */
};

@ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier write.write_f;
@@
// write fops use offset
struct file_operations fops = {
... .write = write_f, ...
+	.llseek = default_llseek, /* write accesses f_pos */
};

// Use noop_llseek if neither read nor write accesses f_pos
///////////////////////////////////////////////////////////

@ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
identifier write_no_fpos.write_f;
@@
// write fops use offset
struct file_operations fops = {
...
 .write = write_f,
 .read = read_f,
...
+.llseek = noop_llseek, /* read and write both use no f_pos */
};

@ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier write_no_fpos.write_f;
@@
struct file_operations fops = {
... .write = write_f, ...
+.llseek = noop_llseek, /* write uses no f_pos */
};

@ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
@@
struct file_operations fops = {
... .read = read_f, ...
+.llseek = noop_llseek, /* read uses no f_pos */
};

@ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
@@
struct file_operations fops = {
...
+.llseek = noop_llseek, /* no read or write fn */
};
===== End semantic patch =====

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Julia Lawall <julia@diku.dk>
Cc: Christoph Hellwig <hch@infradead.org>
2010-10-15 15:53:27 +02:00
Marek Szyprowski
cc6e853c5e V4L/DVB: v4l: radio: si470x: fix unneeded free_irq() call
In case of error during probe() the driver calls free_irq() function
on not yet allocated irq. This patches fixes the call sequence in case of
the error.

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>
2010-09-30 07:22:41 -03:00
Pawel Osciak
b2b476f53a V4L/DVB: v4l: videobuf: prevent passing a NULL to dma_free_coherent()
When a driver that uses videobuf-dma-contig is used with the USERPTR
memory access method a kernel oops might happen: a NULL address may be
passed to dma_free_coherent(). This happens when an application calls
REQBUFS and then exits without queuing any buffers. This patch fixes
that bug.

Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-30 07:22:22 -03:00
Brian Rogers
a08c7c68f7 V4L/DVB: ir-core: Fix null dereferences in the protocols sysfs interface
For some cards, ir_dev->props and ir_dev->raw are both NULL. These cards are
using built-in IR decoding instead of raw, and can't easily be made to switch
protocols.

So upon reading /sys/class/rc/rc?/protocols on such a card, return 'builtin' as
the supported and enabled protocol. Return -EINVAL on any attempts to change
the protocol. And most important of all, don't crash.

Signed-off-by: Brian Rogers <brian@xyzw.org>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-30 07:18:37 -03:00
Sylwester Nawrocki
ddc79e0fdc V4L/DVB: v4l: s5p-fimc: Fix 3-planar formats handling and pixel offset error on S5PV210 SoCs
Fix DMA engine pixel offset calculation for 3-planar YUV formats.
On S5PV210 SoCs horizontal offset is applied as number of pixels,
not bytes per line.

[mchehab@redhat.com: CodingStyle cleanup]
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:39:16 -03:00
Pawel Osciak
81c69fc200 V4L/DVB: v4l: s5p-fimc: Fix return value on probe() failure
On failed create_workqueue() fimc_probe() was returning 0.

Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:37:48 -03:00
Laurent Pinchart
86d8b6abbb V4L/DVB: uvcvideo: Restrict frame rates for Chicony CNF7129 webcam
At all frame rates except 30fps and 5fps the camera produces very dark
pictures. Auto-exposure is probably disabled by the camera at all frame
rates except 30fps, making them pretty unusable.

Work around the problem by introducing a new RESTRICT_FRAME_RATE quirk
that disables all the frame rates except the default one.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:22:13 -03:00
Laurent Pinchart
9275b32bce V4L/DVB: uvcvideo: Fix support for Medion Akoya All-in-one PC integrated webcam
The camera requires the STREAM_NO_FID quirk. Add a corresponding entry
in the device IDs list.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:22:12 -03:00
Dan Rosenberg
4057079855 V4L/DVB: ivtvfb: prevent reading uninitialized stack memory
The FBIOGET_VBLANK device ioctl allows unprivileged users to read 16
bytes of uninitialized stack memory, because the "reserved" member of
the fb_vblank struct declared on the stack is not altered or zeroed
before being copied back to the user.  This patch takes care of it.

Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:22:11 -03:00
Andy Walls
fc00a1d90d V4L/DVB: cx25840: Fix typo in volume control initialization: 65335 vs. 65535
The wrong value for the volume control limit, 65335 vs. 65535,
prevents proper cx25840 v4l2_subdevice initialization.

Reported-by: Igor M. liplianin <liplianin@me.by>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:22:10 -03:00
Pawel Osciak
71088bad74 V4L/DVB: v4l: mem2mem_testdev: add missing release for video_device
Video device was not being released on driver remove.

Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:22:09 -03:00
Pawel Osciak
b17a200f92 V4L/DVB: v4l: mem2mem_testdev: fix errorenous comparison
Output buffer has to be at least the size of input buffer, not the other
way around.

Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:22:08 -03:00
Ionut Gabriel Popescu
23f0cb62ba V4L/DVB: mt9v022.c: Fixed compilation warning
The drivers/media/video/mt9v022.c file, on line 405, tries a "case 0" o a
v4l2_mbus_pixelcode enum which don't have an 0 value element, so I got a compile
warning. That "case" is useless so it can be removed.

Signed-off-by: Ionut Gabriel Popescu <poyo_vl@yahoo.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:22:07 -03:00
Michael Grzeschik
01f5a394ea V4L/DVB: mt9m111: added current colorspace at g_fmt
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:22:06 -03:00
Michael Grzeschik
6b6d33c746 V4L/DVB: mt9m111: cropcap and s_crop check if type is VIDEO_CAPTURE
Signed-off-by: Philipp Wiesner <p.wiesner@phytec.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:22:05 -03:00
Baruch Siach
5384a12b23 V4L/DVB: mx2_camera: fix a race causing NULL dereference
The mx25_camera_irq irq handler may get called after the camera has been
deactivated (from mx2_camera_deactivate). Detect this situation, and bail out.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:22:03 -03:00
Jean-François Moine
04d174e99a V4L/DVB: gspca - sn9c20x: Bad transfer size of Bayer images
As the end of frame marker does not contain any pixel, it must not be
transferred.

Reported-by: Ivo Jager <ivo.jager@siliconfields.net>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:22:01 -03:00
Hans Verkuil
2fc11536cf V4L/DVB: videobuf-dma-sg: set correct size in last sg element
This fixes a nasty memory corruption bug when using userptr I/O.
The function videobuf_pages_to_sg() sets up the scatter-gather list for the
DMA transfer to the userspace pages. The first transfer is setup correctly
(the size is set to PAGE_SIZE - offset), but all other transfers have size
PAGE_SIZE. This is wrong for the last transfer which may be less than PAGE_SIZE.

Most, if not all, drivers will program the boards DMA engine correctly, i.e.
even though the size in the last sg element is wrong, they will do their
own size calculations and make sure the right amount is DMA-ed, and so seemingly
prevent memory corruption.

However, behind the scenes the dynamic DMA mapping support (in lib/swiotlb.c)
may create bounce buffers if the memory pages are not in DMA-able memory.
This happens for example on a 64-bit linux with a board that only supports
32-bit DMA.

These bounce buffers DO use the information in the sg list to determine the
size. So while the DMA engine transfers the correct amount of data, when the
data is 'bounced' back too much is copied, causing buffer overwrites.

The fix is simple: calculate and set the correct size for the last sg list
element.

Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:22:01 -03:00
Mauro Carvalho Chehab
c10469c637 V4L/DVB: cx231xx: Avoid an OOPS when card is unknown (card=0)
As reported by: Carlos Americo Domiciano <c_domiciano@yahoo.com.br>:

[  220.033500] cx231xx v4l2 driver loaded.
[  220.033571] cx231xx #0: New device Conexant Corporation Polaris AV Capturb @ 480 Mbps (1554:5010) with 6 interfaces
[  220.033577] cx231xx #0: registering interface 0
[  220.033591] cx231xx #0: registering interface 1
[  220.033654] cx231xx #0: registering interface 6
[  220.033910] cx231xx #0: Identified as Unknown CX231xx video grabber (card=0)
[  220.033946] BUG: unable to handle kernel NULL pointer dereference at (null)
[  220.033955] IP: [<ffffffffa0d3c8bd>] cx231xx_pre_card_setup+0x5d/0xb0 [cx231xx]

Thanks-to: Carlos Americo Domiciano <c_domiciano@yahoo.com.br>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:22:00 -03:00
Richard Zidlicky
3cdadc50bb V4L/DVB: dvb: fix smscore_getbuffer() logic
Drivers shouldn't sleep while holding a spinlock. A previous workaround
were to release the spinlock before callinc schedule().

This patch uses a different approach: it just waits for the
siano hardware to answer.

Signed-off-by: Richard Zidlicky <rz@linux-m68k.org>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:59 -03:00
Olivier Grenie
970d14c6cc V4L/DVB: dib7000p: add disable sample and hold, and diversity delay parameter
This patch improves the overall driver performance in
diversity-reception scenarios.

Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:58 -03:00
Olivier Grenie
90e12cec70 V4L/DVB: dib7770: enable the current mirror
To improve performance on DiB7770-devices enabling the current mirror
is needed.

This patch adds an option to the dib7000p-driver to do that and it
creates a separate device-entry in dib0700-device to use those changes
on hardware which is using the DiB7770.

Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:57 -03:00
Maxim Levitsky
00a220aa98 V4L/DVB: IR: extend MCE keymap
These keys are found on remote bundled with
Toshiba Qosmio F50-10q.

Found and tested by, Sami R <maesesami@gmail.com>

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:56 -03:00
Maxim Levitsky
e0172fd373 V4L/DVB: IR: fix keys beeing stuck down forever
The logic in ir_timer_keyup was inverted.

In case that values aren't equal,
the meaning of the time_is_after_eq_jiffies(ir->keyup_jiffies) is that
ir->keyup_jiffies is after the the jiffies or equally that
that jiffies are before the the ir->keyup_jiffies which is
exactly the situation we want to avoid (that the timeout is in the future)
Confusing Eh?

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:55 -03:00
Maxim Levitsky
67332ba832 V4L/DVB: IR: fix duty cycle capability
Due to typo lirc bridge enabled wrong capability.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:54 -03:00
Mauro Carvalho Chehab
04cab131ce V4L/DVB: rc-core: increase repeat time
As reported by Anton Blanchard <anton@samba.org>, double IR events on
2.6.36-rc2 and a DViCO FusionHDTV DVB-T Dual Express are happening:

[ 1351.032084] ir_keydown: i2c IR (FusionHDTV): key down event, key 0x0067, scancode 0x0051
[ 1351.281284] ir_keyup: keyup key 0x0067

ie one key down event and one key up event 250ms later.

So, we need to increase the repeat timeout, to avoid this bug to hit.

As we're doing it at core, this fix is not needed anymore at dib0700 driver.

Thanks-to: Anton Blanchard <anton@samba.org>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:53 -03:00
Mauro Carvalho Chehab
3bfb317f97 V4L/DVB: Don't identify PV SBTVD Hybrid as a DibCom device
As reported by Carlos, Prolink Pixelview SBTVD Hybrid is based on
Conexant cx231xx + Fujitsu 86A20S demodulator. However, both shares
the same USB ID. So, we need to use USB bcdDevice, in order to
properly discover what's the board.

We know for sure that bcd 0x100 is used for a dib0700 device, while
bcd 0x4001 is used for a cx23102 device. This patch reserves two ranges,
the first one from 0x0000-0x3f00 for dib0700, and the second from
0x4000-0x4fff for cx231xx devices.

This may need fixes in the future, as we get access to other devices.

Thanks-to: Carlos Americo Domiciano <c_domiciano@yahoo.com.br>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:52 -03:00
Jarod Wilson
c13df9cf6b V4L/DVB: mceusb: add two new ASUS device IDs
Reported in lirc sf.net tracker and on lirc mailing list

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:52 -03:00
Jason Wang
882787ff8f V4L/DVB: gspca - main: Fix a crash of some webcams on ARM arch
When plugging some webcams on ARM, the system crashes.
This is because we alloc buffer for an urb through usb_buffer_alloc,
the alloced buffer is already in DMA coherent region, so we should
set the flag of this urb to URB_NO_TRANSFER_DMA_MAP, otherwise when
we submit this urb, the hcd core will handle this address as an
non-DMA address and call dma_map_single/sg to map it. On arm
architecture, dma_map_single a DMA coherent address will be catched
by a BUG_ON().

Signed-off-by: Jason Wang <jason77.wang@gmail.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:51 -03:00
Dmitri Belimov
29d834912b V4L/DVB: Fix regression for BeholdTV Columbus
Some time a go our customers wrote me about problem with our TV card
BeholdTV Columbus. It's PCMCIA TV card for notebook.
As I understand v4l has some regression with autodetect address of tuners.
I can set incorrect I2C address and had report about detect tuner. No any TV of course.
When I set correct tuner type and I2C address of the tuners all works well.

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:50 -03:00
Dan Carpenter
23e64d5585 V4L/DVB: saa7164: move dereference under NULL check
The original code dereferenced "port" before checking it for NULL.  I
moved the test down below the check.  Also I changed the comparisons a
little so people wouldn't get confused and think "port" and "buf" were
ints instead of pointers.  (Probably that's what lead to this issue in
the first place.)

There is only one caller for this function and it passes non-NULL
pointers, so this is essentially a cleanup rather than a bugfix.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:49 -03:00
Dan Carpenter
d5337966ce V4L/DVB: pvrusb2: remove unneeded NULL checks
We dereference "maskptr" unconditionally at the start of the function
and also inside the call to parse_tlist() towards the end of the
function.  This function is called from store_val_any() and it always
passes a non-NULL pointer.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:48 -03:00
Dan Carpenter
a8e0712450 V4L/DVB: opera1: remove unneeded NULL check
"fw" is always a non-NULL pointer at this point, and anyway
release_firmware() accepts NULL pointers.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:47 -03:00
Dan Carpenter
028816bc85 V4L/DVB: IR: ir-raw-event: null pointer dereference
The original code dereferenced ir->raw after freeing it and setting it
to NULL.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:46 -03:00
Dan Carpenter
590a58d180 V4L/DVB: unlock on error path
If we return directly here then we miss out on some mutex_unlock()s

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:45 -03:00
lawrence rust
0f63a14d35 V4L/DVB: cx88: Kconfig: Remove EXPERIMENTAL dependency from VIDEO_CX88_ALSA
The cx88-alsa module has been around since January 2006 and has seen no
significant changes since September 2007.  It is stable in operation
and so I believe that the 'experimental' tag is no longer warranted.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:44 -03:00
Nikanth Karthikesan
817f2c842d Fix various typos of valid in comments
Fix various typos of valid.

Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-09-21 17:04:50 +02:00
Arnd Bergmann
d9d2e9d5c9 lirc: make chardev nonseekable
There does not seem to be a need for lirc to
allow seeking on the file descriptor, so let's
just disallow this before users start relying
on it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2010-09-16 10:33:16 +02:00
Dmitry Torokhov
9f47009506 Input: media/IR - switch to using new keycode interface
Switch the code to use new style of getkeycode and setkeycode
methods to allow retrieving and setting keycodes not only by
their scancodes but also by index.

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-09-09 22:01:49 -07:00
Ingo Molnar
577ba406e1 V4L/DVB: mantis: Fix IR_CORE dependency
This build bug triggers:

 drivers/built-in.o: In function `mantis_exit':
 (.text+0x377413): undefined reference to `ir_input_unregister'
 drivers/built-in.o: In function `mantis_input_init':
 (.text+0x3774ff): undefined reference to `__ir_input_register'

If MANTIS_CORE is enabled but IR_CORE is not. Add the correct
dependency.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-24 10:42:08 -07:00
Frederic Weisbecker
c6d7ba8b12 v4l: Remove reference to bkl ioctl in compat ioctl handling
There are no more users of struct file_operations:ioctl. These
can be safely removed.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
2010-08-14 00:24:24 +02:00
Linus Torvalds
1547ac893a Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
  V4L/DVB: v4l2-ctrls.c: needs to include slab.h
  V4L/DVB: fix Kconfig to depends on VIDEO_IR
  V4L/DVB: Fix IR_CORE dependencies
2010-08-13 10:44:24 -07:00
Randy Dunlap
2b80163c39 V4L/DVB: v4l2-ctrls.c: needs to include slab.h
v4l2-ctrls.c needs to include slab.h to prevent build errors:

drivers/media/video/v4l2-ctrls.c:766: error: implicit declaration of function 'kzalloc'
drivers/media/video/v4l2-ctrls.c:786: error: implicit declaration of function 'kfree'
drivers/media/video/v4l2-ctrls.c:1528: error: implicit declaration of function 'kmalloc'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-12 15:08:05 -03:00
Mauro Carvalho Chehab
361be7b1d0 V4L/DVB: fix Kconfig to depends on VIDEO_IR
warning: (VIDEO_BT848 && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_DEV && PCI && I2C && VIDEO_V4L2 && INPUT || VIDEO_SAA7134 && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 && VIDEO_DEV && PCI && I2C && INPUT || VIDEO_CX88 && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 && VIDEO_DEV && PCI && I2C && INPUT || VIDEO_IVTV && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 && PCI && I2C && INPUT || VIDEO_CX18 && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 && DVB_CORE && PCI && I2C && EXPERIMENTAL && INPUT || VIDEO_EM28XX && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 && V4L_USB_DRIVERS && USB && VIDEO_DEV && I2C && INPUT || VIDEO_TLG2300 && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 && V4L_USB_DRIVERS && USB && VIDEO_DEV && I2C && INPUT && SND && DVB_CORE || VIDEO_CX231XX && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 && V4L_USB_DRIVERS && USB && VIDEO_DEV && I2C && INPUT || DVB_BUDGET_CI && MEDIA_SUPPORT && DVB_CAPTURE_DRIVERS && DVB_CORE && DVB_BUDGET_CORE && I2C && INPUT || DVB_DM1105 && MEDIA_SUPPORT && DVB_CAPTURE_DRIVERS && DVB_CORE && PCI && I2C && INPUT || VIDEO_GO7007 && STAGING && !STAGING_EXCLUDE_BUILD && VIDEO_DEV && PCI && I2C && INPUT && SND || VIDEO_CX25821 && STAGING && !STAGING_EXCLUDE_BUILD && DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT) selects VIDEO_IR which has unmet direct dependencies (IR_CORE)

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-12 15:07:57 -03:00
Mauro Carvalho Chehab
cfec93f769 V4L/DVB: Fix IR_CORE dependencies
As pointed by Randy Dunlap <randy.dunlap@oracle.com>:
> ERROR: "ir_keydown" [drivers/media/video/ir-kbd-i2c.ko] undefined!
> ERROR: "__ir_input_register" [drivers/media/video/ir-kbd-i2c.ko] undefined!
> ERROR: "get_rc_map" [drivers/media/video/ir-kbd-i2c.ko] undefined!
> ERROR: "ir_input_unregister" [drivers/media/video/ir-kbd-i2c.ko] undefined!
> ERROR: "get_rc_map" [drivers/media/video/cx88/cx88xx.ko] undefined!
> ERROR: "ir_repeat" [drivers/media/video/cx88/cx88xx.ko] undefined!
> ERROR: "ir_input_unregister" [drivers/media/video/cx88/cx88xx.ko] undefined!
> ERROR: "ir_keydown" [drivers/media/video/cx88/cx88xx.ko] undefined!
> ERROR: "__ir_input_register" [drivers/media/video/cx88/cx88xx.ko] undefined!
> ERROR: "get_rc_map" [drivers/media/video/bt8xx/bttv.ko] undefined!
> ERROR: "ir_input_unregister" [drivers/media/video/bt8xx/bttv.ko] undefined!
> ERROR: "__ir_input_register" [drivers/media/video/bt8xx/bttv.ko] undefined!
> ERROR: "ir_g_keycode_from_table" [drivers/media/IR/ir-common.ko] undefined!
>
>
> #5101:
> (.text+0x8306e2): undefined reference to `ir_core_debug'
> (.text+0x830729): undefined reference to `ir_core_debug'
> ir-functions.c:(.text+0x830906): undefined reference to `ir_core_debug'
> (.text+0x8309d8): undefined reference to `ir_g_keycode_from_table'
> (.text+0x830acf): undefined reference to `ir_core_debug'
> (.text+0x830b92): undefined reference to `ir_core_debug'
> (.text+0x830bef): undefined reference to `ir_core_debug'
> (.text+0x830c6a): undefined reference to `ir_core_debug'
> (.text+0x830cf7): undefined reference to `ir_core_debug'
> budget-ci.c:(.text+0x89f5c8): undefined reference to `ir_keydown'
> budget-ci.c:(.text+0x8a0c58): undefined reference to `get_rc_map'
> budget-ci.c:(.text+0x8a0c80): undefined reference to `__ir_input_register'
> budget-ci.c:(.text+0x8a0ee0): undefined reference to `get_rc_map'
> budget-ci.c:(.text+0x8a11cd): undefined reference to `ir_input_unregister'
> (.text+0x8a8adb): undefined reference to `ir_input_unregister'
> dvb-usb-remote.c:(.text+0x8a9188): undefined reference to `get_rc_map'
> dvb-usb-remote.c:(.text+0x8a91b1): undefined reference to `__ir_input_register'
> dvb-usb-remote.c:(.text+0x8a9238): undefined reference to `get_rc_map'
> dib0700_core.c:(.text+0x8b04ca): undefined reference to `ir_keydown'
> dib0700_devices.c:(.text+0x8b2ea8): undefined reference to `ir_keydown'
> dib0700_devices.c:(.text+0x8b2ef0): undefined reference to `ir_keydown'

Those breakages seem to be caused by two bad things at IR_CORE Kconfig:

1) cx23885 is using select for IR_CORE;
2) the dvb-usb and sms dependency for IR_CORE were missing.

While here, allow users to un-select IR.

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-12 15:07:48 -03:00
Linus Torvalds
1c00650c23 Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c: I2C bus multiplexer driver pca954x
  i2c: Multiplexed I2C bus core support
  i2c: Use a separate mutex for userspace client lists
  i2c: Make i2c_default_probe self-sufficient
  i2c: Drop dummy variable
  i2c: Move adapter locking helpers to i2c-core
  V4L/DVB: Use custom I2C probing function mechanism
  i2c: Add support for custom probe function
  i2c-dev: Use memdup_user
  i2c-dev: Remove unnecessary kmalloc casts
2010-08-12 10:06:29 -07:00
Linus Torvalds
58d4ea65b9 Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6:
  mmc_spi: Fix unterminated of_match_table
  of/sparc: fix build regression from of_device changes
  of/device: Replace struct of_device with struct platform_device
2010-08-12 09:11:31 -07:00
Jean Delvare
d44f19d586 V4L/DVB: Use custom I2C probing function mechanism
Now that i2c-core offers the possibility to provide custom probing
function for I2C devices, let's make use of it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-11 18:20:57 +02:00
Jean Delvare
9a94241afc i2c: Add support for custom probe function
The probe method used by i2c_new_probed_device() may not be suitable
for all cases. Let the caller provide its own, optional probe
function.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-11 18:20:56 +02:00
Jiri Kosina
6396fc3b3f Merge branch 'master' into for-next
Conflicts:
	fs/exofs/inode.c
2010-08-11 09:36:51 +02:00
Linus Torvalds
7ae0dea900 Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (94 commits)
  V4L/DVB: tvp7002: fix write to H-PLL Feedback Divider LSB register
  V4L/DVB: dvb: siano: free spinlock before schedule()
  V4L/DVB: media: video: pvrusb2: remove custom hex_to_bin()
  V4L/DVB: drivers: usbvideo: remove custom implementation of hex_to_bin()
  V4L/DVB: Report supported QAM modes on bt8xx
  V4L/DVB: media: ir-keytable: null dereference in debug code
  V4L/DVB: ivtv: convert to the new control framework
  V4L/DVB: ivtv: convert gpio subdev to new control framework
  V4L/DVB: wm8739: convert to the new control framework
  V4L/DVB: cs53l32a: convert to new control framework
  V4L/DVB: wm8775: convert to the new control framework
  V4L/DVB: cx2341x: convert to the control framework
  V4L/DVB: cx25840: convert to the new control framework
  V4L/DVB: cx25840/ivtv: replace ugly priv control with s_config
  V4L/DVB: saa717x: convert to the new control framework
  V4L/DVB: msp3400: convert to the new control framework
  V4L/DVB: saa7115: convert to the new control framework
  V4L/DVB: v4l2: hook up the new control framework into the core framework
  V4L/DVB: Documentation: add v4l2-controls.txt documenting the new controls API
  V4L/DVB: v4l2-ctrls: Whitespace cleanups
  ...
2010-08-10 15:09:54 -07:00
Jiri Kosina
fb8231a8b1 Merge branch 'master' into for-next
Conflicts:
	arch/arm/mach-omap1/board-nokia770.c
2010-08-10 13:22:08 +02:00
Stefan Weil
eef35c2d41 Fix spelling fuction -> function in comments
To avoid more patches, I also fixed other spelling
and grammar bugs when they were in the same or
following line:

successfull -> successful
parse -> parses
controler -> controller
controlers -> controllers

Cc: Jiri Kosina <trivial@kernel.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-08-09 11:22:49 +02:00
Rajashekhara, Sudhakar
560afa7d85 V4L/DVB: tvp7002: fix write to H-PLL Feedback Divider LSB register
H-PLL Feedback Divider LSB register is an 8 bit register out
of which the first 4 bits are reserved. Current code is
writing to these reserved location. This patch corrects
this issue by left shifting the values being written to the
register by 4.

This patch has been tested on DM6467 EVM with 720P-60 and
1080I-60 inputs.

Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:07 -03:00
Kulikov Vasiliy
d0a38ce27e V4L/DVB: dvb: siano: free spinlock before schedule()
Calling schedule() holding spinlock with disables irqs is improper. As
spinlock protects list coredev->buffers, it can be unlocked untill wakeup.
This bug was introduced in a9349315f6.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:06 -03:00
Andy Shevchenko
e03b9843dc V4L/DVB: media: video: pvrusb2: remove custom hex_to_bin()
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:06 -03:00
Andy Shevchenko
af5458b91f V4L/DVB: drivers: usbvideo: remove custom implementation of hex_to_bin()
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:06 -03:00
Arnuschky
c75079cc2a V4L/DVB: Report supported QAM modes on bt8xx
Here a small patch to get a TwinHan VT DST DVB-T card working with
kernels >= 2.6.32. Analogously to
http://linuxtv.org/hg/v4l-dvb/rev/0e735b509163 I had to:

"Fill in the .caps field in struct dst_dvbt_ops (around line 1763) with
all the supported QAM modulation methods to match the capabilities of
the card as implemented in function dst_set_modulation (around line
502). Note that beginning with linux kernel version 2.6.32 the
modulation method is checked (by function dvb_frontend_check_parameters
in file drivers/media/dvb/dvb-core/dvb_frontend.c) and thus tuning fails
if you use a modulation method that is not present in the .caps field."

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:06 -03:00
Dan Carpenter
ede67a30f5 V4L/DVB: media: ir-keytable: null dereference in debug code
"ir_dev->props" can be NULL.  We only use raw mode if "ir_dev->props" is
non-NULL and "ir_dev->props->driver_type == RC_DRIVER_IR_RAW".

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:06 -03:00
Hans Verkuil
f7b80e6919 V4L/DVB: ivtv: convert to the new control framework
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:06 -03:00
Hans Verkuil
2fd781448a V4L/DVB: ivtv: convert gpio subdev to new control framework
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:05 -03:00
Hans Verkuil
f687d19d22 V4L/DVB: wm8739: convert to the new control framework
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:05 -03:00
Hans Verkuil
251190cffa V4L/DVB: cs53l32a: convert to new control framework
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:05 -03:00
Hans Verkuil
5aa9ae5ed5 V4L/DVB: wm8775: convert to the new control framework
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:05 -03:00
Hans Verkuil
f6e114eed0 V4L/DVB: cx2341x: convert to the control framework
Since this module is also used by drivers that are not yet converted, the old
and new code have to co-exist.

The source is split into three parts: a common part at the top, which is used
by both old and new code, then the old code followed by the new control
framework implementation. This new code is much more readable (and shorter!)
than the original code.

Once all bridge drivers that use this are converted the old code can be
deleted.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:05 -03:00
Hans Verkuil
e34e658b5a V4L/DVB: cx25840: convert to the new control framework
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:05 -03:00
Hans Verkuil
72c851b00f V4L/DVB: cx25840/ivtv: replace ugly priv control with s_config
The cx25840 used a private control CX25840_CID_ENABLE_PVR150_WORKAROUND
to be told whether to enable a workaround for certain pvr150 cards.

This is really config data that it needs to get at load time.

Implemented this in cx25840 and ivtv.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:05 -03:00
Hans Verkuil
59b8311a9b V4L/DVB: saa717x: convert to the new control framework
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:04 -03:00
Hans Verkuil
ebc3bba583 V4L/DVB: msp3400: convert to the new control framework
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:04 -03:00
Hans Verkuil
e356054337 V4L/DVB: saa7115: convert to the new control framework
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:04 -03:00
Hans Verkuil
11bbc1cadb V4L/DVB: v4l2: hook up the new control framework into the core framework
Add the calls needed to automatically merge subdev controls into a bridge
control handler.

Hook up the control framework in __video_ioctl2 and video_register_device.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:04 -03:00
Mauro Carvalho Chehab
6dd5aff3ca V4L/DVB: v4l2-ctrls: Whitespace cleanups
Fixes 37 checkpatch.pl warnings like:

WARNING: please, no space before tabs
+^Icase V4L2_CID_MPEG_VIDEO_PULLDOWN: ^Ireturn "Video Pulldown";$

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:04 -03:00
Hans Verkuil
6c8d611193 V4L/DVB: v4l2-ctrls: reorder 'case' statements to match order in header
To make it easier to determine whether all controls are added in v4l2-ctrls.c
the case statements inside the switch are re-ordered to match the header.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:03 -03:00
Hans Verkuil
0996517cf8 V4L/DVB: v4l2: Add new control handling framework
Add a new framework to handle controls which makes life for driver
developers much easier.

Note that this patch moves some of the control support that used to be in
v4l2-common.c to v4l2-ctrls.c. The tables were copied unchanged. The body
of v4l2_ctrl_query_fill() was copied to a new v4l2_ctrl_fill() function
in v4l2-ctrls.c. This new function doesn't use the v4l2_queryctrl
struct anymore, which makes it more general.

The remainder of v4l2-ctrls.c is all new. Highlights include:

- No need to implement VIDIOC_QUERYCTRL, QUERYMENU, S_CTRL, G_CTRL,
  S_EXT_CTRLS, G_EXT_CTRLS or TRY_EXT_CTRLS in either bridge drivers
  or subdevs. New wrapper functions are provided that can just be plugged in.
  Once everything has been converted these wrapper functions can be removed as well.

- When subdevices are added their controls can be automatically merged
  with the bridge driver's controls.

- Most drivers just need to implement s_ctrl to set the controls.
  The framework handles the locking and tries to be as 'atomic' as possible.

- Ready for the subdev device nodes: the same mechanism applies to subdevs
  and their device nodes as well. Sub-device drivers can make controls
  local, preventing them from being merged with bridge drivers.

- Takes care of backwards compatibility handling of VIDIOC_S_CTRL and
  VIDIOC_G_CTRL. Handling of V4L2_CID_PRIVATE_BASE is fully transparent.
  CTRL_CLASS controls are automatically added.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:03 -03:00
Pawel Osciak
03e30ca5f0 V4L/DVB: v4l: s5p-fimc: Fix coding style issues
Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:03 -03:00
Michael Grzeschik
175bad921c V4L/DVB: mt9m111: init chip after read CHIP_VERSION
Moved mt9m111_init after the chip version detection passage: I
don't like the idea of writing on a device we haven't identified
yet.

Signed-off-by: Philipp Wiesner <p.wiesner@phytec.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:03 -03:00
Philipp Wiesner
c8cf078ebd V4L/DVB: mt9m111: Added indication that MT9M131 is supported by this driver
Added this info to Kconfig and mt9m111.c, some comment cleanup,
replaced 'mt9m11x'-statements by clarifications or driver name.
Driver is fully compatible to mt9m131 which has only additional functions
compared to mt9m111. Those aren't used anyway at the moment.

Signed-off-by: Philipp Wiesner <p.wiesner@phytec.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:03 -03:00
Michael Grzeschik
d86097e19c V4L/DVB: mx2_camera: add rising edge for pixclock
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:03 -03:00
Michael Grzeschik
cd9ebdbc05 V4L/DVB: mx2_camera: fix for list bufnum in frame_done_emma
The emma uses bufnum 1 and 0. This patch tells the bufqueue to change
the next buffer to the next one and not the current one.
Otherwise the BUG_ON above will trigger everytime.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:03 -03:00
Guennadi Liakhovetski
b3fc1782c8 V4L/DVB: V4L: do not autoselect components on embedded systems
Tuner, DVB frontend and video helper chip drivers are by default
autoselected by their respective host cards, this, however, doesn't make
much sense on SoC-based systems. Disable autoselection on EMBEDDED
systems.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:02 -03:00
Guennadi Liakhovetski
103754a052 V4L/DVB: soc-camera: prohibit S_CROP, if internal G_CROP has failed
There is no sense in trying to set cropping if we cannot get current one
from the host driver.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:02 -03:00
Jean-François Moine
a484dd9b77 V4L/DVB: gspca - zc3xx: Redefine the exchanges of sensor mt9v111 (mi0360soc)
The exchanges for sensor mt9v111 are different with bridges zc301 and zc303.
The exchanges for the bridge zc303 were those of the bad named tas5130ck.
These mt9v111 exchanges have been adjusted from the ms-Windows public files
vm30x.inf (for 0ac8:301b) and usbvm303.inf (for 0ac8:303b).

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:02 -03:00
Jean-François Moine
2af0b4c60c V4L/DVB: gspca - zc3xx: Add the light frequency control for sensor hv7131r
The new exchanges are extracted from the public file lPEPI264v.inf of the
ms-Windows driver. In this file, the sensor is named hv7131b but the exchanges
are those of the hv7131r.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:02 -03:00
Jean-François Moine
5fd450e913 V4L/DVB: gspca - zc3xx: Possible use of the highest alternate setting
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:02 -03:00
Jean-François Moine
c39da6a375 V4L/DVB: gspca - zc3xx: Do the sensor probe at resume time
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:02 -03:00
Jean-François Moine
6d31450544 V4L/DVB: gspca - zc3xx: Check the USB exchanges
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:01 -03:00
Jean-François Moine
83d1aa3d21 V4L/DVB: gspca - zc3xx: Cleanup source
- use an enum to define the sensor numbers
- use the sensor numbers to index the associated tables
- rename TAS5130CXX to TAS5130C
- rename HV7131C to HV7131R
- change some comments

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:01 -03:00
Jean-François Moine
fe988f56c7 V4L/DVB: gspca - main: Fix a crash in gspca_frame_add()
Some webcams as ov511 may find many times an end of image.
In this case, with the last patch in image concatenation
(commit 799b1bd41f398054d46fd35f73abd01c4009f6ca),
the image pointer was NULL and the system crashed in memcpy().

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:01 -03:00
Sylwester Nawrocki
5fd8f7388c V4L/DVB: v4l: Add driver for Samsung S5P SoC video postprocessor
This driver exports a video device node per each camera interface/
video postprocessor (FIMC) device contained in Samsung S5P SoC series.
The driver is based on v4l2-mem2mem framework.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:01 -03:00
Laurent Pinchart
70092c26dc V4L/DVB: uvcvideo: Add support for Miricle 307K thermal webcam
The camera requires the STREAM_NO_FID quirk. Add a corresponding entry
in the device IDs list.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:01 -03:00
Laurent Pinchart
9bde9f263e V4L/DVB: uvcvideo: Drop corrupted compressed frames
Corrupted video frames are dropped by default by the driver for
uncompressed formats. Data corruption is not less problematic for
compressed formats, so frame drop should be enabled by default for those
formats as well.

Mark buffers as faulty when an isochronous packet loss is detected for
any format, or when the buffer length doesn't match the image size for
uncompressed formats. Drop erroneous buffers regardless of whether the
format is compressed or uncompressed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:01 -03:00
Andy Walls
df49d113d1 V4L/DVB: IR keymap: Add print button for HP OEM version of MCE remote
This patch adds a defintion for the "Print" button found on HP OEM
versions of the MCE remote.  All of the other keys found on the HP OEM
version of the remote match the other keys as already defined.

Because, who doesn't need "remote printing", while one is sitting on the
couch across from one's PC? ;)

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:00 -03:00
Maxim Levitsky
931e39a139 V4L/DVB: IR: Port ene driver to new IR subsystem and enable it
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:00 -03:00
Maxim Levitsky
9ea53b74df V4L/DVB: STAGING: remove lirc_ene0100 driver
Add latest unported version of this driver to media/IR.
Next patch will port it to ir core.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:00 -03:00
Maxim Levitsky
ed4d3876d1 V4L/DVB: IR: report unknown scancodes the in-kernel decoders found
This way it is possible to use evtest to create keymap for unknown remote.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:00 -03:00
Maxim Levitsky
e589333f34 V4L/DVB: IR: extend interfaces to support more device settings
LIRC: add new IOCTL that enables learning mode (wide band receiver)
Still missing features: carrier report & timeout reports.
Will need to pack these into ir_raw_event

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:00 -03:00
Maxim Levitsky
4a702ebf61 V4L/DVB: IR: add helper function for hardware with small o/b buffer
Some ir input devices have small buffer, and interrupt the host
each time it is full (or half full)

Add a helper that automaticly handles timeouts, and also
automaticly merges samples of same time (space-space)
Such samples might be placed by hardware because size of
sample in the buffer is small (a byte for example).

Also remove constness from ir_dev_props, because it now contains timeout
settings that driver might want to change

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:00 -03:00
Maxim Levitsky
b378f43fe9 V4L/DVB: IR: Allow not to compile keymaps in
Currently, ir device registration fails if keymap requested by driver is not found.
Fix that by always compiling in the empty keymap, and using it as a failback.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:00 -03:00
Maxim Levitsky
86ff071cad V4L/DVB: IR: NECX: support repeat
This adds support for repeat detecting for NECX variant
Tested with uneversal remote

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:59 -03:00
Maxim Levitsky
e31f41278f V4L/DVB: IR: nec decoder: fix repeat
Repeat space is 4 units, not 8.
Current code would never trigger a repeat.

However that isn't true for NECX, so repeat there
must be handled differently.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Reviewed-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:59 -03:00
Maxim Levitsky
39b2c0687b V4L/DVB: IR: JVC: make repeat work
Currently, jvc decoder will attempt misdetect next press as a repeat
of last keypress, therefore second keypress isn't detected.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:59 -03:00
Maxim Levitsky
0d2cb1de8e V4L/DVB: IR: replace workqueue with kthread
It is perfectly possible to have ir_raw_event_work
running concurently on two cpus, thus we must protect
it from that situation.

This stems from the fact that if hardware sends short packets of samples
we might end up queueing the work item more times that nessesary.

Such job isn't well suited for a workqueue, so use a kernel thread.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:59 -03:00
Maxim Levitsky
45a568fa6f V4L/DVB: IR: replace spinlock with mutex
Some handlers (lirc for example) allocates memory on initialization,
doing so in atomic context is cumbersome.
Fixes warning about sleeping function in atomic context.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:59 -03:00
Maxim Levitsky
510fcb70ff V4L/DVB: IR: minor fixes
* lirc: Don't propagate reset event to userspace
* lirc: Remove strange logic from lirc that would make first sample always be pulse
* Make TO_US macro actualy print what it should.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:59 -03:00
Maxim Levitsky
ade321c5b8 V4L/DVB: IR: Kconfig fixes
Move IR drives below separate menu.
This allows to disable them.
Also correct a typo.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:59 -03:00
Jarod Wilson
2c1101d5ae V4L/DVB: IR: put newly ported streamzap driver in proper home
Moves drivers/staging/lirc/lirc_streamzap.c to
drivers/media/IR/streamzap.c, along with making the requisite Kconfig
and Makefile changes.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:58 -03:00
Jarod Wilson
8e9e606400 V4L/DVB: staging/lirc: port lirc_streamzap to ir-core
This ports lirc_streamzap.c over to ir-core in-place, to be followed by
a patch moving the driver over to drivers/media/IR/streamzap.c and
enabling the proper Kconfig bits.

Presently, the in-kernel keymap doesn't work, as the stock Streamzap
remote uses an RC-5-like, but not-quite-RC-5 protocol, which the
in-kernel RC-5 decoder doesn't cope with. The remote can be used right
now with the lirc bridge driver though, and other remotes (at least an
RC-6(A) MCE remote) work perfectly with the driver.

I'll take a look at making the existing RC-5 decoder cope with this odd
duck, possibly implement another standalone decoder engine, or just
throw up my hands and say "meh, use lirc"... But the driver itself
should be perfectly sound.

Remaining items on the streamzap TODO list:
- add LIRC_SET_REC_TIMEOUT-alike support
- add LIRC_GET_M{AX,IN}_TIMEOUT-alike support
- add LIRC_GET_REC_RESOLUTION-alike support

All of the above should be trivial to add. There are patches pending to
add this support to ir-core from Maxim Levitsky, and I'll take care of
these once his patches get integrated. None of them are currently
essential though.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:58 -03:00
Jarod Wilson
7c294402d5 V4L/DVB: IR/mceusb: less generic callback name and remove cruft
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:58 -03:00
Jarod Wilson
7a9fcb41b9 V4L/DVB: IR/mceusb: remove bad ir_input_dev use
The ir_input_dev gets filled in by __ir_input_register, the one
allocated in mceusb_init_input_dev was being overwritten by the correct
one shortly after it was initialized (ultimately resulting in a memory
leak). This bug was inherited from imon.c, and was pointed out to me by
Maxim Levitsky.

v2: fix incorrect dev arg to dev_dbg

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:57 -03:00
Jarod Wilson
da48db669f V4L/DVB: IR/imon: remove bad ir_input_dev use
The ir_input_dev gets filled in by __ir_input_register, the one
allocated in imon_init_idev was being overwritten by the correct one
shortly after it was initialized (ultimately resulting in a memory
leak). Additionally, there was an ill-advised memcpy into that
extraneous ir_input_dev which gets fixed by this.

Ill-advised memcpy pointed out by Dmitry Torokhov, bad usage of
ir_input_dev pointed out by Maxim Levitsky.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:57 -03:00
Jarod Wilson
20cd195972 V4L/DVB: IR/imon: remove incorrect calls to input_free_device
Per Dmitry Torokhov, following input_unregister_device with an
input_free_device is forbidden, the former is sufficient alone.

Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:57 -03:00
Andy Walls
d69e85b644 V4L/DVB: v4l2_subdev: Get rid of now unused IR pulse width defines
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:57 -03:00
Andy Walls
c02e0d12a9 V4L/DVB: cx23885, cx25840: Change IR measurment records to use struct ir_raw_event
The CX23885 and CX25840 modules were using their own simple
IR pulse width measurement record type which required conversion
when passing to the new IR core.  This change makes that record type
consistent with the new IR core and removes a data conversion.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:56 -03:00
Andy Walls
2560d94e33 V4L/DVB: cx23885, cx25840: Report the actual length of an IR Rx timeout event
Instead of reporting an IR Rx timeout event as a ridiculously
long space, report it as a space of the lenght of the timeout.

This partially fixes operation with LIRC without breaking
interoperation with the in kernel decoders.  The gaps lengths
reported to LIRC are still not real however.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:56 -03:00
Andy Walls
ceb152add6 V4L/DVB: cx23885, cx25840: Report IR max pulse width regardless of mod/demod use
Compute and report the maximum IR pulse measurment width, even
if we are set to perform carrier modulation or demodulation and
the number is fixed by the carrier freq.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:56 -03:00
Andy Walls
0c82a8fb5a V4L/DVB: cx23885: Change Kconfig dependencies to new IR_CORE functions
This driver no longer depends on the old IR functions selected by
VIDEO_IR.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:56 -03:00
Andy Walls
fa647f249f V4L/DVB: cx23885: Require user to explicitly enable CX2388[57] IR via module param
The CX23885 IR controller was reported to cause an interrupt storm
on a TeVii S470 card, but was reported fine on an HVR-1250.  Keep
integrated IR disabled by default on CX2388[57] based cards to avoid
a bad user experience in the general case.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:56 -03:00
Andy Walls
e5514f104d V4L/DVB: cx23885: Move AV Core irq handling to a work handler
Interrupts from the AV Core are best handled by a workqueue handler
since many I2C transactions are required to service the AV Core
interrupt.  The AV_CORE PCI interrupt is disabled by the IRQ handler
and reenabled when the work handler is finished.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:56 -03:00
Andy Walls
dbe83a3b92 V4L/DVB: cx23885: Protect PCI interrupt mask manipulations with a spinlock
This patch encapsulates access to the PCI_INT_MSK register and
dev->pci_irqmask variable and protects them with a spinlock.
This is needed because both the hard IRQ handler and a workhandler
will need to manipulate the mask to disable the AV_CORE interrupt.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:55 -03:00
Andy Walls
98d109f90f V4L/DVB: cx23885: Add preliminary IR Rx support for the HVR-1250 and TeVii S470
Add initial IR Rx support using the intergrated IR controller in the
A/V core of the CX23885 bridge chip.

This initial support is flawed in that I2C transactions should not
be performed in a hard irq context.  That will be fixed in a
follow on patch.

The TeVii S470 support is reported to generate perptual interrupts
that renders a user' system nearly unusable.  The TeVii S470 IR
will be disabled by default in a follow on patch.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:55 -03:00
Andy Walls
d6b1850d3c V4L/DVB: cx23885: Add a v4l2_subdev group id for the CX2388[578] integrated AV core
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:55 -03:00
Andy Walls
52fd3dda13 V4L/DVB: cx25840: Add support for CX2388[57] A/V core integrated IR controllers
This patch is primarily a port of the integrated IR controller code in
cx23885/cx23888-ir.c.  Right now, only the CX2388[57] AV core will
really try to set up IR. This IR support, by design, still requires the
bridge driver to do final IO pin mux configuration and setup of the IR
controller parameters.

For the CX2388[578] chips, enabling the AV Core for IR also starts
sending Audio and Video interrupts to the bridge driver.  For
CX2388[578] chips audio and video interrupts are ignored and
acknowledged when they happen.

IR interrupt handling and status logging is exluded for the CX23888
which does not have an IR controller on the AV core.

Note that experimentation reveals that the IR irq enables on the
CX23885 have an inverted logic sense.  The CX23887 likely suffers from
the same quirk.  For these chips, those irq enable bits are handled
as interrupt disables.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:55 -03:00
Andy Walls
260e689ba2 V4L/DVB: v4l2_subdev: Move interrupt_service_routine ptr to v4l2_subdev_core_ops
The CX2584x and related cores are multifunction subdevices with a number
of internal blocks that act as interrupt sources.  Move the v4L2_subdev
interrupt_service_routine callback from v4l_subdev_ir_ops to
v4l2_subdev_core_ops, as the video and audio blocks of a CX2584x and
related cores can generate interrupts along with the IR block.  This
change also makes sense for other subdev's that generate interrupts and
do not have an IR block.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:55 -03:00
Andy Walls
81f287da73 V4L/DVB: cx23885: For CX23888 IR, configure the IO pin mux IR pins explcitly
Explicitly configure the IR Tx and IR Rx pins to be driven by the
IR Rx and Tx pads from the AV core for CX23888 IR.

For the HVR-1850 and HVR-1290 configure the IR Tx level inversion,
so the Tx LED is off when idle.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:55 -03:00
Andy Walls
5a28d9a320 V4L/DVB: v4l2_subdev, cx23885: Differentiate IR carrier sense and I/O pin inversion
There is a distinction on IR Tx for the CX2388[578] chips of carrier
sense inversion (space is a carrier burst and mark is no burst) and I/O
pin level inversion (0 is high output level, 1 is low output level).
Allow the caller to set these parameters distinctly as v4l2_subdevice
IR parameters.  This permits the IR device to be configured and enabled
without the IR Tx LED being on during idle/space time due to an external
hardware level inversion

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:54 -03:00
Andy Walls
d06d5777b2 V4L/DVB: cx25840: Add s_io_pin_config core subdev ops for the CX2388[578]
Add s_io_pin_config core subdev op for the CX2388[578] AV cores.
This is complete for IR_RX, IR_TX, GPIOs 16,19-23, and IRQ_N.
It likely needs work for the I2S signal direction.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:54 -03:00
Andy Walls
e9e5cf4727 V4L/DVB: cx23885: Add a VIDIOC_LOG_STATUS ioctl function for analog video devices
Add a simple log_status function for raw analog video capture device nodes,
to provide insight into the state of the CX2388[578] A/V decoder core.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:54 -03:00
Andy Walls
ebbeb46000 V4L/DVB: cx23885: Add correct detection of the HVR-1250 model 79501
The offset in the eeprom data for the 79501 version of the HVR-1250 is at 0xc0
vs. the standard 0x80.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:54 -03:00
Andy Walls
5f27264446 V4L/DVB: cx25840: Make cx25840 i2c register read transactions atomic
There was a small window between writing the cx25840 register
address over the i2c bus and reading the register contents back from the
cx25840 device that the i2c adapter lock was released.  This change ensures the
adapter lock is not released until the register read is done.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:54 -03:00
Jean Delvare
18a87becf8 V4L/DVB: cx23885: i2c_wait_done returns 0 or 1, don't check for < 0 return value
Function i2c_wait_done() never returns negative values, so there is no
point in checking for them.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:54 -03:00
Jean Delvare
44835f197b V4L/DVB: cx23885: Check for slave nack on all transactions
Don't just check for nacks on zero-length transactions. Check on
other transactions too.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:53 -03:00
Jean Delvare
f4acb3c4cc V4L/DVB: cx23885: Return -ENXIO on slave nack
Documentation/i2c/fault-codes says that i2c adapter drivers should
return -ENXIO when no slave acks an address byte.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:53 -03:00
Jean-François Moine
3d217c8656 V4L/DVB: gspca - vc032x: Force main register write at probe time (poxxxx)
On laptops, the webcam sometimes disconnects when writing the first main
register (b300). This patch prevents the creation of a new /dev/video<n>
on streaming start.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:53 -03:00
Jean-François Moine
bb44f5682b V4L/DVB: gspca - vc032x: Do sensor probe at resume time
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:53 -03:00
Jean-François Moine
486cb2d5b0 V4L/DVB: gspca - vc032x: Add more controls for poxxxx
The added controls are exposure, gain, autogain and backlight compensation.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:53 -03:00
Jean-François Moine
6e80cc51b4 V4L/DVB: gspca - sq930x: Cleanup source, add comments
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:53 -03:00
Jean-François Moine
585d48812c V4L/DVB: gspca - sq930x: Change the horizontal blanking of sensor mt9v111
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:53 -03:00
Jean-François Moine
82d2c7aa85 V4L/DVB: gspca - sq930x: Change image format to Bayer mode
The JPEG format did not work fine. The Bayer format offers correct VGA (640x480)
resolution, but bad QQVGA (160x120). This last resolution is removed.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:52 -03:00
Jean-François Moine
d6f5bd6d19 V4L/DVB: gspca - sq930x: Change the default values of gain and exposure
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:52 -03:00
Jean-François Moine
b3c0af6e1f V4L/DVB: gspca - sq930x: Change the gain value for Micron sensors
The bit 7 of the sensor gain register multiplies the 7bits value by two.
It is now always set with half the user gain value.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:52 -03:00
Jean-François Moine
4663117bba V4L/DVB: gspca - sq930x: Bad init sequence for sensor mt9v111
The start_1 exchange must be done by (reg, val) * 5 and not 8.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:52 -03:00
Jean-François Moine
30d4554a02 V4L/DVB: gspca - main: Version change
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:52 -03:00
Jean-François Moine
11ce884a0d V4L/DVB: gspca - sonixj / sq930x / t613: Remove unused variable in struct sd
The sensor enum definition was not at the right place.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:42:52 -03:00
Frederic Weisbecker
d9a145fb6e Merge commit 'linus/master' into bkl/core
Merge reason: The staging tree has introduced the easycap
driver lately. We need the latest updates to pushdown the
bkl in its ioctl helper.
2010-08-09 02:14:15 +02:00
Arnd Bergmann
86a5ef7d77 v4l: Convert v4l2-dev to unlocked_ioctl
v4l2 implements two separate file operations for drivers that
use locked and unlocked ioctl callbacks. Since we want to remove
the ioctl file operation in favor of the unlocked variant, this
separation no longer seems helpful.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Cc: John Kacur <jkacur@redhat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
2010-08-09 00:10:31 +02:00
Linus Torvalds
2d53056973 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (82 commits)
  firewire: core: add forgotten dummy driver methods, remove unused ones
  firewire: add isochronous multichannel reception
  firewire: core: small clarifications in core-cdev
  firewire: core: remove unused code
  firewire: ohci: release channel in error path
  firewire: ohci: use memory barriers to order descriptor updates
  tools/firewire: nosy-dump: increment program version
  tools/firewire: nosy-dump: remove unused code
  tools/firewire: nosy-dump: use linux/firewire-constants.h
  tools/firewire: nosy-dump: break up a deeply nested function
  tools/firewire: nosy-dump: make some symbols static or const
  tools/firewire: nosy-dump: change to kernel coding style
  tools/firewire: nosy-dump: work around segfault in decode_fcp
  tools/firewire: nosy-dump: fix it on x86-64
  tools/firewire: add userspace front-end of nosy
  firewire: nosy: note ioctls in ioctl-number.txt
  firewire: nosy: use generic printk macros
  firewire: nosy: endianess fixes and annotations
  firewire: nosy: annotate __user pointers and __iomem pointers
  firewire: nosy: fix device shutdown with active client
  ...
2010-08-07 17:09:24 -07:00
Linus Torvalds
3b7433b8a8 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: (55 commits)
  workqueue: mark init_workqueues() as early_initcall()
  workqueue: explain for_each_*cwq_cpu() iterators
  fscache: fix build on !CONFIG_SYSCTL
  slow-work: kill it
  gfs2: use workqueue instead of slow-work
  drm: use workqueue instead of slow-work
  cifs: use workqueue instead of slow-work
  fscache: drop references to slow-work
  fscache: convert operation to use workqueue instead of slow-work
  fscache: convert object to use workqueue instead of slow-work
  workqueue: fix how cpu number is stored in work->data
  workqueue: fix mayday_mask handling on UP
  workqueue: fix build problem on !CONFIG_SMP
  workqueue: fix locking in retry path of maybe_create_worker()
  async: use workqueue for worker pool
  workqueue: remove WQ_SINGLE_CPU and use WQ_UNBOUND instead
  workqueue: implement unbound workqueue
  workqueue: prepare for WQ_UNBOUND implementation
  libata: take advantage of cmwq and remove concurrency limitations
  workqueue: fix worker management invocation without pending works
  ...

Fixed up conflicts in fs/cifs/* as per Tejun. Other trivial conflicts in
include/linux/workqueue.h, kernel/trace/Kconfig and kernel/workqueue.c
2010-08-07 12:42:58 -07:00
Grant Likely
2dc1158137 of/device: Replace struct of_device with struct platform_device
of_device is just an alias for platform_device, so remove it entirely.  Also
replace to_of_device() with to_platform_device() and update comment blocks.

This patch was initially generated from the following semantic patch, and then
edited by hand to pick up the bits that coccinelle didn't catch.

@@
@@
-struct of_device
+struct platform_device

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Reviewed-by: David S. Miller <davem@davemloft.net>
2010-08-06 09:25:50 -06:00
Linus Torvalds
3cfc2c42c1 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (48 commits)
  Documentation: update broken web addresses.
  fix comment typo "choosed" -> "chosen"
  hostap:hostap_hw.c Fix typo in comment
  Fix spelling contorller -> controller in comments
  Kconfig.debug: FAIL_IO_TIMEOUT: typo Faul -> Fault
  fs/Kconfig: Fix typo Userpace -> Userspace
  Removing dead MACH_U300_BS26
  drivers/infiniband: Remove unnecessary casts of private_data
  fs/ocfs2: Remove unnecessary casts of private_data
  libfc: use ARRAY_SIZE
  scsi: bfa: use ARRAY_SIZE
  drm: i915: use ARRAY_SIZE
  drm: drm_edid: use ARRAY_SIZE
  synclink: use ARRAY_SIZE
  block: cciss: use ARRAY_SIZE
  comment typo fixes: charater => character
  fix comment typos concerning "challenge"
  arm: plat-spear: fix typo in kerneldoc
  reiserfs: typo comment fix
  update email address
  ...
2010-08-04 15:31:02 -07:00
Linus Torvalds
f63b759c44 Merge branch 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (243 commits)
  V4L/DVB: sms: Convert IR support to use the Remote Controller core
  V4L/DVB: sms: properly initialize IR phys and IR name
  V4L/DVB: standardize names at rc-dib0700 tables
  V4L/DVB: smsusb: enable IR port for Hauppauge WinTV MiniStick
  V4L/DVB: dib0700: Fix RC protocol logic to properly handle NEC/NECx and RC-5
  V4L/DVB: dib0700: properly implement IR change_protocol
  V4L/DVB: dib0700: break keytable into NEC and RC-5 variants
  V4L/DVB: dib0700: avoid bad repeat
  V4L/DVB: Port dib0700 to rc-core
  V4L/DVB: Add a keymap file with dib0700 table
  V4L/DVB: dvb-usb: add support for rc-core mode
  V4L/DVB: dvb-usb: prepare drivers for using rc-core
  V4L/DVB: dvb-usb: get rid of struct dvb_usb_rc_key
  V4L/DVB: rj54n1cb0c: fix a comment in the driver
  V4L/DVB: V4L2: sh_vou: VOU does support the full PAL resolution too
  V4L/DVB: V4L2: sh_mobile_camera_ceu: add support for CSI2
  V4L/DVB: V4L2: soc-camera: add a MIPI CSI-2 driver for SH-Mobile platforms
  V4L/DVB: V4L2: soc-camera: export soc-camera bus type for notifications
  V4L/DVB: V4L2: mediabus: add 12-bit Bayer and YUV420 pixel formats
  V4L/DVB: mediabus: fix ambiguous pixel code names
  ...
2010-08-04 10:38:08 -07:00
Jiri Kosina
d790d4d583 Merge branch 'master' into for-next 2010-08-04 15:14:38 +02:00
Mauro Carvalho Chehab
844a9e93d7 V4L/DVB: sms: Convert IR support to use the Remote Controller core
Rewrites the siano IR implementation. The previous implementation were
non-standard. As such, it has issues if more than one device registers IR,
as there used to have some static constants used during protocol decoding
phase. Also, it used to implement its on RAW decoder, and only for RC5.

The new code uses RC core subsystem for handling IR. This brings several
new features to the driver, including:
	- Allow to dynamically replace the IR keycodes;
	- Supports all existing raw decoders (JVC, NEC, RC-5, RC-6, SONY);
	- Supports lirc dev;
	- Doesn't have race conditions when more than one sms IR is
	  registered;
	- The code size for the IR implementation is very small;
	- it exports the IR features via /sys/class/rc.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:56 -03:00
Mauro Carvalho Chehab
1722f3b376 V4L/DVB: sms: properly initialize IR phys and IR name
sms were using a non-compliant nomenclature for the USB devices. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:54 -03:00
Mauro Carvalho Chehab
4eebfb0a5f V4L/DVB: standardize names at rc-dib0700 tables
Use a more standard way to name those tables, as they're currently used
by the script that coverts those tables to be loaded via userspace.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:53 -03:00
Mauro Carvalho Chehab
20d64443ec V4L/DVB: smsusb: enable IR port for Hauppauge WinTV MiniStick
Add the proper gpio port for WinTV MiniStick, with the information provided
by Michael.

Thanks-to: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:52 -03:00
Mauro Carvalho Chehab
d3c501d193 V4L/DVB: dib0700: Fix RC protocol logic to properly handle NEC/NECx and RC-5
Simplifies the logic for handling firmware 1.20 RC messages, fixing the
logic.

While here, I tried to use a RC-6 remote controller from my TV set, but it
didn't work with dib0700. Not sure why, but maybe this never worked.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:51 -03:00
Mauro Carvalho Chehab
0ffd1ab34a V4L/DVB: dib0700: properly implement IR change_protocol
This patch implements change_protocol callback. With this change,
there's no need for an extra modprobe parameter to specify the
protocol. When a table is loaded (either from in-kernel rc-map
tables or via ir-keytable program), the driver will automatically
change the protocol, in order to work with the given table.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:50 -03:00
Mauro Carvalho Chehab
5af935cc96 V4L/DVB: dib0700: break keytable into NEC and RC-5 variants
Instead of having one big keytable with 2 protocols inside, break it
into two separate tables, being one for NEC and another for RC-5 variants,
and properly identify what variant should be used at the boards entries.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:49 -03:00
Mauro Carvalho Chehab
8dc0900497 V4L/DVB: dib0700: avoid bad repeat
a 250ms delay is too low for this device. It ends by producing false
repeat events. Increase the delay time to 500 ms to avoid troubles.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:48 -03:00
Mauro Carvalho Chehab
72b393106b V4L/DVB: Port dib0700 to rc-core
Use the new rc-core handler at dvb-usb-remote for dib0700 driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:47 -03:00
Mauro Carvalho Chehab
d700226902 V4L/DVB: Add a keymap file with dib0700 table
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:46 -03:00
Mauro Carvalho Chehab
6520342ba9 V4L/DVB: dvb-usb: add support for rc-core mode
Allows dvb-usb drivers to use rc-core, instead of the legacy
implementation.

No driver were ported yet to rc-core, so, some small adjustments
may be needed, when starting to migrate the drivers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:45 -03:00
Mauro Carvalho Chehab
f72a27b8ed V4L/DVB: dvb-usb: prepare drivers for using rc-core
This is a big patch, yet trivial. It just move the RC properties
to a separate struct, in order to prepare the dvb-usb drivers to
use rc-core. There's no change on the behavior of the drivers.

With this change, it is possible to have both legacy and rc-core
based code inside the dvb-usb-remote, allowing a gradual migration
to rc-core, driver per driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:45 -03:00
Mauro Carvalho Chehab
34abf21944 V4L/DVB: dvb-usb: get rid of struct dvb_usb_rc_key
dvb-usb has its own IR handle code. Now that we have a Remote
Controller subsystem, we should start using it. So, remove this
struct, in favor of the similar struct defined at the RC subsystem.

This is a big, but trivial patch. It is a 3 line delect, plus
lots of rename on several dvb-usb files.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:43 -03:00
Guennadi Liakhovetski
0172fea3c0 V4L/DVB: rj54n1cb0c: fix a comment in the driver
RJ54N1CB0C is a Sharp camera sensor.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:42 -03:00
Guennadi Liakhovetski
765fe17c4f V4L/DVB: V4L2: sh_vou: VOU does support the full PAL resolution too
SH7724 datasheet specifies 480 pixels as the VOU maximum vertical resolution.
This is a bug in the datasheet, VOU also supports the full PAL resolution: 576
lines. Adjust the driver accordingly.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:41 -03:00
Guennadi Liakhovetski
b3b5020d8c V4L/DVB: V4L2: sh_mobile_camera_ceu: add support for CSI2
Using CEU with CSI2 on SH-Mobile requires some special configuration of the
former. We also have to switch from calling only one subdev .s_mbus_fmt and
.try_mbus_fmt to calling all subdevices. Take care to increment CSI2 driver
use count to prevent it from unloading, while in use.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:40 -03:00
Guennadi Liakhovetski
077e2c10c9 V4L/DVB: V4L2: soc-camera: add a MIPI CSI-2 driver for SH-Mobile platforms
Some SH-Mobile SoCs implement a MIPI CSI-2 controller, that can interface to
several video clients and send data to the CEU or to the Image Signal
Processor.  This patch implements a v4l2-subdevice driver for CSI-2 to be used
within the soc-camera framework, implementing the second subdevice in addition
to the actual video clients.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:39 -03:00
Guennadi Liakhovetski
52d268a362 V4L/DVB: V4L2: soc-camera: export soc-camera bus type for notifications
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:38 -03:00
Guennadi Liakhovetski
ace6e9799f V4L/DVB: mediabus: fix ambiguous pixel code names
Endianness notation is meaningless for 8 bit YUYV codes. Switch pixel code
names to explicitly state the order of colour components in the data
stream.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:36 -03:00
Michael Krufky
17f93e1e3b V4L/DVB: af9005: use generic_bulk_ctrl_endpoint_response
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Acked-by: Luca Olivetti <luca@ventoso.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:18 -03:00
Jarod Wilson
7e48b30af0 V4L/DVB: dvb: add support for kworld 340u and ub435-q to em28xx-dvb
This adds support for the KWorld PlusTV 340U and KWorld UB345-Q ATSC
sticks, which are really the same device. The sticks have an eMPIA
em2870 usb bridge chipset, an LG Electronics LGDT3304 ATSC/QAM
demodulator and an NXP TDA18271HD tuner -- early versions of the 340U
have a a TDA18271HD/C1, later models and the UB435-Q have a C2.

The stick has been tested succesfully with both VSB_8 and QAM_256 signals.
Its using lgdt3304 support added to the lgdt3305 driver by a prior patch,
rather than the current lgdt3304 driver, as its severely lacking in
functionality by comparison (see said patch for details).

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:17 -03:00
Jiri Slaby
1c488ea9d5 V4L/DVB: DVB: fix dvr node refcounting
In dvb_dvr_release, there is a test dvbdev->users==-1, but users are
never negative. This error results in hung tasks:
  task                        PC stack   pid father
bash          D ffffffffa000c948     0  3264   3170 0x00000000
 ffff88003aec5ce8 0000000000000086 0000000000011f80 0000000000011f80
 ffff88003aec5fd8 ffff88003aec5fd8 ffff88003b848670 0000000000011f80
 ffff88003aec5fd8 0000000000011f80 ffff88003e02a030 ffff88003b848670
Call Trace:
 [<ffffffff813dd4a5>] dvb_dmxdev_release+0xc5/0x130
 [<ffffffff8107b750>] ? autoremove_wake_function+0x0/0x40
 [<ffffffffa00013a2>] dvb_usb_adapter_dvb_exit+0x42/0x70 [dvb_usb]
 [<ffffffffa0000525>] dvb_usb_exit+0x55/0xd0 [dvb_usb]
 [<ffffffffa00005ee>] dvb_usb_device_exit+0x4e/0x70 [dvb_usb]
 [<ffffffffa000a065>] af9015_usb_device_exit+0x55/0x60 [dvb_usb_af9015]
 [<ffffffff813a3f05>] usb_unbind_interface+0x55/0x1a0
 [<ffffffff81316000>] __device_release_driver+0x70/0xe0
...

So check against 1 there instead.

BTW why's the TODO there? Adding TODOs to the code without
descriptions is like adding nothing.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:16 -03:00
Laurent Pinchart
bbafc0cb6c V4L/DVB: uvc: Move constants and structures definitions to linux/usb/video.h
The UVC host and gadget drivers both define constants and structures in
private header files. Move all those definitions to linux/usb/video.h
where they can be shared by the two drivers (and be available for
userspace applications).

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:15 -03:00
Antti Palosaari
c89f66f629 V4L/DVB: af9013: fix comments
Fix comments. It is demodulator driver not DVB USB -bridge.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:14 -03:00
Antti Palosaari
ce99efa53e V4L/DVB: af9013: output fw version as four digit long
Firmware version is four digit long. Print all four digits instead of
three digits used earlier.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:13 -03:00
Antti Palosaari
8af5e3813b V4L/DVB: af9013: af9013_read_status() refactoring
Function af9013_read_status() refactoring. Read lock bits in different
order to save count of register reads.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:12 -03:00
Antti Palosaari
737fabf051 V4L/DVB: af9013: program tuner before demodulator
Program tuner before demodulator in case of channel set. Earlier it was
programmed during demodulator programming. This seems to resolve weird
error where demodulator misses sometimes ability to gain lock.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:11 -03:00
Antti Palosaari
2606cfa3f6 V4L/DVB: af9015: support for AverMedia AVerTV Volar M (A815Mac)
Add USB ID 07ca:815a for AverMedia AVerTV Volar M (A815Mac).

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:10 -03:00
Antti Palosaari
3b11f4e90d V4L/DVB: af9013: add support for firmware 5.1.0.0
Add support for new firmware version 5.1.0.0.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:09 -03:00
Jean-François Moine
76ed0fe757 V4L/DVB: gspca - vc032x: Move the first VC0321 settings to sd_init()
The first VC0321 settings were done at webcam connection only. They must also
be done on resume after suspend.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:07 -03:00
Jean-François Moine
19697b546c V4L/DVB: gspca - sonixj: Do the audio input work for webcams with a microphone
The bit 0x04 of the bridge register 02 (GPIO) is used for audio connection
in webcams containing the bridge SN9C105. This patch sets it correctly,
according to the presence of an audio device.

Tested-by: Kyle Baker <kyleabaker@gmail.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:06 -03:00
Jean-François Moine
35680baa68 V4L/DVB: gspca - main: Handle the audio device
When there is an audio device, use a lower alternate setting.
This patch does not fix correctly all audio and bandwidth problems.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:06 -03:00
Jean-François Moine
c4dc692ce6 V4L/DVB: gspca - main: Adjust and remove some debug messages
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:05 -03:00
Jean-François Moine
a4f96eb2b1 V4L/DVB: gspca - main: Remove useless audio ioctl's
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:04 -03:00
Jean-François Moine
a2ba6f27cd V4L/DVB: gspca - main: Fix a compilation warning
Reported-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:02 -03:00
Dan Carpenter
b5f5933a6a V4L/DVB: au0828: move dereference below sanity checks
This function has sanity checks to make sure that "dev" is non-null.  I
moved the dereference down below the checks.  In the current code "dev"
is never actually null.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:01 -03:00
Dan Carpenter
49b7a12c0a V4L/DVB: media/IR: testing the wrong variable
There is a typo here.  We meant to test "rbuf" instead of "drv".  We
already tested "drv" earlier.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:43:00 -03:00
Andrew Morton
febe2ea10e V4L/DVB: "dib3000mc: reduce large stack usage" fix
s/ENODEV/ENOMEM, per Andreas.

This fix got lost when someone merged "dib3000mc: reduce large stack
usage".  Please don't lose fixes.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:59 -03:00
Jiri Slaby
37b58bfe4b V4L/DVB: VIDEO: ivtvfb, remove unneeded NULL test
Stanse found that in ivtvfb_callback_cleanup and ivtvfb_callback_init
there are unneeded tests for itv being NULL. But itv is initialized
as container_of with non-zero offset in those functions, so it is
never NULL (even if v4l2_dev is). This was found because itv is
dereferenced earlier than the test.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reviewed-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 16:42:57 -03:00