Commit Graph

6441 Commits

Author SHA1 Message Date
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
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
Laurent Pinchart
a90ef69c1f V4L/DVB: uvcvideo: Flag relative controls as write-only
The UVC relative controls (exposure time, iris, focus, zoom, pan/tilt)
are write-only (despite the UVC specification stating that the GET_CUR
request is mandatory). Mark the controls as such, and report the related
V4L2 controls V4L2_CTRL_FLAG_WRITE_ONLY.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:43 -03:00
Laurent Pinchart
6142120683 V4L/DVB: uvcvideo: Add support for V4L2_PIX_FMT_Y16
The Miricle 307K (17dc:0202) camera reports a 16-bit greyscale format,
support it in the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:42 -03:00
Randy Dunlap
acc8cc4386 V4L/DVB: [-next] media: fix vivi build error
vivi uses find_font(), which is only available when FONTS
is enabled, so make vivi depend on FONTS.

ERROR: "find_font" [drivers/media/video/vivi.ko] undefined!

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:42 -03:00
Dmitri Belimov
0faa2ed5bf V4L/DVB: saa7134: Add support new Behold TV cards
[dougsland@redhat.com: Fixed cards numbers reject due changes in saa7134.h]

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:41 -03:00
Pawel Osciak
9b55843413 V4L/DVB: videobuf: make poll() report proper flags for output video devices
According to the V4L2 specification, poll() should set POLLOUT | POLLWRNORM
flags for output devices after the frame has been displayed.

Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:40 -03:00
Arnout Vandecappelle
fc7f8fd42c V4L/DVB: buf-dma-sg.c: don't assume nr_pages == sglen
videobuf_pages_to_sg() and videobuf_vmalloc_to_sg() happen to create
a scatterlist element for every page.  However, this is not true for
bus addresses, so other functions shouldn't rely on the length of the
scatter list being equal to nr_pages.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:40 -03:00
Mauro Carvalho Chehab
c06b062bea V4L/DVB: videobuf-vmalloc: remove __videobuf_sync()
videobuf-core checks if .sync ops is defined before calling.

So, we don't need a do-nothing function.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:39 -03:00
Mauro Carvalho Chehab
97f8105dcd V4L/DVB: videobuf-dma-sg: remove external function videobuf_dma_sync()
While analyzing one of the videobuf patches, I noticed that
videobuf_dma_sync is only used internally inside videobuf-dma-sg.
So, let's remove this function, merging the code at __videobuf_dma_sync()

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:38 -03:00
Hans Verkuil
b2dfd1a45f V4L/DVB: videobuf: Add support for V4L2_BUF_FLAG_ERROR
For recoverable stream errors dqbuf() now returns 0 and the error flag
is set instead of returning EIO.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:37 -03:00
Kirill Smelkov
b7589ac4ae V4L/DVB: bttv: Add another ids for IVC-200
I have 3 IVC-200 cards (with 4 video channels on each).

2 of the cards identify theirselves as 000[0-3]:a155 (ids already in
cardlist) and another one identifies itself as 080[0-3]:a155, which ids
were unknown so far.

Note - it's IVC-200, not IVC-200G.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:29 -03:00
Pierre Gronlier
16bfdaa41b V4L/DVB: Read MAC for TeVii S470 PCI-e DVB-S2 card
This patch retrieve the correct mac address from the eeprom for TeVii
S470 card.

Signed-off-by: Pierre Gronlier <pierre.gronlier@gmail.com>
Cc: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:28 -03:00
Mauro Carvalho Chehab
5013318ca4 V4L/DVB: em28xx: fix locks during dvb init sequence
Serialize DVB initialization, to avoid it to happen while analog
initialization is still happening.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:28 -03:00
Istvan Varga
d922b8ea33 V4L/DVB: cx88: fix setting input when using DVB
In cx88-mpeg.c, there is code that sets core->input to CX88_VMUX_DVB.
However, this may be incorrect, since core->input is actually an
index to core->board.input[], which has not enough elements to be
indexed by the value of CX88_VMUX_DVB. So, the modified code searches
core->board.input[] for an input with a type of CX88_VMUX_DVB, and if
it does not find one, the index is simply set to zero.
The change may not have much effect, though, since it appears the only
case when core->input is actually used is when the current input is
being queried.

Signed-off-by: Istvan Varga <istvanv@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:27 -03:00
David Härdeman
96c1f99621 V4L/DVB: ir-core: remove ir-functions usage from cx231xx
Convert drivers/media/video/cx231xx/cx231xx-input.c to not
rely on ir-functions.c.

(I do not have the hardware so I can only compile test this)

Signed-off-by: David Härdeman <david@hardeman.nu>
Cc: Srinivasa Deevi <srinivasa.deevi@conexant.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:26 -03:00
David Härdeman
5a143b12eb V4L/DVB: ir-core: remove IR_TYPE_PD
Pulse-distance is not a protocol, it is a line coding (used by some protocols,
like NEC). Looking at the uses of IR_TYPE_PD, the real protocol seems to be
NEC in all cases (drivers/media/video/cx88/cx88-input.c is the only user).

So, remove IR_TYPE_PD while it is still easy to do so.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:25 -03:00
Laurent Pinchart
0a4f8d0798 V4L/DVB: event: Export the v4l2_event_init and v4l2_event_dequeue functions
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:24 -03:00
Sakari Ailus
f3cd385a9c V4L/DVB: V4L: Events: Replace bad WARN_ON() with assert_spin_locked()
spin_is_locked() always returns zero when spinlock debugging is
disabled on a single CPU machine. Replace WARN_ON() with
assert_spin_locked().

Thanks to Laurent Pinchart for spotting this!

Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:23 -03:00
Jean-François Moine
a85675316f V4L/DVB: gspca - zc3xx: Fix the gamma calculation from the contrast
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:16 -03:00
Jean-François Moine
07ae4918f7 V4L/DVB: gspca - zc3xx.c: Remove the brightness control
Brightness is done by the gamma tables and not by single bridge registers.
It will be back as soon as an algorithm will be found.

This change also fixes the autogain problem found by Jose Alberto Reguero
(webcam 046d:08dd).

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:16 -03:00
Jean-François Moine
a6a86f0d2c V4L/DVB: gspca - zc3xx: Fix the light frequency values for pas202b and pb0330
The error was introduced by "gspca - zc3xx: Rename the USB sequences."
in commit e945e2e44c798f84494260c02478d3c23965bb93.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:15 -03:00
Jean-François Moine
03ed2a11ea V4L/DVB: gspca - sonixj: Add sensor soi768
The webcams 0c45:613e may contain the sensors ov7630 or soi768.
A sensor probe is done at init time when the sensor is declared ov7630.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:15 -03:00
Jean-François Moine
e3302cad9b V4L/DVB: gspca - sonixj: Reset the bridge after sensor probe
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:14 -03:00
Jean-François Moine
0a85c74b5d V4L/DVB: gspca - sonixj: Adjust minor values of sensor ov7630. - set the color gains to null at init time - change value of register 0x9a
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:14 -03:00
Jean-François Moine
fff2f708f8 V4L/DVB: gspca - sonixj: Set the colors at startup time
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:13 -03:00
Jean-François Moine
cfd23c8eca V4L/DVB: gspca - sonixj: Adjust debug output. - fix bad function name - add debug info for i2c buffer write
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:12 -03:00
Jean-François Moine
bdd2b93c44 V4L/DVB: gspca - sonixj: Split the init sequence of sensor ov7630
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:12 -03:00
Pawel Osciak
96f2ec67b8 V4L/DVB: v4l: videobuf: qbuf now uses relevant v4l2_buffer fields for OUTPUT types
According to the V4L2 specification, applications set bytesused, field and
timestamp fields of struct v4l2_buffer when the buffer is intended for
output and memory type is MMAP. This adds proper copying of those values
to videobuf_buffer so drivers can use them.

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-05-19 12:58:11 -03:00
Vaibhav Hiremath
72fcf2a8da V4L/DVB: omap_vout:V4L2 Display: Changed enum return type to int
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Muralidharan Karicheri <mkaricheri@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:11 -03:00
Vaibhav Hiremath
5c7ab6348e V4L/DVB: V4L2: Add support for OMAP2/3 V4L2 display driver on top of DSS2
Features Supported -
	1. Provides V4L2 user interface for the video pipelines of DSS
	2. Basic streaming working on LCD, DVI and TV.
	3. Works on latest DSS2 library from Tomi
	4. Support for various pixel formats like YUV, UYVY, RGB32, RGB24,
	   RGB565
	5. Supports Alpha blending.
	6. Supports Color keying both source and destination.
	7. Supports rotation.
	8. Supports cropping.
	9. Supports Background color setting.
	10. Allocated buffers to only needed size

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Reviewed-by: Muralidharan Karicheri <mkaricheri@gmail.com>
Signed-off-by: Murailidharan Karicheri <mkaricheri@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:10 -03:00
Hans Verkuil
092501936f V4L/DVB: ivtv: support the new events API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:08 -03:00
Sakari Ailus
d3d7c96356 V4L/DVB: V4L: Events: Support event handling in do_ioctl
Add support for event handling to do_ioctl.

Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:07 -03:00
Sakari Ailus
c3b5b0241f V4L/DVB: V4L: Events: Add backend
Add event handling backend to V4L2. The backend handles event subscription
and delivery to file handles. Event subscriptions are based on file handle.
Events may be delivered to all subscribed file handles on a device
independent of where they originate from.

Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:06 -03:00
Sakari Ailus
fda1021477 V4L/DVB: V4L: Events: Add new ioctls for events
This patch adds a set of new ioctls to the V4L2 API. The ioctls conform to
V4L2 Events RFC version 2.3:

<URL:http://www.spinics.net/lists/linux-media/msg12033.html>

Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:06 -03:00
Sakari Ailus
1babcb460f V4L/DVB: V4L: File handles
This patch adds a list of v4l2_fh structures to every video_device.
It allows using file handle related information in V4L2. The event interface
is one example of such use.

The use of v4l2_fh is not mandatory for drivers.

Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:04 -03:00
Pawel Osciak
96d8eab5d0 V4L/DVB: [v5,2/2] v4l: Add a mem-to-mem videobuf framework test device
This is a virtual device driver for testing the memory-to-memory framework.

This virtual device uses in-memory buffers for both its source and destination.
It is capable of multi-instance, multi-buffer-per-transaction operation
(via the mem2mem framework).

[mchehab@redhat.com: use videobuf_queue_to_vaddr instead of the removed videobuf_queue_to_vmalloc]
Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Vaibhav Hiremath <hvaibhav@ti.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:04 -03:00
Pawel Osciak
7f98639def V4L/DVB: add memory-to-memory device helper framework for videobuf
A mem-to-mem device is a device that uses memory buffers passed by
userspace applications for both their source and destination data. This
is different from existing drivers, which utilize memory buffers for either
input or output, but not both.

In terms of V4L2 such a device would be both of OUTPUT and CAPTURE type.

Examples of such devices would be: image 'resizers', 'rotators',
'colorspace converters', etc.

This patch adds a separate Kconfig sub-menu for mem-to-mem devices as well.

Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Vaibhav Hiremath <hvaibhav@ti.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:03 -03:00
Xiaolin Zhang
35e6aa9fc3 V4L/DVB: core: add support for more color effects
Add support for more color effects (negative, sketch, emboss, etc) by
extending the  v4l2_colorfx enum items.

Signed-off-by: Xiaolin Zhang <xiaolin.zhang@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:03 -03:00
Guennadi Liakhovetski
aec11e5d49 V4L/DVB: V4L: v4l2-subdev driver for AK8813 and AK8814 TV-encoders from AKM
AK8814 only differs from AK8813 by included Macrovision Copy Protection
function. This patch adds a driver for AK8813 and AK8814 I2C PAL/NTSC TV
encoders.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:02 -03:00
Guennadi Liakhovetski
a81fb9b223 V4L/DVB: V4L: SuperH Video Output Unit (VOU) driver
A number of SuperH Mobile SoCs, including sh7724, include a Video Output Unit.
This patch adds a video (V4L2) output driver for it. The driver uses v4l2-subdev
and mediabus APIs to interface to TV encoders.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:01 -03:00
Guennadi Liakhovetski
f35f1bb8fc V4L/DVB: videobuf-dma-contig.c: simplify pointer dereference
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:01 -03:00
Guennadi Liakhovetski
ab56d5eb58 V4L/DVB: soc-camera: update comment
soc-camera no longer requires .set_crop() implementations to update their
argument. Update the commentary.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:00 -03:00
Guennadi Liakhovetski
e622681d12 V4L/DVB: sh_mobile_ceu_camera.c: preserve output window on VIDIOC_S_CROP
Current version of sh_mobile_ceu_camera.c interprets the V4L2 API specification
of the VIDIOC_S_CROP ioctl as "change input (for capture devices) area,
preserve scaling factors, therefore change output window," whereas a more
intuitive interpretation of the API is "change input area, preserve output
window." Switch sh_mobile_ceu_camera.c to use this interpretation.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:59 -03:00
Hans Verkuil
730947bc14 V4L/DVB: vivi: clean up and a major overhaul
- Clean up the code
- Use the kernel's built-in vga8x16 font instead of our own.
- Drop exclusive open: now multiple users can open the device as per the V4L2 spec.
- Move the format description to the vivi device instead of keeping it in the file
  handle. Again as per the spec.
- Streamline and simplify the drawing code. It is now easy to add text on top of
  the colorbar pattern.
- Upgrade the max resolution to 1920x1200.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:59 -03:00
Mauro Carvalho Chehab
474675ad80 V4L/DVB: videobuf-dma-sg: Avoid using a wrong size
drivers/media/video/videobuf-dma-sg.c: In function ‘__videobuf_mmap_mapper’:
drivers/media/video/videobuf-dma-sg.c:557: warning: ‘size’ may be used uninitialized in this function

The condition where size is floating should never happen, due to the paranoia check,
but a future change at the logic might break it. So, let's just set size to zero and
use it for the paranoia check.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:58 -03:00
Jean-François Moine
e4dac289f0 V4L/DVB: gspca - main: Stop the webcam when bandwidth too small
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:57 -03:00
Jean-François Moine
832d0a9130 V4L/DVB: gspca - main: Restart streaming after reqbuf
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:56 -03:00
Jean-François Moine
18bf99aa0c V4L/DVB: gspca - main: Check the file doing stream on/off
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:54 -03:00