Maxim Levitsky [Mon, 8 Oct 2007 15:07:35 +0000 (12:07 -0300)]
V4L/DVB (6306): Few clenups for saa7134 resume code
*Disable DMA explictly on suspend
*Enable DMA on resume, after all buffers were configured
*Disable overlay on resume - apps should enable it when X is resumed
Brandon Philips [Fri, 5 Oct 2007 19:26:27 +0000 (16:26 -0300)]
V4L/DVB (6305): V4L: videobuf-core.c avoid NULL dereferences in videobuf-core
The return value of videobuf_alloc() is unchecked but this function will
return NULL on an error. Check for NULL and make videobuf_reqbufs()
return the number of successfully allocated buffers.
Also, fix saa7146_video.c and bttv-driver.c to use this returned
buffer count.
Tested against the vivi driver. Not tested against saa7146 or bt8xx
devices.
Trent Piepho [Mon, 8 Oct 2007 22:05:28 +0000 (19:05 -0300)]
V4L/DVB (6301): pvrusb: Update DEBUGIFC sysfs to kernel 2.6.13+
The prototypes for the show and store methods of a device_attribute changed in
kernel 2.6.13, but the code in pvrusb2 was never updated. I guess the
DEBUGIFC stuff isn't used much....
Kay Sievers [Mon, 8 Oct 2007 19:26:13 +0000 (16:26 -0300)]
V4L/DVB (6293): V4L: convert struct class_device to struct device
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.
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.
V4L/DVB (6291): Fix: avoid oops on some SMP machines
This workaround fix a bug that happens on some SMP machines. On those machines,
videobuf_iolock is called too soon, before file .mmap handler. This patch calls
the scheduler before iolocking, allowing it to properly call the pending mmap.
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.
cx23885 driver were converted to use the newer videobuf support. Unfortunately,
the constructor weren't changed. This causes an oops, since the abstract methods
(implemented as callbacks) aren't defined.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Trent Piepho [Thu, 4 Oct 2007 08:28:45 +0000 (05:28 -0300)]
V4L/DVB (6284): cx23885: Update to new videobuf code
cx23885 was still uses the old video-buf includes and code, which would only
`work' if one happened to be compiling against a kernel that had the old
headers. Even then, it wouldn't actually work, it would just compile without
errors.
Trent Piepho [Thu, 4 Oct 2007 07:54:11 +0000 (04:54 -0300)]
V4L/DVB (6283): videobuf: Remove references to old Kconfig option name
CONFIG_VIDEO_BUF_DVB became CONFIG_VIDEOBUF_DVB.
But in these cases, it makes more sense to use CONFIG_VIDEO_SAA7134_DVB
or CONFIG_VIDEO_CX88_DVB_MODULE depending on the driver.
The reference in cx23885.h should just be removed, as the code there needs to
be included if DVB is on or off. I do not think you can even compile the
cx23885 driver without DVB. It's clearly just leftover from when the file was
obvious copied from the cx88 driver (which is not mentioned in the copyright
BTW).
Here's an attempted update to the full kthread API + wake_up_process:
Signed-off-by: Andrew Morton <akpm@linux-foundation.org> CC: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
V4L/DVB (6272): V4L: properly fix support for capturing interlaced video in saa7134
By "capturing interlaced video" I mean that card ensures that top field
is really top and vice versa (I think it takes the filed ID from signal)
Properly turn on/off that support depending on signal state
V4L/DVB (6270): V4L: Honor dev->ctl_invert when setting up the decoder in saa7134
When user sets dev->ctl_invert, driver writes negative values to
SAA7134_DEC_LUMA_CONTRAST and SAA7134_DEC_CHROMA_SATURATION,
but general code that initializes decorder ignores that
V4L/DVB (6268): V4L: Fix a lock inversion in generic videobuf code
videobuf_qbuf takes q->lock, and then calls
q->ops->buf_prepare which by design in all drivers calls
videobuf_iolock which calls videobuf_dma_init_user and this
takes current->mm->mmap_sem
on the other hand if user calls mumap from other thread, sys_munmap
takes current->mm->mmap_sem and videobuf_vm_close takes q->lock
Since this can occur only for V4L2_MEMORY_MMAP buffers, take
current->mm->mmap_sem in qbuf, before q->lock, and don't take
current->mm->mmap_sem videobuf_dma_init_user for those buffers
Due to the replace of videobuf_read_one to videobuf_read_stream, poll()
method implementation is wrong. This fixes poll() implementation, making
read of /dev/video? to work again.
With this method, an USB driver can use video-buf, without needing to
request memory from the DMA-safe area.
V4L/DVB (6255): Convert vivi to use videobuf-vmalloc
This patch removes the usage of videobuf-dma-sg from vivi driver, using
instead videobuf-vmalloc. This way, vivi will be useful for testing the
newer method. Reverting this patch won't hurt vivi, since both methods
work fine.
V4L/DVB (6251): Replace video-buf to a more generic approach
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.
Trent Piepho [Mon, 1 Oct 2007 03:32:25 +0000 (00:32 -0300)]
V4L/DVB (6245): GemTek Radio card - frequency calculation
Frequency calculation to use better math. It's still the same
IF offset and step size (which are not the same as the datasheet says) as
the code was before. It's just more efficient and accurate.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Reviewed-by: Pekka Seppänen <pexu@kapsi.fi> Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Pekka Seppanen [Mon, 1 Oct 2007 03:27:55 +0000 (00:27 -0300)]
V4L/DVB (6244): [PATCH 1/2] GemTek Radio card
Code cleanup for GemTek Radio card driver. Removed unnecessary / invalid
I/O commands and rewrote code for tuning on-board BU2614FS chip. Adds
several new module params for power users. Includes automatic device
probing.
Signed-off-by: Pekka Seppanen <pexu@kapsi.fi> Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com> Reviewed-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Pekka Seppanen [Mon, 1 Oct 2007 00:49:01 +0000 (21:49 -0300)]
V4L/DVB (6243): [PATCH 2/2] GemTek Radio card
Details now match with radio-gemtek.c, eg. no more different ports.
Included a short note about cards that should be compatible with
radio-gemtek module.
Signed-off-by: Pekka Seppanen <pexu@kapsi.fi> Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com> Reviewed-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
V4L/DVB (6238): bw-qcam: use data_reverse instead of manually poking the control register
Fixes use of parport_write_control() to match the newer interface that
requires explicit parport_data_reverse() and parport_data_forward() calls.
This eliminates the following error message and restores the original
intended behavior:
parport0 (bw-qcam): use data_reverse for this!
Also increases threshold in qc_detect() from 300 to 400, as my camera often
results in a count of approx 330. Added a kernel error message to indicate
detection failure.
Thanks Ray and Randy for your comments, and for pointing out that I
needed to reset the port to forward mode!
Signed-off-by: Brett T. Warden <brett.warden@gmail.com> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Andres Salomon [Wed, 19 Sep 2007 05:44:18 +0000 (02:44 -0300)]
V4L/DVB (6235): cafe_ccic: default to allocating DMA buffers at probe time
By default, we allocate DMA buffers when actually reading from the video
capture device. On a system with 128MB or 256MB of ram, it's very easy
for that memory to quickly become fragmented. We've had users report
having 30+MB of memory free, but the cafe_ccic driver is still unable to
allocate DMA buffers.
Our workaround has been to make use of the 'alloc_bufs_at_load' parameter
to allocate DMA buffers during device probing. This patch makes DMA
buffer allocation happen during device probe by default, and changes
the parameter to 'alloc_bufs_at_read'. The camera hardware is there,
if the cafe_ccic driver is enabled/loaded it should do its best to ensure
that the camera is actually usable; delaying DMA buffer allocation
saves an insignicant amount of memory, and causes the driver to be much
less useful.
Signed-off-by: Andres Salomon <dilinger@debian.org> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Michael Krufky [Fri, 7 Sep 2007 21:27:43 +0000 (18:27 -0300)]
V4L/DVB (6230): dvb-pll: add module option to force dvb-pll desc id (for debug use only)
Add a module option to force the dvb-pll module to use an alternate dvb-pll
description without having to recompile the kernel.
Having a module option like this is useful in some cases, where the vendor
may release an alternate revision of the hardware using a different tuner,
but without changing the pci subsystem / usb device ids.
This option is intended for debugging purposes _only_.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Michael Krufky [Fri, 7 Sep 2007 21:19:57 +0000 (18:19 -0300)]
V4L/DVB (6228): dvb-pll: add module option to specify rf input
Add a module option to dvb-pll, called "input" to specify which rf
input to use on devices with multiple rf inputs. If the module option
is not specified, then the driver will autoselect the rf input, as per
previous behavior.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Michael Krufky [Fri, 7 Sep 2007 21:03:58 +0000 (18:03 -0300)]
V4L/DVB (6226): dvb-pll: pass fe pointer into dvb_pll_configure() and set() functions
The pll-specific set() function will need access to the dvb_pll_priv
structure for new functionality. This patch gives access to this
structure to the required functions.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
V4L/DVB (6215): Bugfix for saa6588.c, add forgotten spin_lock_init()
There's a serious bug in saa6588.c, it uses a non-initialized spin_lock.
Funny thing is that it works fine with bttv, but completly freezes the
machine if e.g. saa7134 is loaded.
Thanks to Derek Philip for reporting this bug on the rdsd-devel list.
This patch adds the missing spin_lock_init().
Signed-off-by: Hans J. Koch <hjk@linutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Jean Delvare [Sun, 9 Sep 2007 09:17:44 +0000 (06:17 -0300)]
V4L/DVB (6214): usbvision: Don't support I2C_M_REV_DIR_ADDR
I2C adapters should only support I2C_M_REV_DIR_ADDR if they really have
to (i.e. if they are connected to a broken I2C device which needs this
deviation from the standard I2C protocol.) As no media chip driver
uses I2C_M_REV_DIR_ADDR, I don't think that the usbvision driver needs
to support it.
Jean Delvare [Sun, 9 Sep 2007 02:19:32 +0000 (23:19 -0300)]
V4L/DVB (6212): pvrusb2: I2C adapter tweaks from Jean Delvare
* I2C adapters aren't expected to handle I2C_M_NOSTART unless they
really have to. As the pvrusb2 driver doesn't support it, I take it
that it doesn't need it so it shouldn't mention it at all.
* I2C_FUNC_SMBUS_EMUL includes I2C_FUNC_SMBUS_BYTE_DATA so listing
both is redundant.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Mike Isely [Sun, 9 Sep 2007 01:32:12 +0000 (22:32 -0300)]
V4L/DVB (6211): pvrusb2: Allocate a debug mask bit for reporting video standard things
It's useful to see specific details for how the pvrusb2 driver is
figuring out things related to the video standard, independent of
other initialization activities. So let's set up a separate debug
mask bit for this and turn it on.
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Mike Isely [Sun, 9 Sep 2007 01:28:51 +0000 (22:28 -0300)]
V4L/DVB (6210): pvrusb2: Do a far better job at setting the default initial video standard
The v4l tveeprom logic tells us what video standards are supported by
the hardware, however it doesn't directly tell us what should be the
preferred initial standard. For example "NTSC/NTSC-J" devices are
reported by tveeprom as support NTSC-M and PAL-M, and while that might
be true, in the vast majority of cases NTSC-M is really what the user
is going to want. However the driver previously just arbitrarily
picked the "lowest numbered" standard as the initial default, which in
that case would have been PAL-M. (And making matters more confusing -
this only caused real problems on 24xxx devices because the saa7115 on
29xxx seems to autodetect the right answer anyway.) This change
implements an algorithm that uses the set of "supported" standards as
a hint to decide on the initial standard. This algorithm ONLY comes
into play if the driver isn't specifically told what to do; said
another way - the user can always still change the standard via the
sysfs interface, via the usual V4L methods, or even specified as a
module parameter. The idea here is only to pick a better starting
point if the user (or app) doesn't otherwise do something to set the
standard; otherwise this change has no real impact.
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Mike Isely [Sun, 9 Sep 2007 01:18:50 +0000 (22:18 -0300)]
V4L/DVB (6209): pvrusb2: Better discriminate among device types
This is a bunch of cleanup in various places to improve behavior based
on actual device type being driven. While this doesn't actually
affect operation with existing devices, it cleans things up so that it
will be easier / more deterministic when other devices are added.
Ideally we should make stuff like this table-driven, but for now this
is just a series of small incremental (read: safe) improvements.
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Mike Isely [Sun, 9 Sep 2007 01:16:27 +0000 (22:16 -0300)]
V4L/DVB (6208): pvrusb2: Implement programmatic means to extract prom contents
The pvrusb2 driver already has a method for extracting the FX2's
program memory back out to a user application; this ability is used to
facilitate manual firmware extraction as per the procedure documented
on the pvrusb2 web site. This change follows that pattern and
implements a corresponding method to grab the binary contents of the
PVR USB2 prom (which for PVR USB2 devices can contain information in
addition to the usual Hauppauge metadata).
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Simon Farnsworth [Mon, 10 Sep 2007 16:37:26 +0000 (13:37 -0300)]
V4L/DVB (6203): Fix SVideo input on KWorld DVB-T 220 boards
Fix SVideo input on KWorld DVB-T 220 boards. Without this patch, the
luma pin on the SVideo input is treated as a composite in, and the
chroma pin is ignored.
Also, fix the radio, and provide a second composite input for people who
are used to the existing composite on SVideo connector behaviour.
Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk> Reviewed-by: Hermann Pitton <hermann-pitton@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Michael Krufky [Sat, 8 Sep 2007 18:17:13 +0000 (15:17 -0300)]
V4L/DVB (6196): cx23885: add support for DViCO FusionHDTV 5 Express
This patch adds digital ATSC / QAM support for the DViCO FusionHDTV5 Express.
Remote control is supported by ir-kbd-i2c, RTC is supported by rtc-isl1208.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Steven Toth <stoth@hauppauge.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
V4L/DVB (6184): cx88-alsa: Make volume control stereo
Use the balance control to make the mono volume control stereo.
Note that full range isn't supported. The balance control attenuates one
channel by 0 to -63 dB, and the volume control provides additional attenuation
to both channels by another 0 to -63 dB.
So the channel with the most attenuation has a range of 0 to -126 dB, while
the other channel only has a range of 0 to -63 dB. ALSA volume controls don't
appear to support this concept. I just limited the range to 0 to -63 total.
Once you get to -63 dB, you're already at silence, so additional attenuation
is pretty much pointless anyway.
Steven Toth [Wed, 5 Sep 2007 00:50:49 +0000 (21:50 -0300)]
V4L/DVB (6173): cx23885: Minor cleanup and important NMI comment placed in code
I wanted to document the NMI assert issue inside the code, even though
it's already documented in the patch history. If/when the next cx23887
revision appears, is may need to be enabled on that also.
Signed-off-by: Steven Toth <stoth@hauppauge.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>