Marton Balint [Tue, 31 Mar 2009 22:01:53 +0000 (19:01 -0300)]
V4L/DVB (11396): cx88: avoid reprogramming every audio register on A2 stereo/mono change
This patch changes cx88_set_stereo to avoid resetting all of the audio
registers on stereo/mono change if the audio standard is A2, and set
only the AUD_CTL register. The benefit of this method is that it
eliminates the annoying clicking noise on setting the audio mode to
stereo or mono.
The driver had used the same method 1.5 years ago (and for FM radio it
still does), but a pretty big cleanup commit changed it to the
"complete audio reset" method, although the reason for this move was
not clear. (If somebody knows why it was necessary, please let me
know!)
The original commit: http://linuxtv.org/hg/v4l-dvb/rev/ffe313541d7d
Marton Balint [Tue, 31 Mar 2009 22:01:52 +0000 (19:01 -0300)]
V4L/DVB (11395): cx88: audio thread: if stereo detection is hw supported don't do it manually
The sole purpose of the audio thread is to detect if stereo transmission is
available, and if it is, then switch to stereo mode (and switch back, if it's
no longer available). This manual autodetection is useful for some audio
standards (e.g. A2) where cx88_get_stereo CAN detect stereo sound, but the
cx2388x chip CANNOT auto-detect stereo sound.
However, for other audio standards, the cx2388x chip CAN auto-detect the stereo
sound, so the manual autodetection in the audio thread is not needed. In fact,
it can cause serious problems because for some of these audio standards,
cx88_get_stereo CANNOT detect the presence of stereo sound. Besides that, if
the hardware automatically detects stereo/mono sound, you cannot set
core->audiomode_current to the real current audio mode on channel change.
With this patch, the manual autodetection is only used if audiomode_current is
known after a channel change (because of the initial mono mode), and
hardware-based stereo autodetecion is not applicable for the current audio
standard.
Marton Balint [Tue, 31 Mar 2009 22:01:51 +0000 (19:01 -0300)]
V4L/DVB (11394): cx88: Add support for stereo and sap detection for A2
The patch implements reliable stereo and sap detection for the A2 sound
standard. This is achieved by processing the samples of the audio RDS fifo of
the cx2388x chip. A2M, EIAJ and BTSC stereo/sap detection is also possible with
this new approach, but it's not implemented yet. Stereo detection when alsa
handles the sound also does not work yet.
Uri Shkolnik [Fri, 27 Mar 2009 17:16:57 +0000 (14:16 -0300)]
V4L/DVB (11240): siano: add high level SDIO interface driver for SMS based cards
This patch provides SDIO interface driver for SMS (Siano Mobile
Silicon) based devices. The patch includes SMS high level SDIO driver
and requires patching the kernel SDIO stack, those stack patches had
been provided previously.
I would like to thank Pierre Ossman, MMC maintainer, who wrote this
driver.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Uri Shkolnik <uris@siano-ms.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB (11875): dvb_frontend: fix case where fepriv->exit not reset
The fact that we now explicitly set fepriv->exit = 1 when the thread is
shutting down exposed an edge case where it was not being reset back to zero
once the thread went away in some cases. This resulted in failures in cases
where the frontend was closed, and then opened O_RDONLY, since in that case
the thread is not being restarted but it was checking the fepriv->exit flag.
Thanks to Thierry Lelegard, who and encountered and debugged a large portion
of the issue in the same twelve hours that I did (as well as testing my patch).
A race condition was detected in the case that putting the tuner to sleep takes
an unusually long period of time, combined with applications that quickly
close/open the dvb frontend.
The kaffeine channel scanner closes and reopens the dvb frontend between each
tuning attempt. If it takes an unusually longer period of time to put the
tuner to sleep (for example, the Pinnacle 801e takes 660 ms), the dvb_frontend
thread will still be in a running state (and hence fepriv->thread is still set)
but the fepriv->exit field will still be zero. As a result, if a
dvb_frontend_start() call arrives while the frontend thread is in the process
of terminating, the call will return 0 without actually starting a new thread.
This results in the tuning request being dropped.
To address this, mark fepriv->exit as soon as we know the thread is going to
be terminated, so that dvb_frontend_start() knows to start a new instance.
Problem encountered with Kaffeine 0.8.7 doing ATSC scanning against the
Pinnacle 801e tuner, in conjunction with new code to power down the xc5000
when not in use.
V4L/DVB (11784): cx88: Fix race condition between cx8800 startup and hald
A power management fix to properly put the xc5000 into low power mode
revealed a race condition where hald could detect the creation of the device
file and connect to the device while the initial device configuration is
still in progress.
Lock the core structure so that video_release cannot be called and put the
tuner to sleep in the middle of the initial call to cx88_set_tvnorm() in
cx8800_initdev()
Thanks to Michael Krufky for discovering the issue and providing an
environment to test in.
Error count in read pipe completion corrected.
URB not resubmitted if shutting down.
URB not freed in completion routine if new urb_submit_fails.
(URB is freed on shutdown).
Signed-off-by: Dean Anderson <dean@sensoray.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jan Nikitenko [Tue, 9 Jun 2009 22:31:55 +0000 (19:31 -0300)]
V4L/DVB (11999): af9015: fix stack corruption bug
This patch fixes stack corruption bug present in af9015_eeprom_dump():
the buffer buf is one byte smaller than required - there is 4 chars
for address prefix, 16*3 chars for dump of 16 eeprom bytes per line
and 1 byte for zero ending the string required, i.e. 53 bytes, but
only 52 are provided.
The one byte missing in stack based buffer buf causes following oops
on MIPS little endian platform, because i2c_adap pointer in
af9015_af9013_frontend_attach() is corrupted by inlined function
af9015_eeprom_dump():
Barry Kitson [Sun, 7 Jun 2009 13:41:03 +0000 (10:41 -0300)]
V4L/DVB (11996): saa7134: add support for AVerMedia M103 (f736)
Add 1461:f736 to the list of identifiers corresponding to the
SAA7134_BOARD_AVERMEDIA_M103 board. This patch adds support for
a variant of the AVerMedia M103 MiniPCI DVB-T Hybrid card.
Signed-off-by: Barry Kitson <b.kitson@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB (11993): V4L/pwc - use usb_interface as parent, not usb_device
The current code creates a sysfs device path where the video4linux
device is child of the usb device itself instead of the interface it
belongs to. That is evil and confuses udev.
This patch does basically the same thing as Kay's similar patch for the
ov511 driver:
Signed-off-by: Lennart Poettering <mzxreary@0pointer.de> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jean Delvare [Thu, 4 Jun 2009 14:07:16 +0000 (11:07 -0300)]
V4L/DVB (11992): Add missing __devexit_p()
Add missing __devexit_p() to several drivers. Also add a few missing
__init, __devinit and __exit markers. These errors could result in
build failures depending on the kernel configuration.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Figo.zhang [Wed, 3 Jun 2009 02:01:04 +0000 (23:01 -0300)]
V4L/DVB (11991): buf-core.c: add pointer check
add poiter check for videobuf_queue_core_init().
any guys who write a v4l driver, pass a NULL pointer or a non-inintial
pointer to the first parameter such as videobuf_queue_sg_init() , it
would be crashed.
figo.zhang [Fri, 8 May 2009 02:31:02 +0000 (23:31 -0300)]
V4L/DVB (11990): saa7134-video.c: fix the block bug
when re-open or re-start (video_streamon), the q->curr would not be NULL in saa7134_buffer_queue(),
and all the qbuf will add to q->queue list,no one to do activate to start DMA,and then no interrupt
would happened,so it will be block.
In VIDEOBUF_NEEDS_INIT state, initialize the curr pointer to be NULL in the buffer_prepare().
V4L/DVB (11981): Remote control debugging for dw2102 driver based USB cards
Remote control debugging for dw2102 driver based USB cards
It includes DVBWorld, TeVii, Terratec and others.
Type 'modprobe dvb-usb-dw2102 debug=4', then look at dmesg output.
Signed-off-by: Igor M. Liplianin <liplianin@me.by> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB (11979): em28xx: don't create audio device if not supported
In cases where the device does not actually provide a USB audio class *or*
vendor audio, do not load the driver that provides vendor audio support (such
as the KWorld 2800d). Otherwise, the /dev/audio1 device file gets created and
users get confused.
Also, reworks the logic a bit so that we don't try to inspect the register
content if the register read failed entirely.
Hans Verkuil [Fri, 12 Jun 2009 06:38:15 +0000 (03:38 -0300)]
V4L/DVB (11967): v4l: i2c modules must be linked before the v4l2 drivers
Since i2c autoprobing is no longer supported by v4l2 we need to make sure
that the i2c modules are linked before the v4l2 modules. The v4l2 modules
now rely on the presence of the i2c modules, so these must have initialized
themselves before the v4l2 modules.
The exception is the ir-kbd-i2c module, which is the only one still using
autoprobing. This one should be loaded at the end of the v4l2 module. Loading
it earlier actually causes problems with tveeprom. Once ir-kbd-i2c is no
longer autoprobing, then it has to move up as well.
This is only an issue when everything is compiled into the kernel.
Thanks to Marcus Swoboda for reporting this and Udo Steinberg for testing
this patch.
Tested-by: Udo A. Steinberg <udo@hypervisor.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Fix a regression caused by changeset 9133:64aed7485a43 - v4l: disconnect
kernel number from minor
Before the above changeset, ov511_probe used to allow forcing to use a
certain specific set of video devices, like:
modprobe ov511 unit_video=4,1,3 num_uv=3
So, assuming that you have 5 ov511 devices, and connect they one by one,
they'll gain the following device numbers (at the connection order):
/dev/video4
/dev/video1
/dev/video3
/dev/video0
/dev/video2
However, this was changed due to this change at video_register_device():
+ nr = find_next_zero_bit(video_nums[type], minor_cnt, nr == -1 ? 0 : nr);
With the previous behavior, a trial to register on an already allocated mirror
would fail, and a loop would get the next requested minor. However, the current
behavior is to get the next available minor instead of failing. Due to that,
this means that the above modprobe parameter will give, instead:
Trent Piepho [Thu, 11 Jun 2009 08:33:00 +0000 (05:33 -0300)]
V4L/DVB (11964): b2c2: Fix problems with frontend attachment
The frontend attachment code didn't handle cases where the frontend
partially failed to attach. For instance, when the demod was attached
successfully but the tuner driver wasn't compiled or fails to init for some
reason. In these cases we try to clean up the partial attachment and fail
instead of proceeding with a broken frontend.
If frontend registration fails, clean up with dvb_frontend_detach() rather
than just calling the frontend's main release method. The former does some
additional stuff, like release an attached tuner and take care of putting
symbols when dynamic binding is used.
In skystar2_rev23_attach() it's not necessary to set fc->dev_type, that
gets set before skystar2_rev23_attach() is called.
V4L/DVB (11960): v4l: generate KEY_CAMERA instead of BTN_0 key events on input devices
A bunch of V4L drivers generate BTN_0 instead of KEY_CAMERA key presses.
X11 is able to handle KEY_CAMERA automatically these days while BTN_0 is
not treated at all. Thus it would be of big benefit if the camera drivers
would consistently generate KEY_CAMERA. Some drivers (uvc) already do,
this patch updates the remaining drivers to do the same.
I only possess a limited set of webcams, so this isn't tested with all
cameras. The patch is rather trivial and compile tested, so I'd say it's
still good enough to get merged.
Signed-off-by: Lennart Poettering <mzxreary@0pointer.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Alexey Klimov [Thu, 11 Jun 2009 03:22:42 +0000 (00:22 -0300)]
V4L/DVB (11957): dsbr100: change radio->muted to radio->status, update suspend/resume
Patch renames radio->muted to radio->status, add defines for that
variable, and fixes suspend/resume procedure. Radio->status set to
STOPPED in usb_dsbr100_probe because of removing open call.
Also, patch increases driver version.
Andy Walls [Tue, 9 Jun 2009 23:47:21 +0000 (20:47 -0300)]
V4L/DVB (11951): cx18: Add DVB-T support for the Leadtek WinFast DVR3100 H
This adds support for DVB-T on the Leadtek DVR3100 H and should also get analog
TV capture from the tuner working properly as well.
DVB-T 6 MHz and 8 MHz have been tested and verified to work by Terry Wu of
Leadtek. DVB-T 7 MHz has also been verified working with a change developed by
Terry to the tuner-xc2028.c driver.
Special thanks go to Terry Wu <terrywu2009@gmail.com> of Leadtek who provided
the needed information and testing to get digital TV working for the Leadtek
DVR3100 H.
Reported-by: Terry Wu <terrywu2009@gmail.com> Tested-by: Terry Wu <terrywu2009@gmail.com> Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Herton Ronaldo Krzesinski from Mandriva reported that one Bison Electronics
webcam exposes a non-UVC interface descriptor. Instead of failing completely,
ignore trailing non-UVC descriptors and move on.
Thanks to Herton for reporting the problem and submitting a patch proposal.
V4L/DVB (11945): uvcvideo: Don't accept to change the format when buffers are allocated.
Setting a new frame format or size will likely change the buffer size required
to store a complete video frame. To avoid a buffer overflow, don't allow
VIDIOC_S_FMT calls when video buffers are already allocated.
Laurent Pinchart [Sun, 31 May 2009 20:05:55 +0000 (17:05 -0300)]
V4L/DVB (11944): uvcvideo: Add generic control blacklist.
Another device (5986:0241) has been reported to advertise a UVC control it
does not support. Rework the control blacklist to match devices by their
VID:PID instead of trying to be clever about which controls might not be
supported properly.
Erik Andrén [Thu, 11 Jun 2009 20:20:23 +0000 (17:20 -0300)]
V4L/DVB (11942): gspca - m5602-ov9650: Reorder quirk list and add A7V quirk
The quirk list has grown and was in need of sorting. This is now done. Add a new vflip quirk for the ASUS A7V while we're at it. Thanks to Carsten Menzel for reporting.
Signed-off-by: Erik Andrén <erik.andren@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dmitri Belimov [Mon, 25 May 2009 01:22:41 +0000 (22:22 -0300)]
V4L/DVB (11934): Change order for FM tune
Change order data of buffer in FM simple_tune function. It is usefull for:
1. Set data of tuner with CP bit UP. 0xCE for MK5 or 0xC6 for MK3
2. When call simple_fm_tune, read this byte from config and overwrite
this byte in function simple_radio_bandswitch for set CP bit to OFF.
Of course it can be usefull for other tuner for overwrite default
settings of FM.
V4L/DVB (11928): au0828: provide module option to disable USB speed check
Add an au0828 module option that allows a user to override the USB speed check.
Intended for advanced users who understand the consequences of trying to use
the device with a 12Mbps bus.
V4L/DVB (11927): em28xx: provide module option to disable USB speed check
Add an em28xx module option that allows a user to override the USB speed check.
Intended for advanced users who understand the consequences of trying to use
the device with a 12Mbps bus.
V4L/DVB (11925): em28xx: Add support for the K-World 2800d
Make the KWorld 2800d work properly. In this case, that means making the
profile more generic so that it works for both the Pointnix Intra-Oral USB
camera and the KWorld device.
The device provides the audio through a pass-thru cable, so we don't need
an actual audio capture profile (neither the K-World device nor the Pointnix
have an onboard audio decoder).
Thanks to Paul Thomas for providing sample hardware.
Cc: Paul Thomas <pthomas8589@gmail.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB (11924): au0828: Don't let device work unless connected to a high speed USB port
The au0828 basically just doesn't work at 12 Mbps. The isoc pipe needs
nearly 200 Mbps for analog support, so users would see garbage video, and on
the DVB/ATSC side scanning is likely to work but if the user tried to tune it
would certainly appear to have failed.
It's better to fail explicity up front and tell the user to plug into a USB 2.0
port, than to let the driver load and the user have weird problems with tuning
and garbage video.
V4L/DVB (11923): em28xx: Don't let device work unless connected to a high speed USB port
The em28xx basically just doesn't work at 12 Mbps. The isoc pipe needs
nearly 200 Mbps for analog support, so users would see garbage video, and on
the DVB/ATSC side scanning is likely to work but if the user tried to tune it
would certainly appear to have failed.
It's better to fail explicity up front and tell the user to plug into a USB 2.0
port, than to let the driver load and the user have weird problems with tuning
and garbage video.
V4L/DVB (11917): Fix firmware load for DVB-T @ 6MHz bandwidth for xc3028/xc3028L
The only two countries that are known to use 6MHz bandwidth are Taiwan
and Uruguay. Both use QAM subcarriers at OFTM.
This patch fixes the firmware load for such countries, where the
required firmware is the QAM one.
This also confirms the previous tests where it was noticed that the 6MHz
QAM firmware doesn't work for cable. So, this patch also removes support
for DVB-C, instead of just printing a warning.
Thanks to Terry Wu <terrywu2009@gmail.com> for pointing this issue and
to Andy Walls <awalls@radix.net> for an initial patch for this fix.
Cc: Terry Wu <terrywu2009@gmail.com> Acked-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Fri, 29 May 2009 23:54:02 +0000 (20:54 -0300)]
V4L/DVB (11898): cx18: Perform 64 bit divide so it works for 32 bit systems
Thanks to David Ward and Mike Krufky for reporting the problem and
debugging this as an unresolved symbol due to a 64 bit divide on a 32 bit
system. David Ward provided the content of this patch; Andy Walls only
performed some cosmetic edits.
Reported-by: David Ward <david.ward@gatech.edu> Signed-off-by: David Ward <david.ward@gatech.edu> Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
David Wong [Mon, 18 May 2009 08:25:49 +0000 (05:25 -0300)]
V4L/DVB (11880): cx23885: support for card Mygica X8506 DMB-TH
This patch add cx23885 support for card "Mygica X8506 DMB-TH".
It should work on "Magic-Pro ProHDTV Extreme" as well, as they are
same hardware with different branding.
Sign-off-by: David T.L. Wong <davidtlwong@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Miroslav Sustek [Sun, 31 May 2009 19:47:28 +0000 (16:47 -0300)]
V4L/DVB (11879): Adds support for Leadtek WinFast DTV-1800H
Enables analog/digital tv, radio and remote control (gpio).
Tested-by: Marcin Wojcikowski <emtees.mts@gmail.com> Tested-by: Karel Juhanak <karel.juhanak@warnet.cz> Tested-by: Andrew Goff <goffa72@gmail.com> Tested-by: Jan Novak <novak-j@seznam.cz> Signed-off-by: Miroslav Sustek <sustmidown@centrum.cz> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sun, 17 May 2009 01:43:43 +0000 (22:43 -0300)]
V4L/DVB (11865): cx18: Tweak color burst gate delay and initial color sub-carrier freq
Fix the burst gate delays to use a crystal value of 28636360 as assumed by
the rest of the driver. Also have the initial color sub-carrier freq paramter
use the src decimation ratio per the documentation, instead of the actual
crystal/pixel clock ratio. The tracking circuit will find the correct color
subcarrier in any case, as long as we're close. Also fix up some debug print
statements.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Michael Krufky [Wed, 20 May 2009 19:06:10 +0000 (16:06 -0300)]
V4L/DVB (11860): saa7134: fix quirk in saa7134_i2c_xfer for the saa7131 bridge
The i2c quirk in the saa7134_i2c_xfer function does a bogus write
to i2c address 0xfd, to work around a bug in the silicon that
affects read transactions.
Unfortunately, this hack is not working properly, since the bogus
write is to 0xfd, an invalid i2c address. Fix this quirk by using
an actual valid i2c address, 0xfe, which is still unlikely to be
used as an i2c address for any actual i2c client.
This is required in order to properly communicate with a TDA10048
DVB-T demod located at i2c address 0x10 on the primary i2c bus.
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>