Add parameters adc1_range, adc2_range and tuner_bbgain to the config struct.
Defaults: adc1_range = adc2_range = 2Vpp, tuner_bbgain = 10db
Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Manu Abraham <abraham.manu@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Oliver Endriss [Sun, 10 Jan 2010 18:39:45 +0000 (15:39 -0300)]
V4L/DVB (13987): [STV090x] Quit processing if the tuner did not lock
Exit stv090x_algo() if the tuner did not lock. This might happen due to
missing signal or invalid/incomplete tuning parameters.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Manu Abraham <abraham.manu@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Oliver Endriss [Sun, 10 Jan 2010 18:38:38 +0000 (15:38 -0300)]
V4L/DVB (13986): [STV090x] Disable I2C gate on error
The I2C gate must also be disabled, if a tuner command failed.
Otherwise the tuner mutex would be locked forever.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Manu Abraham <abraham.manu@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andreas Regel [Tue, 5 Jan 2010 22:24:56 +0000 (19:24 -0300)]
V4L/DVB (13985): [STV090x] reset mclk and dev_ver of internal structure after allocating
When mclk is not 0 then it will never be set to the correct value and
the Demodulator will not work.
Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andreas Regel [Tue, 5 Jan 2010 22:24:32 +0000 (19:24 -0300)]
V4L/DVB (13984): [BUDGET] Use a tuner clock output divider of 2 for TT S2-1600.
This gives the STV090x and improved clock signal (rectangle instead of sine).
Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andreas Regel [Tue, 5 Jan 2010 22:24:10 +0000 (19:24 -0300)]
V4L/DVB (13983): [STV6110x] add clk_div member to stv6110x_config structure
Using clk_div member of stv6110x_config structure the tuner's clock
output divider can be configured. It is set in stv6110x_attach.
Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andreas Regel [Tue, 5 Jan 2010 22:23:41 +0000 (19:23 -0300)]
V4L/DVB (13982): [STV090x] setup master clock in stv090x_init instead of stv090x_setup.
This is needed when clock input is driven from tuner and an output
divider different from 1 is used.
Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andreas Regel [Tue, 5 Jan 2010 22:23:13 +0000 (19:23 -0300)]
V4L/DVB (13981): [STV6110x] Add a local register map for each instance of the driver.
Before there was used a static register map that could lead to issues
when there are are multiple adapters with the STV6110(A).
Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andreas Regel [Tue, 5 Jan 2010 22:22:45 +0000 (19:22 -0300)]
V4L/DVB (13980): [STV6110x] Added function stv6110x_write_regs
The function stv6110x_write_regs is used to write several registers at once.
Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andreas Regel [Tue, 5 Jan 2010 22:22:07 +0000 (19:22 -0300)]
V4L/DVB (13979): [STV090x] Added possibility to set a fixed TS output clock.
This could be useful for p.e. Common Interface applications where data rate is limited.
Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andreas Regel [Tue, 5 Jan 2010 22:21:30 +0000 (19:21 -0300)]
V4L/DVB (13978): [STV090x] set FE_HAS_SIGNAL flag in stv090x_read_status when locked.
Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andreas Regel [Tue, 5 Jan 2010 22:21:02 +0000 (19:21 -0300)]
V4L/DVB (13977): [STV090x] Test for valid frequency before starting to tune
Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andreas Regel [Tue, 5 Jan 2010 22:20:21 +0000 (19:20 -0300)]
V4L/DVB (13976): [STV090x] Added mutex protection around tuner I2C access.
With this change it is possible to have the same I2C address for both tuners.
Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andreas Regel [Tue, 5 Jan 2010 22:19:43 +0000 (19:19 -0300)]
V4L/DVB (13975): [STV090x] Added internal structure with shared settings and data.
As the STV0900 features two demodulation paths in one chip there is
some information used by both instances of the driver when used in
dual mode. This information is now shared in an internal structure
referenced by I2C adapter and address.
Do initialisation of the demodulator only once when used in dual mode.
Moved global mutex demod_lock to internal structure.
Moved dev_ver and mclk to internal structure.
Removed unused tuner_refclk from stv090x_state.
Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andreas Regel [Tue, 5 Jan 2010 22:18:52 +0000 (19:18 -0300)]
V4L/DVB (13974): [STV090x] Fix locking reliabilty issues in automatic mode.
In automatic S/S2 detection mode, locking of a DVB-S transponder could
fail when coming from a DVB-S2 transponder. This change fixes the issue
by first disabling DVB-S and DVB-S2 mode before enabling it again.
Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Abylay Ospan [Wed, 13 Jan 2010 08:01:56 +0000 (05:01 -0300)]
V4L/DVB (13936): 22-kHz set_tone fix for NetUP Dual DVB-S2-CI card
22-kHz tone can be driven in two ways:
1. LNBH24 can produce 22kHz continuous tone when TEN=1 ( 22 KHz tone output is
always activated ).
2. LNBH24 can reproduce 22kHz tone timings from DSQIN or EXTM pin's when TEN=0.
From LNBH24 datasheet:
"In order to improve design flexibility an external tone input pin is
available (EXTM). The EXTM is a Logic input pin which activates the 22 kHz
tone output, on the VoTX pin, by using the LNBH24 integrated tone generator
(similar to the DSQIN pin function). In fact, the output tone waveform
characteristics will always be internally controlled by the LNBH24 tone
generator and the EXTM signal will be used as a timing control for DiSEqC tone
data encoding on the VoTX output."
In NetUP Dual DVB-S2-CI card 22kHz tone timings on EXTM pin produced by
STV0900 demod:
.set_tone = stv0900_set_tone
redefine to "set_tone = lnbp21_set_tone" is not correct for "NetUP Dual
DVB-S2-CI card".
Stanse found a potential null dereference in cx18_dvb_start_feed
and cx18_dvb_stop_feed. There is a check for stream being NULL,
but it is dereferenced earlier. Move the dereference after the
check.
Signed-off-by: Jiri Slaby <jslaby@suse.cz> Reviewed-by: Andy Walls <awalls@radix.net> Acked-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jiri Slaby [Wed, 6 Jan 2010 22:04:07 +0000 (19:04 -0300)]
V4L/DVB (13965): zl10039, jump to error on error
Stanse found an unreachable statement in zl10039_attach. There is
a `break' followed by `goto error'. Remove that break, so that it
can handle the error.
Cc: Igor M. Liplianin <liplianin@me.by> Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Francesco Lavra [Thu, 31 Dec 2009 11:47:11 +0000 (08:47 -0300)]
V4L/DVB (13961): em28xx-dvb: fix memleak in dvb_fini()
this patch fixes a memory leak which occurs when an em28xx card with DVB
extension is unplugged or its DVB extension driver is unloaded. In
dvb_fini(), dev->dvb must be freed before being set to NULL, as is done
in dvb_init() in case of error.
Note that this bug is also present in the latest stable kernel release.
Signed-off-by: Francesco Lavra <francescolavra@interfree.it> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This patch fixes the declaration of the sysfs attributes for IR's, which
must be a NULL-terminated array of struct attribute *.
Without this patch, my machine crashes when inserting a DVB card.
Signed-off-by: Francesco Lavra <francescolavra@interfree.it> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dan Carpenter [Mon, 28 Dec 2009 17:48:49 +0000 (14:48 -0300)]
V4L/DVB (13956): fix weird array index in zl10036.c
I was initially concerned about the weird array index (the 2 bumps
into the next row of the array). Matthias Schwarzott look at the
datasheet and it turns out it should be zl10036_init_tab[1][0] |= 0x01;
If there is ever going to be a FireDTV or FloppyDTV firmware which does
not provide a minimal ASCII textual descriptor for Model_Id --- or if
the descriptor is provided indirectly in a descriptor directory ---
the ieee1394 variant of the device probe of firedtv would dereference a
NULL pointer. The firewire variant of firedtv's device probe is not
affected.
The fix makes sure that such an unexpected firmware is safely recognized
by fdtv_alloc as an unknown firmware.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Julia Lawall [Tue, 22 Dec 2009 20:31:23 +0000 (17:31 -0300)]
V4L/DVB (13948): radio: Correct use after free
It is not clear how to share the unlock in the case where the structure
containing the lock has to be freed. So the unlock is now duplicated, with
one copy moved before the free. The unlock label furthermore is no longer
useful and is thus deleted.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
Make the VBI support work for PAL standards in addition to NTSC.
This work was sponsored by EyeMagnet Limited.
Thanks go out to Andy Walls for providing a CD containing test PAL/VBI captures
and to Steven Toth for providing a PVR-350 to do signal generation with.
V4L/DVB (13930): dib0700: rework IR logic for firmware 1.20
When firmware 1.20 was introduced, the dib0700 switched from a polling model
using a USB control message, to the messages being delivered on a USB bulk
pipe. The code I originally added would do a blocking read on the pipe with a
50ms timeout. Because the dvb-usb-remote code makes use of the global
workqueue, this resulted in the global workqueue being blocked 50% of the
time. Also, the synchronous urb_bulk_msg() call would burn excess CPU time
(reflected as an abnormal increase in the system's load average when devices
were connected).
Rework the logic so that we now setup an asynchronous callback on the bulk
pipe, so that we now only handle RC data when it arrives on the pipe. Note
that we provide a stub function for the RC polling callback so that we can
continue to leverage the shared code in dvb-usb-rc for the setting up of the
input device.
V4L/DVB (13926): gspca - pac7302: Fix a random USB error.
When loading the register 0x49 of the page 3, the usb_control_msg() sometimes
fails with error -71 or -62.
This change skips loading the register 0x48.
V4L/DVB (13925): gspca - main: Change the check of the USB video interface.
Some webcams have many interfaces with the same interface class, so the
previous interface check did not work.
The new code checks if the interface number is zero or the only one.
Andy Walls [Mon, 4 Jan 2010 02:28:18 +0000 (23:28 -0300)]
V4L/DVB (13913): saa7127: Add support for generating SECAM output for the SAA712[89] chips
This change fixes up saa7127_s_std() generate SECAM out, if the user has
requested a 50 Hz video standard set that only contains a request for SECAM
standards and not PAL. Only the SAA712[89] chips can generate SECAM, the
SAA712[67] chips cannot.
I was unclear on the burst start and end values - I couldn't figure out
the units - so I left them the same as for the PAL systems.
A the video decoders on both a PVR-350 (SAA7115) and an HVR-1600 (CX23418)
identify the SECAM signal generated by a SAA7129 with this patch as SECAM.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB (13912): cx18: Fix tuner reset pin in card entry for the Leadtek PVR2100
Fix the "xceive_pin" setting from "15" to "1" for the PVR2100 -- the same as
the PVR3100H. This properly resets the XC2028 tuner on the PVR2100.
Sergey's original email report:
Hi.
Seems cx18 module has incorrect .xceive_pin value for card,
as i see lots of i2c errors in dmesg from xc2028.
i'm using 2.6.32.2, my hardware is:
00:09.0 Multimedia video controller [0400]: Conexant Systems, Inc. CX23418
Single-Chip MPEG-2 Encoder with Integrated Analog Video/Broadcast Audio Decoder
[14f1:5b7a]
Subsystem: LeadTek Research Inc. Device [107d:6f27]
Flags: bus master, medium devsel, latency 64, IRQ 17
Memory at f0000000 (32-bit, non-prefetchable) [size=64M]
Capabilities: [44] Vital Product Data
Capabilities: [4c] Power Management version 2
Kernel driver in use: cx18
Kernel modules: cx18
Following fixes this problem for me, the rest seems working:
Andy Walls [Fri, 1 Jan 2010 16:25:41 +0000 (13:25 -0300)]
V4L/DVB (13910): cx18: Fix set indextable command to properly select I/P/B index entries
The CX18_CPU_SET_INDEXTABLE command was being called with the wrong number
of arguments causing the index table frame type selection mask to be set wrong.
Now the IDX stream properly sends entries for I, P, and B frames.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Fri, 1 Jan 2010 01:09:51 +0000 (22:09 -0300)]
V4L/DVB (13908): cx18: Add initial working VIDIOC_G_ENC_INDEX ioctl() support
VIDIOC_G_ENC_INDEX support see the light of day.
Some notes:
1. With default capture parameters, the CX23418 seems to transfer 192 index
entries (4.5 kB worth) at 10 second intervals.
2. Index streams don't seem to be supported for MPEG 2 TS streams
3. The index entries seem to claim every frame is a B-Frame. Possible
firmware bug.
4. The cx18 driver does not try to capture an index stream when inserting
sliced VBI into the MPEg stream as the offsets would need fixup.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Thu, 31 Dec 2009 21:27:13 +0000 (18:27 -0300)]
V4L/DVB (13907): cx18: Perform automatic rotation of very old, unread IDX buffers
According to the v4l2 spec, very old MPEG index entries needs to be discarded
in favor of newer index entries. This change ensures the firmware always has
buffers for index entries at the expense of the oldest unread buffers.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Thu, 31 Dec 2009 20:19:25 +0000 (17:19 -0300)]
V4L/DVB (13906): cx18: Start IDX streams automatically as an internal associated stream
This change starts the IDX stream along with the MPG stream as an internal
use (only) stream much like the VBI stream can be started as an internal use
stream for inserting sliced VBI packets.
The IDX stream is not started automatically with an MPEG strem if the IDX
stream is disabled (no buffers allocated) or if sliced VBI insertion is being
performed by the cx18 driver. The cx18 driver doing sliced VBI insertion
makes the offsets in the IDX stream inaccurate for the final MPEG stream
presented to user space. Since fixing the IDX offsets ourselves is not easy
and we cannot easily do what ivtv does to fix the offsets, we'll make sliced
VBI insertion and MPEG Index capture mutually exclusive for now.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Thu, 31 Dec 2009 05:14:51 +0000 (02:14 -0300)]
V4L/DVB (13905): cx18: Allow MPEG index streams to be started and stopped internally
This change allows the IDX stream to be started and stopped as any other
stream even though it has no associated device node. This is needed for
cx18 driver internal use.
Also always tell the CX23418 to generate index entries when an analog capture
starts and the IDX stream has had buffers allocated (i.e. is enabled).
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Update the module options related to INDEX stream buffer allocation. A single
CX2341[5678] index entry is only 24 bytes. Large buffers for the IDX stream
will prevent the CX23418 from transferring index data over at all. Buffers
of around 1.5 kB or 64 index entries seem to be just fine. We'll default to
63 buffers/MDLs as that is the firmware limit per stream and IDX stream buffers
are not high rate. There is no reason on earth to allocate the previous 1 MB
default of buffer space for the IDX stream.
This is in anticipation of implementing the G_ENC_INDEX ioctl() in the cx18
driver.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB (13897): gspca - main: Check the interface class at probe time.
The USB video interface was checked as having the number zero, but
some webcams have other values. The test is now done on the interface
class which may be either 255 (vendor spec) or 0 (class per interface).
V4L/DVB (13896): gspca - zc3xx: Adjust the pas202b exchanges.
- adapt the start sequences from the info file of the ms-win driver
of the webcams 046d:08a2/046d:08aa (lvWIMv.inf)
- disable the brightness for this sensor
V4L/DVB (13891): gspca - vc032x: Fix bad probe of the sensor mi1320.
- have 2 tables for sensor probe
- with the same ID, the sensor mi1320 is found with the bridge vc0321,
the sensor mi1320_soc with the bridge vc0323
- add some comments
Erik Andrén [Sun, 27 Dec 2009 08:53:28 +0000 (05:53 -0300)]
V4L/DVB (13883): gspca - m5602: Be less verbose during sensor probe
Currently all probed sensor types are emitted in the kernel log, generating unnecessary noise. Be less verbose and only report what sensor is found (if any)
Signed-off-by: Erik Andrén <erik.andren@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB (13856): ir-keytable: simplify and avoid a warning
/home/v4l/buildtest/v4l-dvb-master/v4l/ir-keytable.c: In function 'ir_setkeycode':
/home/v4l/buildtest/v4l-dvb-master/v4l/ir-keytable.c:190: warning: 'newkeymap' may be used uninitialized in this function
V4L/DVB (13846): smsdvb: Properly implement stats for both DVB and ISDB-T
After taking a look at the driver's history and doing some tests with
DVB and ISDB-T, it was noticed that the stats were incomplete, for
ISDB-T, and weren't working for DVB.
Fixed the code and added a debug code to print the complete stats at
dmesg. This debug is useful to improve the stats of this driver.
Siano series of patches seemed to cause a regression on reporting DTV
statistics. Due to that, signal indication weren't received, preventing
applications like scan to work.
Tested with ISDB-T signals and got the same scan result as with a
dib0700/dib8000 device.