Commit Graph

193502 Commits

Author SHA1 Message Date
Dan Carpenter
b9245d80c3 V4L/DVB: ov511: cleanup: remove unneeded null check
We dereference "ov" unconditionally throughout the function so there is
no way it can be NULL here.  This code has been around for ages so if
it were possible for "ov" to be NULL someone would have complained.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:13 -03:00
Dan Carpenter
16ee9bb100 V4L/DVB: media/mem2mem: dereferencing free memory
We dereferenced "ctx" on the error path.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:13 -03:00
Peter Huewe
a7b39036cf V4L/DVB: media/IR: Add missing include file to rc-map.c
This patch adds a missing include linux/delay.h to prevent
build failures[1-5]

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:12 -03:00
Dan Carpenter
83b6601c88 V4L/DVB: dvb/stv6110x: cleanup error handling
The "stv6110x" is NULL so we can just return directly without calling
kfree().  Also I changed the printk() to make checkpatch.pl happy.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:12 -03:00
Devin Heitmueller
1a2f7178cb V4L/DVB: ngene: Add lgdt3303 and mt2131 deps to Kconfig
Add the demod and tuner dependencies required for the Avermedia m780 to the
Kconfig for the ngene driver.

Thanks to Oliver Endriss for pointing this out.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:11 -03:00
Devin Heitmueller
1899e97c52 V4L/DVB: ngene: start separating out DVB functions into separate file
Start moving the dvb specific code to ngene-dvb.c.  Note that there is still
stuff in ngene-core.c which could potentially be moved out, but it will require
considerable reworking of the logic in order to continue to properly support
DVB while also being able to support transport streams coming from analog MPEG
encoders.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:09 -03:00
Devin Heitmueller
cbddcba695 V4L/DVB: ngene: split out card specific code into a separate file
Split out the card profiles into a new file called ngene-cards.c.  This is
part of a larger refactoring of the driver in preparation for adding analog
support.

Note that this patch makes *no* functional change - all I did was cut/paste the
code and add the function prototypes to ngene.h as needed.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:08 -03:00
Devin Heitmueller
cb1c0f8e70 V4L/DVB: ngene: split out i2c code into a separate file
Split out the i2c related code from the ngene-core.c into a new file called
ngene-i2c.c.  This is part of a larger refactoring of the driver in preparation
for adding analog support.

Note that this patch makes *no* functional change - all I did was cut/paste the
code and add the function prototypes to ngene.h as needed.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:07 -03:00
Devin Heitmueller
0abf26291d V4L/DVB: ngene: add initial support for digital side of Avermedia m780
Add ATSC/QAM support for the Avermedia m780.  Note that this patch does
not include any analog support for the board, as the ngene bridge driver does
not yet have analog implemented

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:07 -03:00
Devin Heitmueller
fdafc96c91 V4L/DVB: ngene: properly support boards where channel 0 isn't a TS input
The current code assumes that channel zero is always a TS input, which would
result in an oops if the "one_adapter" modprobe option is 1 (which it is by
default) and the board in question has something else on channel zero (which
is the case for the Avermedia m780, which has it's analog input wired to UVI1)

The code now explicitly tracks the first adapter created and ensures that
other channels cannot accidentially be associated with a NULL adapter.

Also, eliminate what appears to be a typo where all of the channel parameters
are getting associated with stream zero's properties, which will work if you
happen to have a dual stream board with the exact same configuration, but if
they differ then the second stream is going to end up with the first stream's
configuration.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:06 -03:00
Mauro Carvalho Chehab
668293a06e V4L-DVB: ngene: make sure that tuner headers are included
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:06 -03:00
Dan Carpenter
a18e659170 V4L/DVB: media/az6027: handle -EIO failure
If the az6027_usb_in_op() returns a negative errno ret is -EIO and in
that case the value of b[0] may be undefined.  The original code
assigned 0 to ret, but since it's already 0 now we can skip that.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:05 -03:00
Dan Carpenter
32ec4576c3 V4L/DVB: media/az6027: doing dma on the stack
I changed the dma buffers to use allocated memory instead of stack
memory.

The reason for this is documented in Documentation/DMA-API-HOWTO.txt
under the section:  "What memory is DMA'able?"  That document was only
added a couple weeks ago and there are still lots of modules which
haven't been corrected yet.  Btw. Smatch includes a pretty good test to
find places which use stack memory as a dma buffer.  That's how I found
these.  (http://smatch.sf.net).

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:05 -03:00
Dan Carpenter
9723dbb034 V4L/DVB: media/IR/imon: potential double unlock on error
If there is an error here we should unlock in the caller (which is
imon_init_intf1()).  We can remove this stray unlock.

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-05-19 12:59:04 -03:00
Dan Carpenter
5f6e3c8e34 V4L/DVB: media/IR/imon: testing the wrong variable
There is a typo here.  We meant to test "ir" instead of "props".  The
"props" variable was tested 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-05-19 12:59:03 -03:00
Dan Carpenter
f03900d696 V4L/DVB: media/IR/imon: precendence issue: ! vs ==
The original condition is always false because ! has higher precedence
than == and neither 0 nor 1 is equal to IMON_DISPLAY_TYPE_VGA.

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-05-19 12:59:03 -03:00
Mats Randgaard
6fa7dac4b8 V4L/DVB: tvp7002.c: fix some copy-paste errors in the comments
Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:02 -03:00
Mats Randgaard
37eb446499 V4L/DVB: tvp7002.c: Add support for enum_dv_presets
Implement enum_dv_presets in tvp7002.

Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:02 -03:00
Mats Randgaard
6003b5c7e6 V4L/DVB: v4l2-subdev.h: Add support for enum_dv_preset
The op enum_dv_preset was missing in this header but is needed by subdev
drivers with DV functionality.

Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:01 -03:00
Brian Johnson
6ea23bd0bb V4L/DVB: gspca - sn9c20x: Fix non working mt9v111 sensor
Signed-off-by: Brian Johnson <brijohn@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:01 -03:00
Brian Johnson
33ddc16f10 V4L/DVB: gspca - sn9c20x: HAS_BUTTON flag -> HAS_NO_BUTTON flag
Reverse HAS_BUTTON logic since most webcams either have a button or if
they don't don't bother to send any interrupts. However I have at least
one model that appears to leave the button GPIO floating and can send
a bogus interrupt.

Signed-off-by: Brian Johnson <brijohn@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:00 -03:00
Brian Johnson
5d26ed9102 V4L/DVB: gspca - sn9c20x: Add another MSI laptop to upsidedown device list
Signed-off-by: Brian Johnson <brijohn@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:59 -03:00
Brian Johnson
e077f86bac V4L/DVB: gspca - sn9c20x: Add another laptop to upsidedown device list
Signed-off-by: Brian Johnson <brijohn@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:59 -03:00
Hans Verkuil
3e56b0f09c V4L/DVB: ivtv: fix VIDIOC_S_PRIORITY handling
VIDIOC_S_PRIORITY is also part of the ioctls that need to check the
access priority.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:58 -03:00
Hans Verkuil
4d6c871ac3 V4L/DVB: usbvision: add delay before detecting the saa711x
The detection of the saa711x often failed. Adding a small delay before
attempting to detect it fixed this.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:58 -03:00
Hans Verkuil
aeb506aaaa V4L/DVB: usbvision: don't use usb_set_intfdata, let v4l2_device_register handle this
v4l2_device_register already sets intfdata, no need to do this again.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:57 -03:00
Hans Verkuil
f2b305cd67 V4L/DVB: hdpvr: fix disconnect sequence
Disconnecting the HDPVR caused a kernel oops if lockdep was enabled.
In addition, if an app still had video0 open and attempted to call ioctl
when the device was already disconnected the system would crash.

Move the freeing and cleanup code to the release function: that is the
right place for it since you know when you get there that nobody is
using the device.

Also removed usb_set_intfdata: v4l2_device_register sets this already
to v4l2_dev.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:57 -03:00
Hans Verkuil
a2bdc5e6c4 V4L/DVB: radio-am800: let v4l2_device_(un)register handle usb_get/set_intfdata
v4l2_device_register already sets the usb intfdata to v4l2_dev. So use
that instead.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:56 -03:00
Hans Verkuil
dd0daf2a6f V4L/DVB: v4l2-dev: remove unnecessary lock around atomic clear_bit
No need to lock when unregistering the device: clear_bit is already an
atomic operation.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:56 -03:00
Hans Verkuil
0eed42e48a V4L/DVB: em28xx: g_tuner must set type field
The 'type' field was undefined but should be set to ANALOG_TV.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:55 -03:00
Hans Verkuil
cf19cd3d8a V4L/DVB: tvp7002: fix query_dv_preset
If no signal or valid format is detected, then VIDIOC_QUERY_DV_PRESET must
return 0 and set the preset to V4L2_DV_INVALID.

This driver returned an error instead.

Also simplified the kernel messages a bit: change v4l2_err to v4l2_dbg (not
detecting a signal/valid format is not an error, so only print this info when
debug == 1) and do not call v4l_fill_dv_preset_info: it's overkill to do this
just for a debug message.

Thanks to Mats Randgaard for bringing this to my attention.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:54 -03:00
Hans Verkuil
ffb4877ba0 V4L/DVB: v4l2-common: simplify prio utility functions
v4l2_prio_init/open/close returned an int when in fact they would
always return 0. Make these void functions.

v4l2_prio_close and v4l2_prio_check pass an enum v4l2_priority as a
pointer for no good reason. Replace with a normal enum v4l2_priority
argument.

These changes will simplify the work of moving priority handling into
the v4l core.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:54 -03:00
Hans Verkuil
530d2d3206 V4L/DVB: bttv: remove bogus prio check in g_frequency
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:53 -03:00
Hans Verkuil
b4162f4a40 V4L/DVB: Documentation: fix small error in the ENUMINPUT doc
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:53 -03:00
Hans Verkuil
aae6e33f8d V4L/DVB: cx18/cx25840/saa7115/tvp5150: remove vbi support from s_fmt
Now that s_fmt is no longer used for VBI format setup in subdevs, remove
the VBI support from s_fmt.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:52 -03:00
Hans Verkuil
4a61ecbd34 V4L/DVB: em28xx: switch to new vbi subdev ops
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:51 -03:00
Hans Verkuil
7e87ddb101 V4L/DVB: cx231xx: switch to new vbi subdev ops
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:51 -03:00
Hans Verkuil
09419af39b V4L/DVB: pvrusb2: switch to new vbi subdev ops
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:50 -03:00
Hans Verkuil
add632cd25 V4L/DVB: cx18: switch to new vbi subdev ops
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:50 -03:00
Hans Verkuil
4ff0790b6d V4L/DVB: ivtv: switch to new vbi subdev ops
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:49 -03:00
Hans Verkuil
d37dad497c V4L/DVB: tvp5150: support new vbi ops to set/get VBI format
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:49 -03:00
Hans Verkuil
1dbf85397a V4L/DVB: saa7127: support new vbi ops to set/get VBI format
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:48 -03:00
Hans Verkuil
1585927de6 V4L/DVB: cx18: support new vbi ops to set/get VBI format
Also removed the bogus zeroing of fmt.sliced when setting up raw VBI.
This should have been removed in ivtv, but it was just copied-and-pasted
into cx18.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:48 -03:00
Hans Verkuil
5393db43f4 V4L/DVB: cx25840: support new vbi ops to set/get VBI format
Also removed the bogus zeroing of fmt.sliced when setting up raw VBI.

Switching between raw and sliced VBI changed in 2.6.28 and this memset
should have been removed at that time. It was never noticed because
the bridge driver will fill in the fmt.vbi values anyway.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:47 -03:00
Hans Verkuil
63d8adccec V4L/DVB: saa7115: support new vbi ops to set/get VBI format
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:46 -03:00
Hans Verkuil
54aefafbf3 V4L/DVB: v4l: add new subdev vbi ops to handle raw and sliced vbi
Currently raw and sliced vbi is setup using the video g/s_fmt ops.
However, we want to split off the vbi formatting into separate ops
so the first step is to create those new ops.

The next step will be to convert subdev drivers and bridge drivers
to use the new ops. And in the final step we can start converting
the video g/s_fmt ops to the new (and more appropriate) mediabus
format ops.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:46 -03:00
Hans Verkuil
32cd527f59 V4L/DVB: v4l: move vbi-specific video ops to a new vbi ops struct
Only a relatively small number of video receivers and transmitters actually
support VBI. So start moving the vbi specific ops to an ops struct of their
own.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:45 -03:00
Jean-François Moine
b26d6e2178 V4L/DVB: gspca - main: Convert wMaxPacketSize from little endian 16 to cpu
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:45 -03:00
Laurent Pinchart
57c6d2e999 V4L/DVB: MAINTAINERS: Update uvcvideo web site address
The web site has moved to a new location, update the MAINTAINERS file.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:44 -03:00
Laurent Pinchart
cf7a50eeb6 V4L/DVB: uvcvideo: Prevent division by 0 when control step value is 0
The control step values reported by the device are used as a divisor
unchecked, which can result in a division by zero.

Check the step value and make it 1 when null.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:44 -03:00