Commit Graph

211764 Commits

Author SHA1 Message Date
Mauro Carvalho Chehab
2b361ab6d5 [media] lirc_igorplugusb: Fix a compilation waring
drivers/staging/lirc/lirc_igorplugusb.c: In function ‘usb_remote_probe’:
drivers/staging/lirc/lirc_igorplugusb.c:393: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘unsigned int’

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:17:01 -02:00
Mauro Carvalho Chehab
1bede7521d [media] videobuf-dma-sg: Use min_t(size_t, PAGE_SIZE ..)
As pointed by Laurent:

I think min_t(size_t, PAGE_SIZE, size) is the preferred way.

Thanks-to: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:17:00 -02:00
Geert Uytterhoeven
22c00854f3 [media] lirc: Make struct file_operations pointer const
struct file_operations was made const in the drivers, but not in struct
lirc_driver:

drivers/staging/lirc/lirc_it87.c:365: warning: initialization discards qualifiers from pointer target type
drivers/staging/lirc/lirc_parallel.c:571: warning: initialization discards qualifiers from pointer target type
drivers/staging/lirc/lirc_serial.c:1073: warning: initialization discards qualifiers from pointer target type
drivers/staging/lirc/lirc_sir.c:482: warning: initialization discards qualifiers from pointer target type
drivers/staging/lirc/lirc_zilog.c:1284: warning: assignment discards qualifiers from pointer target type

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:16:59 -02:00
Mauro Carvalho Chehab
7242063018 V4L/DVB: Fix a merge conflict that affects unlock_ioctl
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:16:58 -02:00
Mauro Carvalho Chehab
be737a8269 V4L/DVB: tm6000: Fix warnings due to a small array size
drivers/staging/tm6000/tm6000-stds.c:101: warning: excess elements in array initializer
drivers/staging/tm6000/tm6000-stds.c:101: warning: (near initialization for ‘tv_stds[0].common’)
drivers/staging/tm6000/tm6000-stds.c:160: warning: excess elements in array initializer
drivers/staging/tm6000/tm6000-stds.c:160: warning: (near initialization for ‘tv_stds[1].common’)
drivers/staging/tm6000/tm6000-stds.c:219: warning: excess elements in array initializer
drivers/staging/tm6000/tm6000-stds.c:219: warning: (near initialization for ‘tv_stds[2].common’)
drivers/staging/tm6000/tm6000-stds.c:336: warning: excess elements in array initializer
drivers/staging/tm6000/tm6000-stds.c:336: warning: (near initialization for ‘tv_stds[4].common’)

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:16:57 -02:00
Mauro Carvalho Chehab
d302548a9f V4L/DVB: saa7134-input can't be a module right now
There are some symbols at saa7134-input that are used on saa7134
and vice-versa. Due to that, module install fails.

So, partially revert commit 9f495cf7d691c99bf7bdcec9f35fcfdad2cf9ae9.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:16:52 -02:00
Mauro Carvalho Chehab
d026d82843 V4L/DVB: videobuf-dma-sg: Fix a warning due to the usage of min(PAGE_SIZE, arg)
drivers/media/video/videobuf-dma-sg.c: In function ‘videobuf_pages_to_sg’:
drivers/media/video/videobuf-dma-sg.c:119: warning: comparison of distinct pointer types lacks a cast
drivers/media/video/videobuf-dma-sg.c:120: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:21 -02:00
Jean-François Moine
266815e255 V4L/DVB: gspca - sonixj: Have 0c45:6130 handled by sonixj instead of sn9c102
The driver sn9c102 does not know about the sensor mi0360b.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:21 -02:00
Jean-François Moine
a95bd640e7 V4L/DVB: gspca - sonixj: Bad detection of the end of image
The 'end of image' block may be splitted between two ISOC packets.
This case was not tested, so, some images could be lost and concatenated
to previous one(s), raising 'frame overflow' errors.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:21 -02:00
Jean-François Moine
a067db8473 V4L/DVB: gspca - sonixj: Add sensor mi0360b
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:21 -02:00
Jean-François Moine
294d8b4a96 V4L/DVB: gspca - mr97310a: Declare static the constant tables
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:21 -02:00
Jean-François Moine
2856643e2e V4L/DVB: gspca - many subdrivers: Handle the buttons when CONFIG_INPUT=m
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:20 -02:00
Jarkko Nikula
85c55efb0a V4L/DVB: radio-si4713: Release i2c adapter in driver cleanup paths
Call to i2c_put_adapter was missing in radio_si4713_pdriver_probe and
radio_si4713_pdriver_remove.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:20 -02:00
Dmitri Belimov
73f4d265f6 V4L/DVB: tm6000+audio
I rework my last patch for audio and now audio works well. This patch
can be submited to GIT tree Quality of audio now is good for SECAM-DK.
For other standard I set some value from datasheet need some tests.

1. Fix pcm buffer overflow
2. Rework pcm buffer fill method
3. Swap bytes in audio stream
4. Change some registers value for TM6010
5. Change pcm buffer size

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:20 -02:00
Matthew Garrett
3dae8b41dc V4L/DVB: uvc: Enable USB autosuspend by default on uvcvideo
We've been doing this for a while in Fedora without any complaints.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:20 -02:00
Mauro Carvalho Chehab
bfc3d57ff7 V4L/DVB: tda18271: Add some hint about what tda18217 reg ID returned
Instead of doing:

[   82.581639] tda18271 4-0060: creating new instance
[   82.588411] Unknown device detected @ 4-0060, device not supported.
[   82.594695] tda18271_attach: [4-0060|M] error -22 on line 1272
[   82.600530] tda18271 4-0060: destroying instance

Print:
[  468.740392] Unknown device (0) detected @ 4-0060, device not supported.

for the error message, to help detecting what's going wrong with the
device.

This helps to detect when the driver is using the wrong I2C bus (or have
the i2g gate switch pointing to the wrong place), on devices like cx231xx
that just return 0 on reads to a non-existent i2c device.

Reviewed-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:19 -02:00
Hans Verkuil
3fd8e647ea V4L/DVB: v4l2-common: Move v4l2_find_nearest_format from videodev2.h to v4l2-common.h
This function is an internal API and belongs in v4l2-common.h, not
videodev.h. The return pointer and probe argument should be const as well.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:19 -02:00
Hans Verkuil
e3cfd447d0 V4L/DVB: videobuf: add ext_lock argument to the queue init functions (part 2)
Missed a few init functions on non-Intel platforms the first time :-(

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:19 -02:00
Jean-François Moine
4bf8b67902 V4L/DVB: gspca - sonixj: Propagate USB errors to higher level
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:19 -02:00
Jean-François Moine
cdd15a0a1b V4L/DVB: gspca - spca505: Remove the eeprom write commands of NxUltra
With a null request byte, these commands prevented the next commands
to be executed.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:19 -02:00
Jean-François Moine
a2efdd7b18 V4L/DVB: gspca - cpia1: Fix compilation warning 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:06:18 -02:00
Jean-François Moine
8129888a7a V4L/DVB: gspca - benq: 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:06:18 -02:00
Jean-François Moine
8dbf3e7c3a V4L/DVB: gspca - benq: 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:06:18 -02:00
Guennadi Liakhovetski
57bee29d6e V4L/DVB: soc-camera: allow only one video queue per device
Multiple user-space application instances can open the same video device, but
it only makes sense for one of them to manage the videobuffer queue and set
video format of the device. Restrict soc-camera respectively.

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
Guennadi Liakhovetski
79c6ff93c7 V4L/DVB: V4L2: add a generic function to find the nearest discrete format to the required one
Many video drivers implement a fixed set of frame formats and thus face a task
of finding the best match for a user-requested format. Implementing this in a
generic function has also an advantage, that different drivers with similar
supported format sets will select the same format for the user, which improves
consistency across drivers.

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
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