linux-2.6
16 years agoV4L/DVB (7407): tuner-simple: add module options to specify rf input
Michael Krufky [Tue, 22 Apr 2008 17:46:12 +0000 (14:46 -0300)] 
V4L/DVB (7407): tuner-simple: add module options to specify rf input

Add module options to tuner-simple, called "atv_input" and "dtv_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>
16 years agoV4L/DVB (7406): soc-camera: improve separation between soc_camera_ops and soc_camera_...
Guennadi Liakhovetski [Mon, 24 Mar 2008 15:18:36 +0000 (12:18 -0300)] 
V4L/DVB (7406): soc-camera: improve separation between soc_camera_ops and soc_camera_device

In case of muliple cameras, handled by the same driver, they can support

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7404): saa7134.h: Remove unnecessary validation
Douglas Schilling Landgraf [Tue, 22 Apr 2008 17:46:12 +0000 (14:46 -0300)] 
V4L/DVB (7404): saa7134.h: Remove unnecessary validation

Removed unnecessary VIDIOC_G_PRIORITY validation.

Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7402): add macro validation for v4l_compat_ioctl32
Douglas Schilling Landgraf [Tue, 22 Apr 2008 17:46:11 +0000 (14:46 -0300)] 
V4L/DVB (7402):  add macro validation for v4l_compat_ioctl32

Added macro CONFIG_COMPAT for v4l_compat_ioctl32.

Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7401): radio-si470x: unplugging fixed
Tobias Lorenz [Tue, 22 Apr 2008 17:46:11 +0000 (14:46 -0300)] 
V4L/DVB (7401): radio-si470x: unplugging fixed

This patch fixes several kernel oops, when unplugging device while it is in
use:

Basically the patch delays freeing of the internal variables in
si470x_usb_driver_disconnect, until the the last user closed the device in
si470x_fops_release. This was implemented a while ago with the help of Oliver
Neukum.

I tested the patch five times (unplugging while in use) without oops coming
from the radio-si470x driver anymore. A remaining oops was coming from the
usbaudio driver, but this is someone else task. Hopefully this fixed all
unplugging issues.

Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7399): Removes video_dev from tuner-xc2028 config struct
Mauro Carvalho Chehab [Tue, 22 Apr 2008 17:46:11 +0000 (14:46 -0300)] 
V4L/DVB (7399): Removes video_dev from tuner-xc2028 config struct

The video_dev parameter, on tuner-xc2028 were used to pass i2c private data to
tuner_callback. Since the driver already have a pointer to i2c_adap->algo_data,
uses this instead.

This parameter were used also as a magic number to idenfity if two drivers are
trying to register the same xc3028 tuner. This occurs with boards with DVB
support, where both DVB and V4L drivers will share the same tuner.

Instead of using the algo_data as a private number, after this patch, the
driver will use i2c_adap->dev, with seems more consistent.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7398): Adds an error if priv argument of tuner_callback is NULL
Mauro Carvalho Chehab [Tue, 22 Apr 2008 17:46:10 +0000 (14:46 -0300)] 
V4L/DVB (7398): Adds an error if priv argument of tuner_callback is NULL

Adds a consistency check to avoid OOPS, if tuner_callback priv argument is
NULL. Also, simplifies callback codes on cx88.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7396): saa7134: fixed pointer in tuner callback
Hartmut Hackmann [Tue, 22 Apr 2008 17:46:10 +0000 (14:46 -0300)] 
V4L/DVB (7396): saa7134: fixed pointer in tuner callback

The pointer transferred directly points to the saa7134_dev
structure

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7395): saa7134: start 2nd LND supply of Medion cards only if needed
Hartmut Hackmann [Tue, 22 Apr 2008 17:46:10 +0000 (14:46 -0300)] 
V4L/DVB (7395): saa7134: start 2nd LND supply of Medion cards only if needed

The ISL6405 LNB supply is used on several Creatix / Medion cards. But only
the MD8800 needs its second section. So don't start it unless it is needed.

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7394): saa7134: add number of devices check
Alan McIvor [Tue, 22 Apr 2008 17:46:09 +0000 (14:46 -0300)] 
V4L/DVB (7394): saa7134: add number of devices check

This patch fixes reported problems when trying to add a 9th device into a
system.

Signed-off-by: Alan McIvor <alan.mcivor@reveal.co.nz>
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7393): tda827x: fixed support of tuners with LNA
Hartmut Hackmann [Tue, 22 Apr 2008 17:46:08 +0000 (14:46 -0300)] 
V4L/DVB (7393): tda827x: fixed support of tuners with LNA

Tuner refactoring broke support of tuners with LNA configurations 1 and 2
for both, analog TV and DVB-T.
Additionally, this patch initializes the saa713x gpios defined by the gpiomask
at driver init to avoid undefined stated at dvb.

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7392): saa7134: support 2nd DVB-S section of the MD8800
Hartmut Hackmann [Tue, 22 Apr 2008 17:46:08 +0000 (14:46 -0300)] 
V4L/DVB (7392): saa7134: support 2nd DVB-S section of the MD8800

There are some restrictions:
- The 2nd DVB-S section will only work if the 1st is configured for DVB-S too.
  so "options saa7134-dvb use_frontend=0,1" won't work.
- Currently it is not possible to set the higher LNB supply voltages, so
  14V instead of 13V in the 2nd section.
- It is not possibe to turn off the 2nd LNB supply independently.
This comes from the problem that the 2nd section can't access the i2c interface
of the LNB supply chip.

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7391): saa7134: Add DVB-S support for the MD 1734 cards with 2 saa7134
Hartmut Hackmann [Tue, 22 Apr 2008 17:46:08 +0000 (14:46 -0300)] 
V4L/DVB (7391): saa7134: Add DVB-S support for the MD 1734 cards with 2 saa7134

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7390): saa7134: clear audio DSP interface after access error
Hartmut Hackmann [Tue, 22 Apr 2008 17:46:07 +0000 (14:46 -0300)] 
V4L/DVB (7390): saa7134: clear audio DSP interface after access error

In the case of an access error to the high latency registers of
the audio DSP, the interface needs to be cleared, otherwise a cascade
of errors occurs.

This patch is closely modeled after a proposal by Mirek Slugen

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7389): git-dvb: drivers/media/video/bt8xx/bttv-cards.c: fix warnings
Andrew Morton [Tue, 22 Apr 2008 17:46:07 +0000 (14:46 -0300)] 
V4L/DVB (7389): git-dvb: drivers/media/video/bt8xx/bttv-cards.c: fix warnings

drivers/media/video/bt8xx/bttv-cards.c:3030:38: warning: "/*" within comment
drivers/media/video/bt8xx/bttv-cards.c:3032:20: warning: "/*" within comment

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7388): saa7134: fix radio entry for xc2028/3028 boards
Mauro Carvalho Chehab [Tue, 22 Apr 2008 17:46:07 +0000 (14:46 -0300)] 
V4L/DVB (7388): saa7134: fix radio entry for xc2028/3028 boards

If left in blank, the driver will use value 0 (Temic PAL)

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7387): saa7134: Fix xc3028 entries
Mauro Carvalho Chehab [Tue, 22 Apr 2008 17:46:06 +0000 (14:46 -0300)] 
V4L/DVB (7387): saa7134: Fix xc3028 entries

Tuner addresses were incorrect. Fix the entries.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7385): tda18271: store agc_mode configuration independently of std_bits
Michael Krufky [Tue, 22 Apr 2008 17:46:06 +0000 (14:46 -0300)] 
V4L/DVB (7385): tda18271: store agc_mode configuration independently of std_bits

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7384): tda18271: store FM_RFn setting in struct tda18271_std_map_item
Michael Krufky [Tue, 22 Apr 2008 17:46:06 +0000 (14:46 -0300)] 
V4L/DVB (7384): tda18271: store FM_RFn setting in struct tda18271_std_map_item

All standard related configuration is stored within
struct tda18271_std_map_item.  Pass a pointer to this
structure rather than its individual members.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7383): tda18271: add attach-time parameter to limit i2c transfer size
Michael Krufky [Tue, 22 Apr 2008 17:46:06 +0000 (14:46 -0300)] 
V4L/DVB (7383): tda18271: add attach-time parameter to limit i2c transfer size

Add attach-time parameter, "small_i2c" to limit i2c transfer size to write
at most 16 registers at a time during initialization.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7381): tuner: rename TUNER_PHILIPS_ATSC to TUNER_PHILIPS_FCV1236D
Michael Krufky [Tue, 22 Apr 2008 17:46:05 +0000 (14:46 -0300)] 
V4L/DVB (7381): tuner: rename TUNER_PHILIPS_ATSC to TUNER_PHILIPS_FCV1236D

TUNER_PHILIPS_ATSC is an ambiguous name for a tuner.  Rename it to
TUNER_PHILIPS_FCV1236D to be more descriptive.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7380): tuner-simple: warn if tuner can't be probed during attach
Michael Krufky [Tue, 22 Apr 2008 17:46:05 +0000 (14:46 -0300)] 
V4L/DVB (7380): tuner-simple: warn if tuner can't be probed during attach

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7379): tuner: prevent instance sharing if i2c adapter is NULL
Michael Krufky [Tue, 22 Apr 2008 17:46:04 +0000 (14:46 -0300)] 
V4L/DVB (7379): tuner: prevent instance sharing if i2c adapter is NULL

We currently do not have a method to enable instance staring if i2c adapter
is NULL, in the cases of dvb demods that write to the tuner directly using
calc_regs.  Prevent possible wrong instance sharing for these cases until
a better solution can be found.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7378): cleanup variable initialization
Guennadi Liakhovetski [Tue, 22 Apr 2008 17:46:03 +0000 (14:46 -0300)] 
V4L/DVB (7378): cleanup variable initialization

flags used for spinlocks don't need to be initialized, except where the
compiler has no way to see, that the spin_unlock_irqrestore is only called
if the spin_lock_irqsave has been called before. Local variable
initialization doesn't have to be protected.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7377): radio-sf16fmr2.c: fix volume handling
Mauro Carvalho Chehab [Tue, 22 Apr 2008 17:46:03 +0000 (14:46 -0300)] 
V4L/DVB (7377): radio-sf16fmr2.c: fix volume handling

As reported by  Roel Kluin <12o3l@tiscali.nl>:
in drivers/media/radio/radio-sf16fmr2.c:319:

for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) {
if ((fmr2->card_type != 11)
                 && V4L2_CID_AUDIO_VOLUME)
        radio_qctrl[i].step = 65535;
        ...

I don't understand this '&& V4L2_CID_AUDIO_VOLUME'

While fixing this issue, I've revisited the volume control code and fixed
CodingStyle on the changed procedures.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7376): Improve compile-time type-checking in videobuf
Guennadi Liakhovetski [Tue, 22 Apr 2008 17:46:02 +0000 (14:46 -0300)] 
V4L/DVB (7376): Improve compile-time type-checking in videobuf

Make the dev member of the struct videobuf_queue of type "struct device *"
to avoid future problems. Also change the prototype of the
videobuf_queue_core_init() function.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7375): cx88/saa7134: fix magic number for xc3028 reusage detection
Mauro Carvalho Chehab [Tue, 22 Apr 2008 17:46:02 +0000 (14:46 -0300)] 
V4L/DVB (7375): cx88/saa7134: fix magic number for xc3028 reusage detection

tuner-xc2028 needs to know when a DVB module is sharing the same analog tuner.
This is done by comparing a magic number that needs to be the same on analog
and on digital. To make easier, this magic number is a pointer to some data
struct.

With the previous code, two different pointers were using, causing a
miss-detection.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7374): Fix left-overs from the videobuf-dma-sg.c conversion to generic DMA
Guennadi Liakhovetski [Tue, 22 Apr 2008 17:46:02 +0000 (14:46 -0300)] 
V4L/DVB (7374): Fix left-overs from the videobuf-dma-sg.c conversion to generic DMA

The dev element of the struct videobuf_queue is now of type struct device
implicitly. Fix left-over casts.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7373): logical-bitwise & confusion in se401_init()
Roel Kluin [Tue, 22 Apr 2008 17:46:02 +0000 (14:46 -0300)] 
V4L/DVB (7373): logical-bitwise & confusion in se401_init()

logical-bitwise & confusion

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7372): cx88: Add IR support for Pixelview MPEG 8000GT
Mauro Carvalho Chehab [Tue, 22 Apr 2008 17:46:01 +0000 (14:46 -0300)] 
V4L/DVB (7372): cx88: Add IR support for Pixelview MPEG 8000GT

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7371): cx88: Fix audio on Prolink Pixelview Mpeg 8000GT
Mauro Carvalho Chehab [Tue, 22 Apr 2008 17:46:01 +0000 (14:46 -0300)] 
V4L/DVB (7371): cx88: Fix audio on Prolink Pixelview Mpeg 8000GT

This board works only with non-mts firmware

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7370): Add basic support for Prolink Pixelview MPEG 8000GT
Mauro Carvalho Chehab [Tue, 22 Apr 2008 17:46:00 +0000 (14:46 -0300)] 
V4L/DVB (7370): Add basic support for Prolink Pixelview MPEG 8000GT

TV reception ok. S-video and Composite not tested. Audio not tested.
IR not implemented yet.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7369): drivers/media/video/soc_camera.c: reads return size_t
Andrew Morton [Tue, 22 Apr 2008 17:45:59 +0000 (14:45 -0300)] 
V4L/DVB (7369): drivers/media/video/soc_camera.c: reads return size_t

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
CC: Guennadi Liakhovetski <kernel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7368): bttv: added support for Kozumi KTV-01C card
Mauro Lacy [Tue, 22 Apr 2008 17:45:58 +0000 (14:45 -0300)] 
V4L/DVB (7368): bttv: added support for Kozumi KTV-01C card

Signed-off-by: Mauro Lacy <mauro@lacy.com.ar>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7366): Support for a 16-channel bt878 card
Ernesto Hernández-Novich [Tue, 22 Apr 2008 17:45:58 +0000 (14:45 -0300)] 
V4L/DVB (7366): Support for a 16-channel bt878 card

I have what looks like a Geovision GV-600 (or 650) card. It has a large
chip in the middle labeled

CONEXANT
FUSION 878A
25878-13
E345881.1
0312 TAIWAN

It has an audio connector coming out from a chip labeled

ATMEL
0242
AT89C2051-24PI

It is identified as follows on my Debian GNU/Linux Etch (kernel 2.6.18)

...
01:0a.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
01:0a.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
...
01:0a.0 0400: 109e:036e (rev 11)
        Subsystem: 008a:763c
        Flags: bus master, medium devsel, latency 64, IRQ 58
        Memory at dfffe000 (32-bit, prefetchable) [size=4K]
        Capabilities: [44] Vital Product Data
        Capabilities: [4c] Power Management version 2

01:0a.1 0480: 109e:0878 (rev 11)
        Subsystem: 008a:763c
        Flags: bus master, medium devsel, latency 64, IRQ 58
        Memory at dffff000 (32-bit, prefetchable) [size=4K]
        Capabilities: [44] Vital Product Data
        Capabilities: [4c] Power Management version 2

It was being detected as a GENERIC UNKNOWN CARD both by the 2.6.18
kernel and the latest v4l-dvb drivers, but it did not work at all. The
card has sixteen (16) BNC video inputs, four of them on the board itself
and twelve on three daughter-cards. It has a single bt878 chip, no tuner
and what looks like and audio input. After doing some research I managed
to get only eight channels working by forcing card=125 and those DID NOT
match channels 0-7 on the card, and no audio.

Based on what was working for card=125, I added the card definition
block, added a specific muxsel routine and got the card working fully
with xawtv, where the sixteen channels show up as Composite0 to
Composite15, matching the channel labels in the card and daughter-cards.
I have made no efforts yet to get audio working, but would appreciate
any pointers.

Signed-off-by: Ernesto Hernández-Novich <emhn@usb.ve>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7365): reduce stack usage of v4l1_compat_sync
Marcin Slusarz [Tue, 22 Apr 2008 17:45:57 +0000 (14:45 -0300)] 
V4L/DVB (7365): reduce stack usage of v4l1_compat_sync

poll_one allocated on stack struct poll_wqueues which is pretty big
structure (>500 bytes on x86_64). v4l1_compat_sync invokes poll_one
in a loop, so allocate struct poll_wqueues in v4l1_compat_sync (with
kmalloc) and pass it to poll_one.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7364): reduce stack usage of v4l_compat_translate_ioctl
Marcin Slusarz [Tue, 22 Apr 2008 17:45:57 +0000 (14:45 -0300)] 
V4L/DVB (7364): reduce stack usage of v4l_compat_translate_ioctl

v4l_compat_translate_ioctl used 1376 bytes of stack (x86_64),
so split this 800 lines long function into ~20 small noinline functions;
the biggest function takes now 712 bytes (v4l1_compat_sync)

fix VIDIOCSWIN handler which printked wrong errors

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7363): fix coding style violations in v4l1-compat.c
Marcin Slusarz [Tue, 22 Apr 2008 17:45:57 +0000 (14:45 -0300)] 
V4L/DVB (7363): fix coding style violations in v4l1-compat.c

fix most coding style violations found by checkpatch

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7360): tuner-simple: fix return value of simple_dvb_configure
Michael Krufky [Tue, 22 Apr 2008 17:45:56 +0000 (14:45 -0300)] 
V4L/DVB (7360): tuner-simple: fix return value of simple_dvb_configure

simple_dvb_configure returns the actual tuned frequency to its caller, so
it must be declared as a u32 rather than an int.  As a result, we will
return 0 to indicate a failure.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7359): tuner-simple: enable digital tuning support for Thomson FE6600
Michael Krufky [Tue, 22 Apr 2008 17:45:56 +0000 (14:45 -0300)] 
V4L/DVB (7359): tuner-simple: enable digital tuning support for Thomson FE6600

Enable digital tuning support within tuner-simple. This will allow for a
single tuner module to manage the hardware, without having dvb-pll loaded.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7358): tuner-simple: enable digital tuning support for Philips TD1316
Michael Krufky [Tue, 22 Apr 2008 17:45:56 +0000 (14:45 -0300)] 
V4L/DVB (7358): tuner-simple: enable digital tuning support for Philips TD1316

Enable digital tuning support within tuner-simple. This will allow for a
single tuner module to manage the hardware, without having dvb-pll loaded.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7357): tuner-simple: enable digital tuning support for Microtune 4042 FI5
Michael Krufky [Tue, 22 Apr 2008 17:45:56 +0000 (14:45 -0300)] 
V4L/DVB (7357): tuner-simple: enable digital tuning support for Microtune 4042 FI5

Enable digital tuning support within tuner-simple. This will allow for a
single tuner module to manage the hardware, without having dvb-pll loaded.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7356): tuner-simple: enable digital tuning support for Thomson DTT 7610
Michael Krufky [Tue, 22 Apr 2008 17:45:55 +0000 (14:45 -0300)] 
V4L/DVB (7356): tuner-simple: enable digital tuning support for Thomson DTT 7610

Enable digital tuning support within tuner-simple. This will allow for a
single tuner module to manage the hardware, without having dvb-pll loaded.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7355): tuner-simple: use separate inputs for vsb and qam on tuv1236d & fcv1236d
Michael Krufky [Tue, 22 Apr 2008 17:45:55 +0000 (14:45 -0300)] 
V4L/DVB (7355): tuner-simple: use separate inputs for vsb and qam on tuv1236d & fcv1236d

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7354): tuner-simple: enable digital tuning support for Philips FCV1236D
Michael Krufky [Tue, 22 Apr 2008 17:45:55 +0000 (14:45 -0300)] 
V4L/DVB (7354): tuner-simple: enable digital tuning support for Philips FCV1236D

Enable digital tuning support within tuner-simple. This will allow for a
single tuner module to manage the hardware, without having dvb-pll loaded.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7353): tuner-simple: enable digital tuning support for Philips TUV1236D
Michael Krufky [Tue, 22 Apr 2008 17:45:54 +0000 (14:45 -0300)] 
V4L/DVB (7353): tuner-simple: enable digital tuning support for Philips TUV1236D

Enable digital tuning support within tuner-simple. This will allow for a
single tuner module to manage the hardware, without having dvb-pll loaded.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7352): tuner-simple: enable digital tuning support for Philips FMD1216ME
Michael Krufky [Tue, 22 Apr 2008 17:45:53 +0000 (14:45 -0300)] 
V4L/DVB (7352): tuner-simple: enable digital tuning support for Philips FMD1216ME

Enable digital tuning support within tuner-simple. This will allow for a
single tuner module to manage the hardware, without having dvb-pll loaded.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7351): tuner-simple: add init and sleep methods
Michael Krufky [Tue, 22 Apr 2008 17:45:53 +0000 (14:45 -0300)] 
V4L/DVB (7351): tuner-simple: add init and sleep methods

taken from dvb-pll

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7350): tuner-simple: enable digital tuning support for Thomson DTT 761X
Michael Krufky [Tue, 22 Apr 2008 17:45:52 +0000 (14:45 -0300)] 
V4L/DVB (7350): tuner-simple: enable digital tuning support for Thomson DTT 761X

Enable digital tuning support within tuner-simple. This will allow for a
single tuner module to manage the hardware, without having dvb-pll loaded.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7349): tuner-simple: enable digital tuning support for LG TDVS-H06xF
Michael Krufky [Tue, 22 Apr 2008 17:45:52 +0000 (14:45 -0300)] 
V4L/DVB (7349): tuner-simple: enable digital tuning support for LG TDVS-H06xF

Enable digital tuning support within tuner-simple. This will allow for a
single tuner module to manage the hardware, without having dvb-pll loaded.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7348): tuner-simple: do not send i2c commands if there is no i2c adapter
Michael Krufky [Tue, 22 Apr 2008 17:45:52 +0000 (14:45 -0300)] 
V4L/DVB (7348): tuner-simple: do not send i2c commands if there is no i2c adapter

if (priv->i2c_props.adap == NULL) then exit any function that would
send commands over the i2c bus.  We allow drivers to attach without an
i2c adapter for cases where the dvb demod accesses the tuner directly
via calc_regs.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7347): tuner-simple: add basic support for digital tuning of hybrid devices
Michael Krufky [Tue, 22 Apr 2008 17:45:52 +0000 (14:45 -0300)] 
V4L/DVB (7347): tuner-simple: add basic support for digital tuning of hybrid devices

Add entry points used for digital tuning via the dvb_frontend.

Share state data between multiple instances of the driver for hybrid
tuners.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7346): tda9887: allow multiple driver instances for the same hardware to...
Michael Krufky [Tue, 22 Apr 2008 17:45:51 +0000 (14:45 -0300)] 
V4L/DVB (7346): tda9887: allow multiple driver instances for the same hardware to share state

Convert tda9887 to use the new hybrid_tuner_request_state and
hybrid_tuner_release_state macros to manage state sharing between
hybrid tuner instances.

Some ATSC/DVB cards need to put the analog demodulator into standby
before tuning digital.  This patch allows us to attach the tda9887
driver to the digital side of the bridge driver and be able to put
it into standby without jeopardizing the analog demod driver's state.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7344): cx25840: better PAL-M and NTSC-KR handling
Hans Verkuil [Tue, 22 Apr 2008 17:45:51 +0000 (14:45 -0300)] 
V4L/DVB (7344): cx25840: better PAL-M and NTSC-KR handling

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7343): msp3400: fix SECAM D/K handling
Hans Verkuil [Tue, 22 Apr 2008 17:45:51 +0000 (14:45 -0300)] 
V4L/DVB (7343): msp3400: fix SECAM D/K handling

The 6.5 MHz carrier was interpreted as SECAM-L even if SECAM-D/K was
selected.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7342): saa7115: fix PAL-Nc handling
Hans Verkuil [Tue, 22 Apr 2008 17:45:51 +0000 (14:45 -0300)] 
V4L/DVB (7342): saa7115: fix PAL-Nc handling

Fsc 3.58 refers to Combination PAL-N (aka PAL-Nc), not to plain PAL-N (that
uses Fsc 4.43).

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7341): ivtv: rename tunerhz to tunertype
Hans Verkuil [Tue, 22 Apr 2008 17:45:50 +0000 (14:45 -0300)] 
V4L/DVB (7341): ivtv: rename tunerhz to tunertype

There are two tuner types: those for M/N standards and those for all others.
However, M/N standards are not always 60 Hz (PAL-N/Nc are 50 Hz), so rename
the module option accordingly.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7340): ivtv: fix tunerhz bug: PAL-N(c) is 50 Hz, not 60
Hans Verkuil [Tue, 22 Apr 2008 17:45:50 +0000 (14:45 -0300)] 
V4L/DVB (7340): ivtv: fix tunerhz bug: PAL-N(c) is 50 Hz, not 60

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7339): ivtv: add support for Japanese variant of the Adaptec AVC-2410
Hans Verkuil [Tue, 22 Apr 2008 17:45:50 +0000 (14:45 -0300)] 
V4L/DVB (7339): ivtv: add support for Japanese variant of the Adaptec AVC-2410

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7338): ivtv: improve pal/secam module options, add tunerhz module option
Hans Verkuil [Tue, 22 Apr 2008 17:45:49 +0000 (14:45 -0300)] 
V4L/DVB (7338): ivtv: improve pal/secam module options, add tunerhz module option

Allow options like pal=bgh, improve description of those options.
Add tunerhz option: 50=card has 50Hz tuner, 60=card has 60Hz tuner.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7337): ivtv: fix polling bug
Hans Verkuil [Tue, 22 Apr 2008 17:45:48 +0000 (14:45 -0300)] 
V4L/DVB (7337): ivtv: fix polling bug

The q_io queue was never taken into account by the poll function. Thanks to
Andy Walls for finding this bug.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7336): soc-camera: streamline hardware parameter negotiation
Guennadi Liakhovetski [Sat, 8 Mar 2008 00:57:18 +0000 (21:57 -0300)] 
V4L/DVB (7336): soc-camera: streamline hardware parameter negotiation

Improve hardware parameter negotiation between the camera host driver and
camera drivers. Parameters like horizontal and vertical synchronisation,
pixel clock polarity shall be set depending on capabilities of the
parties.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7335): usb-video: checkpatch fixes
Andrew Morton [Tue, 22 Apr 2008 17:45:47 +0000 (14:45 -0300)] 
V4L/DVB (7335): usb-video: checkpatch fixes

Please run checkpatch prior to sending patches

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7332): ir-kbd-i2c: Minor optimization in ir_probe
Jean Delvare [Tue, 22 Apr 2008 17:45:47 +0000 (14:45 -0300)] 
V4L/DVB (7332): ir-kbd-i2c: Minor optimization in ir_probe

This saves an initialization and a comparison.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7331): Fix em2800 altsetting selection
Sascha Sommer [Tue, 22 Apr 2008 17:45:47 +0000 (14:45 -0300)] 
V4L/DVB (7331): Fix em2800 altsetting selection

Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7329): add flag to allow software demux to recognize the output type
Andreas Oberritter [Tue, 22 Apr 2008 17:45:47 +0000 (14:45 -0300)] 
V4L/DVB (7329): add flag to allow software demux to recognize the output type

Previously, the macro DVR_FEED, which is used to recognize and filter
out duplicate packets going to the DVR device, used the TS_PAYLOAD_ONLY
flag to identify a packet's destination.

This kind of filtering was introduced by the following two changesets:

Now, that it is possible to record TS PIDs using the demux device by
setting the output type to DMX_OUT_TSDEMUX_TAP, checking TS_PAYLOAD_ONLY
is not sufficient anymore. Therefore another flag, TS_DEMUX, is added to
specify the output type of a feed.

This allows multiple clients to filter the same TS PID on a demux device
simultaneously.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7327): cx88: Fix memset for tuner-xc3028 control
Mauro Carvalho Chehab [Tue, 22 Apr 2008 17:45:46 +0000 (14:45 -0300)] 
V4L/DVB (7327): cx88: Fix memset for tuner-xc3028 control

Fix a cut-and-paste error

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7326): Fix bad whitespaces
Mauro Carvalho Chehab [Tue, 22 Apr 2008 17:45:46 +0000 (14:45 -0300)] 
V4L/DVB (7326): Fix bad whitespaces

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7325): cx88-dvb: fix an OOPS for xc3028 devices, when dvb_attach fails
Mauro Carvalho Chehab [Tue, 22 Apr 2008 17:45:46 +0000 (14:45 -0300)] 
V4L/DVB (7325): cx88-dvb: fix an OOPS for xc3028 devices, when dvb_attach fails

If dvb_attach fails, dev->dvb.frontend is NULL. This will produce an OOPS, as
reported.

Thanks to Vanessa Ezekowitz <vanessaezekowitz@gmail.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7323): pvrusb2: set default video standard to NTSC for OnAir HDTV / Creator
Michael Krufky [Tue, 22 Apr 2008 17:45:45 +0000 (14:45 -0300)] 
V4L/DVB (7323): pvrusb2: set default video standard to NTSC for OnAir HDTV / Creator

The pvrusb2 driver normally picks up the default video standard from the
eeprom on Hauppauge devices, but the OnAir HDTV and OnAir Creator are not
Hauppauge devices, and do not store this information in any eeprom.

These devices support NTSC/ATSC, so we should use NTSC by default when in
analog mode.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7322): pvrusb2: Fix storage-class as per C99 spec
Tobias Klauser [Tue, 22 Apr 2008 17:45:45 +0000 (14:45 -0300)] 
V4L/DVB (7322): pvrusb2: Fix storage-class as per C99 spec

The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is an
obsolescent feature.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7321): pvrusb2: Rework context handling and initialization
Mike Isely [Tue, 22 Apr 2008 17:45:45 +0000 (14:45 -0300)] 
V4L/DVB (7321): pvrusb2: Rework context handling and initialization

This change significantly rearranges pvr2_context level initialization
and operation:

1. A new kernel thread is set up for management of the context.

2. Destruction of the pvr2_context instance is moved into the kernel
   thread.  No other context is able to remove the instance; doing
   this simplifies lock handling.

3. The callback into pvrusb2-main, which is used to trigger
   initialization of each interface, is now issued from this kernel
   thread.  Previously it had been indirectly issued out of the work
   queue thread in pvr2_hdw, which led to deadlock issues if the
   interface needed to change a control setting (which in turn
   requires dispatch of another work queue entry).

4. Callbacks into the interfaces (via the pvr2_channel structure) are
   now issued strictly from this thread.  The net result of this is
   that such callback functions can now also safely operate driver
   controls without deadlocking the work queue.  (At the moment this
   is not actually a problem, but I'm anticipating issues with this in
   the future).

5. There is no longer any need for anyone to enter / exit the
   pvr2_context structure.  Implementation of the kernel thread here
   allows this all to be internal now, simplifying other logic.

6. A very very longstanding issue involving a mutex deadlock between
   the pvrusb2 driver and v4l should now be solved.  The deadlock
   involved the pvr2_context mutex and a globals-protecting mutex in
   v4l.  During initialization the driver would take the pvr2_context
   mutex first then the v4l2 interface would register with v4l and
   implicitly take the v4l mutex.  Later when v4l would call back into
   the driver, the two mutexes could possibly be taken in the opposite
   order, a situation that can lead to deadlock.  In practice this
   really wasn't an issue unless a v4l app tried to start VERY early
   after the driver appeared.  However it still needed to be solved,
   and with the use of the kernel thread relieving need for
   pvr2_context mutex, the problem should be finally solved.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7320): pvrusb2: Eliminate timer race during tear-down
Mike Isely [Tue, 22 Apr 2008 17:45:45 +0000 (14:45 -0300)] 
V4L/DVB (7320): pvrusb2: Eliminate timer race during tear-down

The pvrusb2 tear-down logic was clearing two timers before stopping
its internal work queue.  That left a tiny window open where the work
queue might run after the timers are stopped, possibly starting them
again.  This could lead to dangling pointers and an oops.  Solution:
Kill the work queue first, then delete the timers.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7319): pvrusb2: Close potential race condition during initialization
Mike Isely [Tue, 22 Apr 2008 17:45:44 +0000 (14:45 -0300)] 
V4L/DVB (7319): pvrusb2: Close potential race condition during initialization

There is a callback that is issued to into pvr2_context from pvr2_hdw
after initialization is done.  There was a probability that this
callback could get missed.  Fixed.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7318): pvrusb2: Remove dead code
Mike Isely [Tue, 22 Apr 2008 17:45:43 +0000 (14:45 -0300)] 
V4L/DVB (7318): pvrusb2: Remove dead code

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7317): pvrusb2: Increase buffer size for printing video standard strings
Mike Isely [Tue, 22 Apr 2008 17:45:43 +0000 (14:45 -0300)] 
V4L/DVB (7317): pvrusb2: Increase buffer size for printing video standard strings

Buffer size for printing pvrusb2 video standard strings was too small
before.  This is cosmetic; the printing logic is not able to overrun a
too-short buffer.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7316): pvrusb2: Handle ATSC video standard bits
Mike Isely [Tue, 22 Apr 2008 17:45:42 +0000 (14:45 -0300)] 
V4L/DVB (7316): pvrusb2: Handle ATSC video standard bits

The pvrusb2 driver dynamically generates an enumeration of support
video standard combinations based on which video standard bits are
set.  ATSC modes don't fall into this since they are by nature not
analog.  The pvrusb2 driver has been warning about an inability to
classify ATSC standards.  This change causes the classification
algorithm to ignore any ATSC standards (such things are better handled
elsewhere anyway).

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7315): pvrusb2: Add Gotview USB 2.0 DVD Deluxe to supported devices
Mike Isely [Tue, 22 Apr 2008 17:45:42 +0000 (14:45 -0300)] 
V4L/DVB (7315): pvrusb2: Add Gotview USB 2.0 DVD Deluxe to supported devices

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7314): pvrusb2: Make device attribute structure more compact
Mike Isely [Tue, 22 Apr 2008 17:45:42 +0000 (14:45 -0300)] 
V4L/DVB (7314): pvrusb2: Make device attribute structure more compact

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7313): pvrusb2: Make LED control into a device-specific attribute
Mike Isely [Tue, 22 Apr 2008 17:45:42 +0000 (14:45 -0300)] 
V4L/DVB (7313): pvrusb2: Make LED control into a device-specific attribute

The pvrusb2 driver has used hardcoded logic to control the LED on the
device.  However this is really Hauppauge-specific behavior.  This
change defines a new device attribute for LED control and sets things
up appropriately for Hauppauge devices.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7312): pvrusb2: Indicate streaming status via LED
Mike Isely [Tue, 22 Apr 2008 17:45:41 +0000 (14:45 -0300)] 
V4L/DVB (7312): pvrusb2: Indicate streaming status via LED

Most of this originates from Michael Krufky <mkrufky@linuxtv.org>;
these changes move LED control into separate functions.  This is the
first step in new work to make LED control a device-specific attribute.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7311): pvrusb2: Allow digital streaming without encoder firmware
Mike Isely [Tue, 22 Apr 2008 17:45:41 +0000 (14:45 -0300)] 
V4L/DVB (7311): pvrusb2: Allow digital streaming without encoder firmware

The encoder is not a part of the pipeline when in digital mode, so
streaming is OK in this case even when the encoder's firmware is not
loaded.  Modify the driver core handling of this scenario to permit
streaming.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7310): pvrusb2: trace print cosmetic cleanup / improvements
Mike Isely [Tue, 22 Apr 2008 17:45:41 +0000 (14:45 -0300)] 
V4L/DVB (7310): pvrusb2: trace print cosmetic cleanup / improvements

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7309): pvrusb2: Enhance core logic to also control digital streaming
Mike Isely [Tue, 22 Apr 2008 17:45:40 +0000 (14:45 -0300)] 
V4L/DVB (7309): pvrusb2: Enhance core logic to also control digital streaming

This is a major pvrusb2 change.  The driver core has an algorithm that
is used to cleanly sequence the changes needed to enable / disable
video streaming.  The algorithm had originally been written for analog
streaming, but when in digital mode the pipeline is considerably

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7308): pvrusb2: Define digital control scheme device attributes
Mike Isely [Tue, 22 Apr 2008 17:45:40 +0000 (14:45 -0300)] 
V4L/DVB (7308): pvrusb2: Define digital control scheme device attributes

Unlike analog control, control of the digital side is not nearly as
uniform among different devices.  So we have to specify the correct
digital control scheme as a new device attribute.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7307): pvrusb2: New functions for additional FX2 digital-related commands
Mike Isely [Tue, 22 Apr 2008 17:45:40 +0000 (14:45 -0300)] 
V4L/DVB (7307): pvrusb2: New functions for additional FX2 digital-related commands

This code is actually part of a larger set from Mike Krufky
<mkrufky@linuxtv.org>, to support ATSC streaming from within the
pvrusb2 driver.  More to come...

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7306): pvrusb2: Fix oops possible when claiming a NULL stream
Mike Isely [Tue, 22 Apr 2008 17:45:39 +0000 (14:45 -0300)] 
V4L/DVB (7306): pvrusb2: Fix oops possible when claiming a NULL stream

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7305): pvrusb2: whitespace fixup
Mike Isely [Tue, 22 Apr 2008 17:45:39 +0000 (14:45 -0300)] 
V4L/DVB (7305): pvrusb2: whitespace fixup

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7304): pvrusb2: add function pvr2_hdw_cmd_powerdown
Michael Krufky [Tue, 22 Apr 2008 17:45:39 +0000 (14:45 -0300)] 
V4L/DVB (7304): pvrusb2: add function pvr2_hdw_cmd_powerdown

Call pvr2_hdw_cmd_powerdown to power down the device

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7303): pvrusb2: Ensure that default input selection is actually valid
Mike Isely [Tue, 22 Apr 2008 17:45:39 +0000 (14:45 -0300)] 
V4L/DVB (7303): pvrusb2: Ensure that default input selection is actually valid

Previously the pvrusb2 driver just started with the default input to
be "television".  But if the device doesn't support an analog tuner
then this default must be different.  New logic here selects a
reasonable default based on the actual valid set of available inputs.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7302): pvrusb2: Improve control validation for enumerations
Mike Isely [Tue, 22 Apr 2008 17:45:38 +0000 (14:45 -0300)] 
V4L/DVB (7302): pvrusb2: Improve control validation for enumerations

When an enumeration control is changed, the pvrusb2 driver assumed
that the enumeration values were continuous.  That is no longer true;
this change allows for properly input validation even when not all
enumeration values are legal (which can happen with input selection
based on what the hardware supports).

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7301): pvrusb2: Implement addition sysfs tracing
Mike Isely [Tue, 22 Apr 2008 17:45:38 +0000 (14:45 -0300)] 
V4L/DVB (7301): pvrusb2: Implement addition sysfs tracing

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7300): pvrusb2: v4l2 implementation fixes for input selection
Mike Isely [Tue, 22 Apr 2008 17:45:38 +0000 (14:45 -0300)] 
V4L/DVB (7300): pvrusb2: v4l2 implementation fixes for input selection

Now that the pvrusb2 driver can dynamically choose which inputs to
make available depending on the hardware, the enumeration of input
choices is no longer a contiguous range of integers.  Unfortunately
this causes a problem in the v4l2 implementation since the input
enumeration requires continuity in the API.  This change implements a
mapping in order to preserve the v4l2 interface requirement.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7299): pvrusb2: Improve logic which handles input choice availability
Mike Isely [Tue, 22 Apr 2008 17:45:37 +0000 (14:45 -0300)] 
V4L/DVB (7299): pvrusb2: Improve logic which handles input choice availability

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7298): pvrusb2: Account for dtv choice (a bit) in v4l2 implementation
Mike Isely [Tue, 22 Apr 2008 17:45:37 +0000 (14:45 -0300)] 
V4L/DVB (7298): pvrusb2: Account for dtv choice (a bit) in v4l2 implementation

The v4l2 implementation in pvru2b2 must produce a sane answer when
asked, when the input choice is set to dtv.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7297): pvrusb2: Dynamically control range of input selections
Mike Isely [Tue, 22 Apr 2008 17:45:37 +0000 (14:45 -0300)] 
V4L/DVB (7297): pvrusb2: Dynamically control range of input selections

This follows from defining the available inputs as device attributes.
This change causes the driver to adjust its list of inputs based on
those attributes.  Now, for example, the FM radio will appear as a
choice only if the hardware supports an FM radio.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7296): pvrusb2: Define device attributes for all input modes
Mike Isely [Tue, 22 Apr 2008 17:45:36 +0000 (14:45 -0300)] 
V4L/DVB (7296): pvrusb2: Define device attributes for all input modes

Different devices support different input types.  Up until now we've
really been assuming that everyone has an analog tuner, an FM radio,
composite, and s-video inputs.  But as we add other devices, these
assumptions are no longer true.  The way to deal with this is to
define the available inputs as additional device attributes, so that
the driver can adjust its internal behavior accordingly.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7295): pvrusb2: add device attributes for fm radio and digital tuner
Mike Isely [Tue, 22 Apr 2008 17:45:36 +0000 (14:45 -0300)] 
V4L/DVB (7295): pvrusb2: add device attributes for fm radio and digital tuner

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7294): : tuner and radio addresses are missing for the PixelView PlayTV...
Wojciech Migda [Tue, 22 Apr 2008 17:45:36 +0000 (14:45 -0300)] 
V4L/DVB (7294): : tuner and radio addresses are missing for the PixelView PlayTV card

The PixelView PlayTV card definition structure was missing initialization of
the tuner_addr and radio_addr fields. As a result it was impossible to have the
tuner initialized using parameters specified while loading the bttv.ko module.

This regression became visible after the v4l rearrangements introduced
somewhere around 2.6.15 kernel version.

The root cause for the tuner initialization failure is located in the
attach_inform function in the bttv-i2c.c file.

There at the very beginning the addr variable holding the tuner device address
is initialized with the value taken from the bttv_tvcards array.

For the PixelView PlayTV card the tuner address field (and the radio address as
well) was uninitialized, and thus equal 0. Later in that function execution of
the TUNER_SET_TYPE_ADDR tuner command is guarded with check for the tuner
address either equal ADDR_UNSET, or client->addr.

Since both are non-zero (the latter in case of the card owned by me at the
runtime is equal 0x61) the TUNER_SET_TYPE_ADDR command is not executed, and
consequently in the tuner_attach function in the tuner-core.c file call to
i2c_attach_client does not result in assigning the tuner type variable with the
requested value.

Providing initialization of the tuner_addr and radio_addr with ADDR_UNSET
values as it is already done for other tv cards defined in bttv-cards.c ensures
that the tuner initialization is done correctly, just as it used to be in the
2.6.14 kernel.

Signed-off-by: Wojciech Migda <wojtek.golf@interia.pl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (7293): DMX_OUT_TSDEMUX_TAP: record two streams from same mux, resend
Peter Hartley [Tue, 22 Apr 2008 17:45:36 +0000 (14:45 -0300)] 
V4L/DVB (7293): DMX_OUT_TSDEMUX_TAP: record two streams from same mux, resend

Currently (in linux-2.6.24, but linux-dvb hg looks similar), the
dmx_output_t in the dmx_pes_filter_params decides two things: whether
output is sent to demux0 or dvr0 (in dmxdev.c:dvb_dmxdev_ts_callback),
*and* whether to depacketise TS (in dmxdev.c:dvb_dmxdev_filter_start).
As it stands, those two things can't be set independently: output
destined for demux0 is depacketised, output for dvr0 isn't.

This is what you want for capturing multiple audio streams from the same
multiplex simultaneously: open demux0 several times and send
depacketised output there. And capturing a single video stream is fine
not what you want: you want multi-open (so demux0, not dvr0), but you
want the TS nature preserved (because that's what you want on output, as
you're going to re-multiplex it with the audio).

At least one existing solution -- GStreamer -- sends all its streams
simultaneously via dvr0 and demuxes again in userland, but it seems a
bit of a shame to pick out all the PIDs in kernel, stick them back
together in kernel, and send them to userland only to get unpicked
again, when the alternative is such a small API addition.

The attached patch adds a new value for dmx_output_t:
DMX_OUT_TSDEMUX_TAP, which sends TS to the demux0 device. With this
patch and a dvb-usb-dib0700 (and UK Freeview from Sandy Heath), I can
successfully capture an audio/video PID pair into a TS file that mplayer
can play back.

Signed-off-by: Peter Hartley <pdh@utter.chaos.org.uk>
Acked-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>