- Add comments to functions that require that caller hold q->lock
- Add __videobuf_mmap_free that doesn't hold q->lock for use within videobuf
- Add locking to videobuf_mmap_free
- Fix linux/drivers/media/common/saa7146_video.c which was holding lock around
videobuf_read_stop
- Add locking to functions that operate on a queue
- Add videobuf_stop to take care of stopping in both the read and stream case
TODO: bttv still has an unsafe call to videobuf_queue_is_busy
Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Commits
58b053e4ce ("Update arch/ to use sg helpers")
45711f1af6 ("[SG] Update drivers to use sg helpers")
fa05f1286b ("Update net/ to use sg helpers")
converted many files to use the scatter gather helpers without ensuring
that the necessary headerfile <linux/scatterlist> is included. This
happened to work for ia64, powerpc, sparc64 and x86 because they
happened to drag in that file via their <asm/dma-mapping.h>.
On most of the others this probably broke.
Instead of increasing the header file spider web I choose to include
<linux/scatterlist.h> directly into the affectes files.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Remove the obsolete VIDIOC_G_MPEGCOMP and VIDIOC_S_MPEGCOMP ioctls from
the V4L2 API as per the removal schedule (October 2007).
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
struct video_device used to define a .hardware field. While
initialized on severl drivers, this field is never used inside V4L.
However, drivers using it need to include the old V4L1 header.
This seems to cause compilation troubles with some random configs.
Better just to remove it from all drivers.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Breaks on any target that has copy_to_user() defined as a non-trivial
macro.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The currently used "struct class_device" will be removed from the
kernel. Here is a patch that converts all users in drivers/media/video/
to struct device.
Reviewed-by: Thierry Merle <thierry.merle@free.fr>
Reviewed-by: Mike Isely <isely@pobox.com>
Reviewed-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
In the past, videobuf_queue_init were used to initialize PCI DMA videobuffers.
This patch renames it, to avoid confusion with the previous kernel API, doing:
s/videobuf_queue_init/void videobuf_queue_core_init/
Also, the operations is now part of the function parameter. The function will
also add a test if this is defined, otherwise producing BUG.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Before the videobuf redesign, a procedure for re-using videobuf without PCI
scatter/gather where provided by changing the pci-dependent operations by
other operations.
With the newer approach, those methods are obsolete and can safelly be removed.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Adds a newer videobuf-vmalloc module. This module uses the same
videobuf controls, but implements memory allocation based on vmalloc
methods.
With this method, an USB driver can use video-buf, without needing to
request memory from the DMA-safe area.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
PCI-dependent videobuf_foo methods were renamed as videobuf_pci_foo.
Also, videobuf_dmabuf is now part of videobuf-dma-sg private struct.
So, to access it, a subroutine call is needed.
This patch renames all occurences of those function calls to be
consistent with the video-buf split.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
video-buf currently does two different tasks:
- Manages video buffers with a common code that allows
implementing all the V4L2 different modes of buffering;
- Controls memory allocations
While the first task is generic, the second were written to support PCI DMA
Scatter/Gather needs. The original approach can't even work for those
video capture hardware that don't support scatter/gather.
I did one approach to make it more generic. While the approach worked
fine for vivi driver, it were not generic enough to handle USB needs.
This patch creates two different modules, one containing the generic
video buffer handling (videobuf-core) and another with PCI DMA S/G.
After this patch, it would be simpler to write an USB video-buf and a
non-SG DMA module.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
Remove support for g_ext_clk and s_ext_clk. The same functionality is
now handled by g_ifparm.
Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
vidioc_int_g_ifparm can be used to obtain hardware-specific information
about the interface used by the slave.
Rearrange v4l2-int-device.h as well.
Also remove useless & characters.
Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
- fixed missing buttons in keymap.
- make function names & descriptions more generic,
since this same ir receiver and remote is used in
many FusionHDTV products.
- miscellaneous cleanups.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch adds support for the built-in IR receiver of the DViCO
Fusion HDTV5 RT GOLD PCI card, using FusionHDTV MCE remote controller.
Signed-off-by: Chaogui Zhang <czhang1974@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The convention for framebuffer devices is to call them xxxfb, not xxx-fb.
Conform to this. Also move the ivtvfb.h header to include/linux: it is a
public header. The FBIO_WAITFORVSYNC ioctl is now also defined in the
ivtvfb.h header, no more need to include matroxfb.h for just this ioctl.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The driver should now pass the 'busy' state of the device to the cx2341x
module whenever controls are set or tried. -EBUSY will be returned if
the device is busy and the user attempts to modify certain 'dangerous'
controls. It concerns controls that change the audio or video
compression mode and bitrates.
The cx88-blackbird and pvrusb2 drivers currently always pass '0' (not busy)
to the cx2341x, effectively keeping the old behavior for now.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Add radio support for the Thomson DTT7612 tuner.
This tuner uses a different 1st intermediate frequency than the other radio
tuners supported (a lot of NTSC radio tuners probably need this change too).
Add a new tuner-simple parameter, radio_if. It selects the 1st IF used for
radio reception. The radio frequency setting code in tuner-simple now uses
this field, instead of a special case select() block for each tuner with radio
support.
The tuner parameters for tuners that used a 33.3 MHz RIF now set radio_if to 1
in tuner-types.c.
The Thomson DTT7612 gets radio_if = 2, also add has_tda9887 = 1 and
fm_gain_normal = 1.
Add some defines for tda9887 bits that control IF setting in radio mode.
Add a new tda9887 config option, TDA9887_RIF_41_3, that selects a 41.3 MHz
radio IF.
Fix the way tda9887 radio options work. The driver was modifying the default
radio mode config templates based on the TDA9887_XXXX flags. This means that
_all_ tuners would get the same settings. If you had a one tuner than used
TDA9887_GAIN_NORMAL and one that didn't, both would get the setting. Now the
tda9987 driver just checks if tuner mode is radio and then applies the config
settings directly to the data being sent, just like how all the TV mode
settings already work.
The PLL setting math is made a little more accurate.
And a grammar error in a printk is fixed.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Convert av7110_v4l.c to use i2c_transfer() instead of saa7146_i2c_transfer().
Make saa7146_i2c_transfer() static.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This device is internal to the Panasonic VP27S tuner and is used to set
the mono/stereo/bilingual setting of the tuner.
It is used by two Japanese cx23416-based cards.
Signed-off-by: Takahiro Adachi <tadachi@tadachi-net.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch cleans up duplicate includes in
include/media/
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Add the ivtv-fb framebuffer driver for cx23415 devices (currently
only the Hauppauge PVR-350 cards). This makes it possible to use
the On-Screen Display functionality of these cards, either for menus
during MPEG playback, or as a console or X display.
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Fix a compile warning on non-32-bit machines in v4l2-int-device.h.
Add internal ioctl interface fallback function for ioctls with one
argument.
Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch adds an internal ioctl-like interface which can be used in
situations where a single Video4Linux device is implemented by multiple
device drivers. One master device controls one or more slave devices.
The slaves provide Video4Linux ioctl-like interface for the use of the
master.
Only a handful of ioctls are implemented at the moment. More can (and
should) be added as more functionality is required.
Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Move tuner callback function pointers out of struct tuner, into
struct tuner_operations.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Individual tuner drivers are now allocating memory themselves for
their own private data structures. This changeset adds a release
callback to the tuner operations, so that newer drivers that may
require more complex data structures may release this private data
themselves.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Create private data struct for device specific private data.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
I added saa7146_vmalloc_destroy_pgtable() which frees the resources
allocated by saa7146_vmalloc_build_pgtable() and updated the callers in
budget-core.c and av7110.c. I have also been through the updated
functions and updated the error paths to ensure they free all allocated
resources on error.
I also realised that there are other callers to saa7146_pgtable_free()
which did not have any sg DMA mapped so it seems wrong to add the
pci_unmap_sg() into that function. Instead I created
saa7146_vmalloc_destroy_pgtable() to do this.
Also included in this patch are the previous fixes for pci_unmap_sg()
and syncing the PCI streamed data to work with a SWIOTLB and match the
requirements documented in DMA-API.txt.
Signed-off-by: Jon Burgess <jburgess777@googlemail.com>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch adds a proper prototype for saa7146_video_do_ioctl() in
include/media/saa7146_vv.h.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The documentation of Several miscellaneous commands was updated.
As a result of which the CX2341X_ENC_UNKNOWN command was renamed to
CX2341X_ENC_SET_VERT_CROP_LINE.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This change supplies a more generic version of the tuner callback.
The tuner struct now has a function pointer
int (*tuner_callback) (void *dev, int command, int arg)
additionally to a int config parameter.
both can be set through the TUNER_SET_TYPE_ADDR client call.
Note that the meaning of the parameters depend on the tuner type.
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
These entries mainly are to support configurations of the tda827x
silicon tuner with a preamplifier.
The values can be set throgh the attach inform or through
the extended TUNER_SET_TYPE_ADDR client call. The function pointer
will only be updated if the parameter is not NULL.
Since a typecast is necessary to set the pointer, i added a typedef for
this pointer (tuner_gpio_func_t) in tuner.h
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
VIDIOC_G_CHIP_IDENT improves debugging of card problems: it can be
used to detect which chips are on the board and based on that information
selected register dumps can be made, making it easy to debug complicated
media chips containing tens or hundreds of registers.
This ioctl replaces the internal VIDIOC_INT_G_CHIP_IDENT ioctl.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Added VIDIOC_INT_G_STD_OUTPUT and VIDIOC_INT_S_STD_OUTPUT to allow drivers
to set the TV standard for video output separately from the video capture.
This is needed for cx23415 support where the decoder is separate from the
encoder and can have a different TV standard.
Modified the saa7127 module to listen to VIDIOC_INT_G/S_STD_OUTPUT instead
of VIDIOC_G/S_STD.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Add V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY support.
Also add support for local and global alpha overlays.
Add new field enums V4L2_FIELD_INTERLACED_TB and V4L2_FIELD_INTERLACED_BT.
These changes are needed to support the ivtv On Screen Display features.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>