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>
Steven Toth [Tue, 20 Mar 2007 18:27:53 +0000 (15:27 -0300)]
V4L/DVB (6158): Fix MT2131 tuner lock status problem
The mt2131 tuner reports lock even when the hardware should not
lock. This patch allows the s5h1409 demodulator to be configured to query
either the tuner driver for status, or the demodulator status when the
application requests lock status. This avoids returning false CARRIER
and/or SIGNAL lock status.
S5H1409 and MT2131 drivers. This is the remainder of the changeset, which
only touches cx23885-dvb.c
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>
Steven Toth [Mon, 19 Mar 2007 21:01:07 +0000 (18:01 -0300)]
V4L/DVB (6155): Cleanup/remove code to access the sram memory maps
The cx23885 and cx23887 family use two different memory maps which govern
how the internal SRAM is configured. This patch streamlines the access to those
structures.
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>
Steven Toth [Mon, 19 Mar 2007 20:46:03 +0000 (17:46 -0300)]
V4L/DVB (6154): NMI hang and corrupt transport packet fixes
The sram allocations for the cx23887 differ slightly from the cx23885.
This patch modifies the cx23887 specific sram memory map to reflect this.
As a result, interrupts and DMA handling have also been enabled in
cx23885_start_dma() for 887 specific boards.
ATSC streaming is now available on cx23885 and cx23887 bridges.
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>
Michael Krufky [Fri, 31 Aug 2007 02:00:43 +0000 (23:00 -0300)]
V4L/DVB (6136): dvb_frontend: add get_rf_strength function pointer to dvb_tuner_ops
Add get_rf_strength function pointer to dvb_tuner_ops, so that rf signal
strength can be read directly from the tuner driver by the dvb demodulator
driver and / or the analog tuning system.
This is an internal api addition -- userspace is not affected.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Acked-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Michael Krufky [Tue, 28 Aug 2007 00:59:35 +0000 (21:59 -0300)]
V4L/DVB (6134): tuner: alter build to produce separate modules
Break tuner.ko into separate modules. This was a quick change -
Tuner sub-drivers are still static-linked to tuner.ko, this will
change after using dvb_attach and removing the probing functions.
After this change, one can deselect undesired tuner sub-drivers via Kconfig.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Mike Isely <isely@pobox.com> Acked-by: Steven Toth <stoth@hauppauge.com> Acked-by: Patrick Boettcher <pb@linuxtv.org> Acked-by: Jarod Wilson <jwilson@redhat.com> Acked-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Michael Krufky [Tue, 28 Aug 2007 00:24:27 +0000 (21:24 -0300)]
V4L/DVB (6132): tea5767: convert from tuner sub-driver into dvb_frontend module
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Mike Isely <isely@pobox.com> Acked-by: Steven Toth <stoth@hauppauge.com> Acked-by: Patrick Boettcher <pb@linuxtv.org> Acked-by: Jarod Wilson <jwilson@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Michael Krufky [Tue, 28 Aug 2007 00:23:40 +0000 (21:23 -0300)]
V4L/DVB (6131): tea5761: convert from tuner sub-driver into dvb_frontend module
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Mike Isely <isely@pobox.com> Acked-by: Steven Toth <stoth@hauppauge.com> Acked-by: Patrick Boettcher <pb@linuxtv.org> Acked-by: Jarod Wilson <jwilson@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Michael Krufky [Tue, 21 Aug 2007 04:24:42 +0000 (01:24 -0300)]
V4L/DVB (6127): tuner: kill i2c_client interface to tuner sub-drivers
To ease the conversion of the analog tuner sub-drivers into dvb_frontend
style tuner modules, we must remove the i2c_client interface.
dvb_frontend style tuner modules use i2c_transfer directly on the i2c_adapter.
This change only alters the interface between tuner.ko and the tuner
sub-drivers. The v4l2 / i2c_client interface to tuner.ko remains intact.
This patch adds inline functions tuner_i2c_xfer_send, and tuner_i2c_xfer_recv,
to replace i2c_master_send and i2c_master_recv inside the tuner sub-drivers.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Mike Isely <isely@pobox.com> Acked-by: Steven Toth <stoth@hauppauge.com> Acked-by: Patrick Boettcher <pb@linuxtv.org> Acked-by: Jarod Wilson <jwilson@redhat.com> Acked-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Michael Krufky [Tue, 28 Aug 2007 20:20:42 +0000 (17:20 -0300)]
V4L/DVB (6126): tuner: add warning for obsolete i2c address range 0x64 thru 0x6f
The tuner module has a rather aggressive range of possible i2c addresses.
As per the specs available, it appears as if there are no 4-byte tuners that
actually use i2c addresses in the range 0x64 thru 0x6f, yet, tuner-core claims
the address range 0x60 thru 0x6f.
Allowing tuner.ko to probe these addresses can cause potential damage to
certain IR receivers, RTC chips or any other IC's that might otherwise reside
on the i2c bus using one of these addresses.
The plan is to remove these i2c addresses from the i2c address range of the
tuner module. If any devices are discovered that actually do have tuners at
one of these addresses, the newer i2c probing methods will be used to handle
those cases.
In order to collect this information and avoid any potential regressions,
the following warning has been added upon successful detection of a tuner
using an i2c address in the range 0x64 thru 0x6f:
====================== WARNING! ======================
Support for tuners in i2c address range 0x64 thru 0x6f
will soon be dropped. This message indicates that your
hardware has a {tuner name} tuner at i2c address {addr}.
To ensure continued support for your device, please
send a copy of this message, along with full dmesg
output to v4l-dvb-maintainer@linuxtv.org
Please use subject line: "obsolete tuner i2c address."
====================== WARNING! ======================
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Tyler Trafford [Tue, 28 Aug 2007 20:56:47 +0000 (17:56 -0300)]
V4L/DVB (6124): cx25840: add a few 10 microsecond delays
There were a couple of places in the cx25840 initialization where the
datasheet called for a 10 microsecond delay, which we ignored because
of the 10 usec I2C delay. Put them in anyway now that the I2C delay
was decreased to 5 usec.
Hans Verkuil [Sun, 26 Aug 2007 09:04:10 +0000 (06:04 -0300)]
V4L/DVB (6119): ivtvfb: renamed ivtv-fb to ivtvfb, move header to include/linux
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>
Hans Verkuil [Sat, 25 Aug 2007 17:11:23 +0000 (14:11 -0300)]
V4L/DVB (6116): ivtv: VBI cleanups and fixes
Besides some VBI cleanups this patch also fixes a subtle problem with the
VBI re-insertion stream where the PIO work handler wasn't called quickly
enough, resulting in occasional corrupt data.
Furthermore the CC output didn't disable CC correctly and at the right time,
causing duplicates to be sent.
An saa7127 fix for VPS output was also added: the wrong data was sent.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Hans Verkuil [Sun, 26 Aug 2007 13:53:16 +0000 (10:53 -0300)]
V4L/DVB (6112): cx25840: use a workqueue to load the firmware
Loading the firmware using the i2c bit-banging code blocks the kernel.
Move the firmware load code into a workqueue so that it plays well with
other processes.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Hans Verkuil [Sat, 25 Aug 2007 18:16:37 +0000 (15:16 -0300)]
V4L/DVB (6108): videodev2.h: add new pixel formats for the cx23415 OSD
The Conexant cx23415 MPEG encoder/decoder supports some unusual pixelformats
for the On-Screen Display. Add new defines to videodev2.h for these formats.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Hans Verkuil [Thu, 23 Aug 2007 20:51:07 +0000 (17:51 -0300)]
V4L/DVB (6096): ivtv: fix V4L2_ENC_CMD_STOP_AT_GOP_END support
Support for V4L2_ENC_CMD_STOP_AT_GOP_END was broken. While the driver
correctly waited for the card to capture until the GOP was complete,
afterwards the driver buffers were just flushed instead of waiting
for the application to read all the pending data.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Hans Verkuil [Thu, 23 Aug 2007 08:42:59 +0000 (05:42 -0300)]
V4L/DVB (6091): ivtv: header cleanup
- add guards
- remove unused header includes
- move card-specific stuff from ivtv-driver.h to ivtv-cards.h
- move YUV-specific stuff from ivtv-driver.h to ivtv-yuv.h
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Hans Verkuil [Tue, 21 Aug 2007 21:32:42 +0000 (18:32 -0300)]
V4L/DVB (6088): cx2341x: some controls can't be changed while the device is busy
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>
Hans Verkuil [Mon, 20 Aug 2007 19:26:40 +0000 (16:26 -0300)]
V4L/DVB (6087): ivtv: prevent changing VBI format while capture is in progress
Changing the VBI format requires a CX2341X_ENC_INITIALIZE_INPUT firmware
call. This can only be done if no capture is in progress. So return
-EBUSY if the encoder is busy.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Trent Piepho [Fri, 24 Aug 2007 04:06:36 +0000 (01:06 -0300)]
V4L/DVB (6085): cx88-alsa: Fix mmap support
The driver has long claimed to support mmap, but it didn't work at all. Some
of the dma buffer parameters weren't set, and since video_buf uses vmalloc to
allocate the buffer, a page callback is needed too.
Trent Piepho [Fri, 24 Aug 2007 04:06:34 +0000 (01:06 -0300)]
V4L/DVB (6083): cx88-alsa: Rework buffer handling
Rework the way the DMA buffer is handled and IRQs are generated.
ALSA uses a ring-buffer of multiple periods. Each period is supposed to
corrispond to one IRQ.
The existing driver was generating one interrupt per ring-buffer, as opposed
to per period. This meant that as soon as the IRQ was generated, the hardware
was already starting to re-write the beginning of the buffer. Since the DMA
happens on a per-line basis, there was only a narrow window to copy the data
out before the buffer was overwritten.
The cx88 core RISC program generator is modified so that it can set the IRQ
and counter flags to count every X lines of DMA transfer. This way we can
generate an interrupt every period instead of every full ring-buffer. Right
now only period of one line are supported, but it should be possible to
support longer periods. Note that a WRITE instruction generates an IRQ when
it starts, not when the transfer is finished. Thus to generate an IRQ when
line X is done, one must set the IRQ flag on the instruction that starts line
X+1, not the one that ends line X.
Change the line size so that there are four lines in the SRAM FIFO. If there
are not four lines, the analog output from the cx88's internal DACs is full of
clicks and pops.
Try to handle FIFO sync errors. Sometimes the chip generates many of these
errors before audio data starts. Up to 50 sync errors will be ignored and the
counter reset.
Have the IRQ handler save the RISC counter to the chip struct, and then have
the pointer callback use this to calculate the pointer position. We could
read the counter from the pointer callback, but sometimes the sync errors on
start up cause the counter to go crazy. ALSA sees this and thinks there has
been an overrun. The IRQ hander can avoid saving the counter position on
sync errors.
The chip "opened" flag wasn't necessary. ALSA won't try to open the same
substream multiple times. Probably this code was cut&pasted from the bt87x
driver, which has multiple sub-streams for one chip.
Do error checking for the videobuf mapping functions.
snd_card_cx88_runtime_free() is useless and can be deleted.
Michael Krufky [Tue, 21 Aug 2007 00:04:44 +0000 (21:04 -0300)]
V4L/DVB (6074): tuner: fix ifdef tags to match actual file name
The file, tuner-driver.h was originally named tuner-hw.h, but we decided to
rename it. At the time, I had forgotten to change the #ifdef __TUNER_HW_H__
to #ifdef __TUNER_DRIVER_H__ . This patch corrects that.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Edgar Simo [Mon, 20 Aug 2007 17:14:50 +0000 (14:14 -0300)]
V4L/DVB (6072): saa7134: add DVB-T support for Avermedia Super 007
Add DVB-T support for Avermedia Super 007
Analog television is untested. The device lacks input adapters for radio,
svideo & composite -- seems to be a DVB-T ONLY device.
Signed-off-by: Edgar Simo <bobbens@gmail.com> Acked-by: Hermann Pitton <hermann-pitton@arcor.de> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Edgar Simo [Mon, 20 Aug 2007 17:06:00 +0000 (14:06 -0300)]
V4L/DVB (6071): saa7134-dvb: add missing newline
This is a simple whitespace cleanup.
Signed-off-by: Edgar Simo <bobbens@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Trent Piepho [Sun, 19 Aug 2007 01:09:42 +0000 (22:09 -0300)]
V4L/DVB (6066): cx88-alsa: Change order of interrupt enabling, fix spurious IRQs
Currently the driver turns on audio interrupts, then sets the audio interrupt
mask to select which interrupts to get. One could received unwanted
interrupts since the mask is set _after_ interrupts have already been turned
on. Change the order of the operations, and clear any audio interrupt status
bits that are already set for good measure.
Before changing the SRAM FIFO parameters, make sure the FIFO isn't being used.
This shouldn't happen with just the ALSA driver, as it should never try to
turn on FIFO/RISC/DMA while they are already on. However, the V4L driver
needs to turn the audio FIFO on for analog audio output to work (undocumented
cx88 bug). The FIFO parameters are in an inconsistent state while they are
updated, and this results in many FIFO sync error IRQs if the FIFO is in use
while it's in this inconsistent state.
Also create and use a bunch of symbolic constants for audio interrupt mask
bits.
Trent Piepho [Sat, 18 Aug 2007 10:02:26 +0000 (07:02 -0300)]
V4L/DVB (6065): cx88-alsa: Call core irq handler when needed
When an irq handled by the cx88 core driver (currently IR and errors) occurs
and the cx88-alsa irq handler is the first called, it will claim to have
handled the irq but it doesn't call cx88_core_irq() to handle it.
The means loading cx88-alsa can disable the IR remote.