Trent Piepho [Thu, 29 Jan 2009 00:32:59 +0000 (21:32 -0300)]
V4L/DVB (10563): bttv: clean up mux code for IVC-120G
The card data for BTTV_BOARD_IVC120 set muxsel to a bunch of bogus values
(1 to 16), which the common mux code would use to set the Bt878's mux to
some random value. Then the custom code in ivc120_muxsel() would change
the Bt878's mux to the right value (always MUX0).
Better to just make the muxsel data correct (all zeros, easy!) and get the
mux right to begin with. Then the extra Bt878 mux setting code in
ivc120_muxsel() can be eliminated (the rest of the code for the IVC-120G's
external mux is still there of course).
This will help me clean up muxsel for some other changes. It should also
get rid of an unnecessary mux switch when changing from certain inputs to
certain other inputs on the IVC-120G.
Trent Piepho [Thu, 29 Jan 2009 00:32:59 +0000 (21:32 -0300)]
V4L/DVB (10562): bttv: rework the way digital inputs are indicated
The code was using a muxsel value of -1U to indicate a digital input. A
couple places in were checking of muxsel < 0 to detect this, which doesn't
work of course because muxsel is unsigned and can't be negative.
Only a couple cards had digital inputs and it was always the last one, so
for the card database create a one bit field that indicates the last input
is digital. On init, this is used to set a new field in the bttv struct to
the digital input's number or UNSET for none. This makes it easier to
check if the current input is digital.
Trent Piepho [Thu, 29 Jan 2009 00:32:59 +0000 (21:32 -0300)]
V4L/DVB (10561): bttv: store card database more efficiently
The bttv card database is quite large and the data structure used to store
it wasn't very efficient. Most of the field are only used at card
initialization time so it doesn't matter if they aren't efficient to
access.
Overall the changes reduce code size by 60 bytes in ia32. The data size is
decreased by 5024 byes. It is probably even more for 64-bit kernels.
Move the fields in the struct around to be sorted from largest to smallest.
This saves on padding space used for alignment.
Get rid of the unused digital_mode field. Leave the setting as a comment
in the few cards entries that set it, in case someone ever writes the code.
Get rid of the unused audio_inputs field. Leave the values in the card
entries in case someone ever writes code that might use it.
Get ride of the unused radio_addr field. No card entries even set it to
anything interesting so it's not left as comments. All the code that used
it was removed in commit v2.6.14-3466-g291d1d7 from Nov 8th 2005.
Reduce video_inputs to u8 as no card has more than 255 inputs (the most is
16).
Change tuner_addr to u8. I2C addresses are only seven bits and 255 means
ADDR_UNSET, so everything fits.
Make has_radio a one bit flag.
Make the pll setting a two bit field.
Reduce svhs to four bits as no card has an s-video input above 9. Change
the value for no s-video input from UNSET (which is -1U and out of range of
four bits) to NO_SVHS (which is now 15).
Trent Piepho [Thu, 29 Jan 2009 00:32:59 +0000 (21:32 -0300)]
V4L/DVB (10560): bttv: make tuner card info more consistent
The bttv card database structure had a "tuner" field that was the input
number of the tuner input or UNSET for no tuner. However, the only values
it could ever be are 0 and UNSET. Having a tuner on an input other than 0
didn't work and was never used.
There is also a "tuner_type" field that can be set to TUNER_ABSENT to
indicate no tuner, which makes "tuner = UNSET" redundant. In many cases,
tuner_type was set to UNSET when there was no tuner, which isn't quite
correct. tuner_type == UNSET is supposed to mean the tuner type isn't yet
known.
So, I changed cards where "tuner == UNSET" to always have tuner_type of
TUNER_ABSENT. At this point the tuner field is redundant, so I deleted it.
I have the card setup code set the card's tuner_type (not the card type's
tuner_type!) to TUNER_ABSENT if it hasn't yet been set at the end of the
setup code. Various places that check if the card has a tuner will now
look for this instead of checking the card type's "tuner" field.
Also autoload the tuner module before issuing the TUNER_SET_TYPE_ADDR I2C
client call instead of after issuing it.
Overall, on ia32 this decreases compiled code size by about 24 bytes and
reduces the data size by 640 bytes.
The code to set the norm for the TDA9880 analog demod was comparing
btv->norm, an index into the bttv driver's norm array, to V4L2_STD_NTSC,
which is a bit flag that's part of the V4L2 API. This doesn't work of
course and results in the PAL path always being taken.
What's more, it modified the bttv_tvcards[] entries for cards using the
TDA9880. This is wrong because changing the norm on one card will also
affect other cards of the same type. Writing to bttv_tvcards is also bad
because it should be read-only or even devinitdata.
Changing the norm would also cause the audio to become unmuted.
Have the code get called for both norm setting and audio input setting
(which where the gpios are set) to avoid needed to modify bttv_tvcards.
Trent Piepho [Thu, 29 Jan 2009 00:32:58 +0000 (21:32 -0300)]
V4L/DVB (10558): bttv: norm value should be unsigned
The norm value in the driver is an index into an array and the the driver
doesn't allow it to be negative or otherwise invalid. It should be
unsigned but wasn't in all places.
Fix some structs and functions to have the norm be unsigned. Get rid of
useless checks for "< 0". Most of the driver code can't handle a norm
value that's out of range, so change some ">= BTTV_TVNORMS" checks to
BUG_ON(). There's no point in silently ignoring invalid driver state just
to crash because of it later.
Hans Verkuil [Fri, 13 Feb 2009 08:12:02 +0000 (05:12 -0300)]
V4L/DVB (10540): cx2341x: fixed bug causing several audio controls to be no longer listed
The cx2341x_mpeg_ctrls array must be ordered by control ID. I know that
this is bad design, but for now I will just fix this bug and revisit it
when all drivers have moved to v4l2_device/v4l2_subdev, since that will
allow me to do greatly improve control handling.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tobias Lorenz [Thu, 12 Feb 2009 17:55:45 +0000 (14:55 -0300)]
V4L/DVB (10530): Documentation and code cleanups
- "DealExtreme" sells the "PCear" radio and that comes from "Sanei Electric".
- MPlayer is also usable as radio application.
- Consistent usage of tabulators and blanks in the code.
Nicola Soranzo [Wed, 11 Feb 2009 02:28:24 +0000 (23:28 -0300)]
V4L/DVB (10525): em28xx: Coding style fixes and a typo correction
Lots of coding style fixes and a typo correction for em28xx.
[dougsland@redhat.com: fixed a reject due to a change on em28xx-audio.c] Signed-off-by: Nicola Soranzo <nsoranzo@tiscali.it> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Robert Krakora [Sun, 8 Feb 2009 16:10:39 +0000 (13:10 -0300)]
V4L/DVB (10519): em28xx: Fix for em28xx audio startup
Essentially if a snd_em28xx_capture_trigger() stop followed by a snd_em28xx_capture_trigger() start would not yield any
data because there was some logic put in with an adev->shutdown variable which did not seem warranted in my humble opinion.
It would cause snd_em28xx_capture_trigger start never to start up the audio stream until the device was closed and
reopened again. Upon re-opening the device adev->shutdown is reset and audio data would again flow.
Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB (10512): tda1004x: Fix eeprom firmware load on boards with 16MHz Xtal
For i2c normal work, we need to slow down the bus speed. However, the
slow down breaks the eeprom firmware load. So, use normal speed for
eeprom booting and then restore the i2c speed after that.
It should also be noticed that no other I2C transfer should be in course
while booting from eeprom, otherwise, tda10046 goes into an instable
state. So, proper locking are needed at the i2c bus master.
Tested with saa7134 MSI TV @nyware A/D board, that comes with an eeprom
with firmware version 29.
KBL is not needed on saa7134, so, let's remove it.
However, we should take some care to avoid opening the module while
initializing it. This issue exists with newer udev's that opens a device
as soon as the driver is registered. So, a proper lock is needed on
open.
V4L/DVB (10507): saa7134: Fix analog mode on devices that need to open an i2c gate
Some saa7134 devices require to open an i2c gate before tuning. This
patch fix the initialization for those devices.
The nxt200x_gate_ctrl() logic were returned back to the old place, since
we don't know how to close the gate. A future pacth could revert that
change and provide the proper close gate control, to avoid keeping it
open forever.
V4L/DVB (10506): saa7134: move tuner init code to saa7134-cards
On certain devices, before opening a tuner, we need to open the tuner
gate via i2c.
This patch just moves the tuner probing code to the same place where
such i2c commands are handled, to make easier to fix this trouble on
later patches.
V4L/DVB (10504): tda827x: Be sure that gate will be open/closed at the proper time
The gate control logic is broken: several routines just keep it open;
other rotines close it properly; there are even other routines that
assumes that it is open without really checking or opening it.
Instead of having to manually handle the gate control and having such
troubles, let a sub-routine take care of the gate, opening it before
i2c_transfer and closing it after that. This avoids leaving the gate
into a random state.
Cc: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Sat, 7 Feb 2009 23:42:33 +0000 (20:42 -0300)]
V4L/DVB (10502): saa7146: move v4l2 device registration to saa7146_vv.
Doing the v4l2_device registration in the saa7146 core will make it
dependent on v4l2, even for DVB-only boards. This registration and
unregistration belongs in saa7146_vv instead.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Sat, 7 Feb 2009 14:18:05 +0000 (11:18 -0300)]
V4L/DVB (10499): saa7146: convert saa7146 and mxb in particular to v4l2_subdev.
Modified mxb to load the i2c modules through v4l2_subdev. So no more probing.
Modified tea6415c and tea6420 to use the standard routing ops to do the
routing, rather than using private commands. Dropped the private commands
from tda9840 (they were never used except during initialization of the
module).
Added saa7146 support for VIDIOC_DBG_G_CHIP_IDENT.
Converted saa5246a and saa5249 to v4l2_subdev.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Sat, 7 Feb 2009 14:00:02 +0000 (11:00 -0300)]
V4L/DVB (10490): v4l2: prefill ident and revision from v4l2_dbg_chip_ident.
Drivers that implement this always have to set the ident and revision
to V4L2_IDENT_NONE and 0. Do this in the v4l2 core so drivers don't have
to do this.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Alexey Klimov [Thu, 5 Feb 2009 11:56:07 +0000 (08:56 -0300)]
V4L/DVB (10460): radio-mr800: add stereo support
Patch introduces new amradio_set_stereo function.
Driver calls this func to make stereo radio reception.
Corrects checking of returned value after usb_bulk_msg.
Alexey Klimov [Thu, 5 Feb 2009 11:53:02 +0000 (08:53 -0300)]
V4L/DVB (10458): radio-mr800: move radio start and stop in one function
Patch introduces new amradio_set_mute function. Amradio_start and
amradio_stop removed. This makes driver more flexible and it's useful
for next changes.
Andy Walls [Mon, 9 Feb 2009 01:40:04 +0000 (22:40 -0300)]
V4L/DVB (10446): cx18: Finally get sliced VBI working - for 525 line 60 Hz systems at least
Sliced VBI, in the manner that ivtv implements it as a separate data stream,
now works for 525 line 60 Hz systems like NTSC-M. It may work for 625 line
50 Hz systems, but I have more engineering work to do, to verify it is operating
properly. Sliced data insertion into the MPEG PS should be working, but is
untested.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sat, 7 Feb 2009 18:47:28 +0000 (15:47 -0300)]
V4L/DVB (10445): cx18: Process Raw VBI on a whole frame basis; fix VBI buffer size
The cx23418 appears to send Raw VBI buffers with a PTS on a per frame
basis, not per field, so process Raw VBI on a whole frame basis and reduce
some complexity. Fix VBI buffer size computation to handle a whole
frame of Raw VBI for a 625 line system, which is the worst case and will
work for 525 lines systems as well.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sat, 7 Feb 2009 04:31:22 +0000 (01:31 -0300)]
V4L/DVB (10444): cx18: Fix sliced VBI PTS and fix artifacts in last raw line of field
Fixed an endianess problem with the collection of the PTS from
the VBI buffer given to us by the encoder. Also extrapolated the
last 12 bytes of the last line of each field, to remove artifacts
created by removing the first 12 bytes of each field for raw VBI.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Fri, 6 Feb 2009 21:33:43 +0000 (18:33 -0300)]
V4L/DVB (10442): cx18: Fixes for enforcing when Encoder Raw VBI params can be set
The Encoder will only allow the Raw VBI parameters, along with a number of
other API parameters, to take effect when no analog captures are in
progress. These parameters must be set before the first analog capture starts,
be it MPEG, VBI, YUV, etc., and cannot be changed until the last one stops. It
is not obvious to me what capture channel API parameters are shared and which
ones must be set per capture channel, so set them all for every analog
capture channel start up. This fixes the driver so that VBI capture can be
started up after the MPEG capture is going.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Mon, 2 Feb 2009 00:42:12 +0000 (21:42 -0300)]
V4L/DVB (10440): cx18: Fix presentation timestamp (PTS) for VBI buffers
The old code from ivtv used a CX23415/6 PTS, which was simply left at 0 in the
cx18 driver. Since the CX23418 gives us what I think is a PTS (or some other
90 kHz clock count) with each VBI buffer, this change has the cx18 driver use
that as a PTS.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sat, 31 Jan 2009 01:39:26 +0000 (22:39 -0300)]
V4L/DVB (10434): cx18: Smarter verification of CX18_AUDIO_ENABLE register writes
The CX18_AUDIO_ENABLE register usually never reads back what was just written
under normal circumstances. Perform better checking that a write went to the
register as expected with a specification of what bits to verify.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB (10405): saa7134-core: loading saa7134-alsa is now the default
Most boards nowadays supports saa7134-alsa. Even some of they doesn't have any
option to wire an audio cable. So, lets load saa7134-alsa by default, if the
board is not based on saa7130 and if saa7134-alsa is compiled.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html