Commit Graph

2472 Commits (3687e1e67e4920a202d53cc24678fb34fcda8fc5)

Author SHA1 Message Date
Mike Isely f8bcec6d18 V4L/DVB (6693): pvrusb2: Add pvrusb2-devattr.o to driver build
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:02 -02:00
Mike Isely 989eb154ea V4L/DVB (6692): pvrusb2: Centralize device specific attributes into a single place
The pvrusb2 driver currently supports two variants of the Hauppauge
PVR USB2.  However there are other hardware types potentially
supportable, but the driver at the moment is not structured to make it
easy to describe these minor variations.  This changeset is the first
set of changes to make such additional device support possible.
Device attributes are held in several tables all contained within
pvrusb2-devattr.c; all other device-specific driver behavior now
derives from these tables.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:02 -02:00
Mike Isely 681c739944 V4L/DVB (6691): pvrusb2: Rework pipeline state control
This is a new implementation for video pipeline control within the
pvrusb2 driver.  Actual start/stop of the pipeline is moved to the
driver's kernel thread.  Pipeline stages are controlled autonomously
based on surrounding pipeline or application control state.  Kernel
thread management is also cleaned up and moved into the internal
control structure of the driver, solving a set up / tear down race
along the way.  Better failure recovery is implemented with this new
control strategy.  Also with this change comes better control of the
cx23416 encoder, building on additional information learned about the
peculiarities of controlling this part (this information was the
original trigger for this rework).  With this change, overall encoder
stability should be considerably improved.  Yes, this is a large
change for this driver, but due to the nature of the feature being
worked on, the changes are fairly pervasive and would be difficult to
break into smaller pieces with any semblence of step-wise stability.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:01 -02:00
Brandon Philips 493977f016 V4L/DVB (6688): V4L: fix copy and paste error in dprintk for videobuf-vmalloc.c
Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:01 -02:00
Hermann Pitton cc76466b31 V4L/DVB (6687): saa7134: add mute support for radio/analog-in on MD9717 and MD7134
Currently the saa7134 chips only have mute support for the TV input.

Cards with mute from external audio muxes are already fine on the
other inputs and some recent tuners mute at least the radio on exit.
But these mostly hybrid tuners are not fully backward compatible, since
they must power down and mute regardless.

For some included above, the MD7134 knows several, to switch on mute/automute
to the TV input is functional and backward compatible for the applications,
except that the tuners with tda9887 always mute on exit.

Signed-off-by: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:01 -02:00
Mauro Carvalho Chehab 5c15648a42 V4L/DVB (6683): Fix DVB compatibility
DVB-S is not supported. Also, there are some QAM6 firmwares for xc3028, but it
is reported that this doesn't work fine.

Thanks to Manu Abraham, Michael Krufky and Patrick Boettcher for their
insights.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:00 -02:00
Michael Krufky 63c254805e V4L/DVB (6679): tda8290: force tuner init after attach
Force tuner init after attach, then sleep until use.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:59 -02:00
Mauro Carvalho Chehab 63806eeb61 V4L/DVB (6677): Fix xc2028 driver for non OFDM
A previous patch implemented support for non-OFDM digital TV. However, the
previous bandwidth ofdm parameter were left at the code by mistake.

Thanks to Michael Krufky and Patrick Boettcher for noticing this mistake.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:58 -02:00
Mauro Carvalho Chehab 66c2d53db2 V4L/DVB (6676): Improve s-code support
s-code tables are related to IF frequency used for video demodulation.

The s-codes for analog are automatically loaded, according with video standard.
However, for digital, they will depend on the IF of the demoduler chip. IF of
the demoduler.

Before this patch, only a few IF's where possible to use. This patch allows
selecting any IF defined at firmware file.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:58 -02:00
Mauro Carvalho Chehab b542dfdc9f V4L/DVB (6675): Allow selecting the proper SCode table for DTV
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:57 -02:00
Mauro Carvalho Chehab d04aa54a27 V4L/DVB (6674): Add support for other DTV types
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:56 -02:00
Mauro Carvalho Chehab d74cb25e42 V4L/DVB (6672): Add support for radio
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:54 -02:00
Mauro Carvalho Chehab 00deff1a07 V4L/DVB (6671): Avoids checking digital/analog at check_firmware
Since check_firmware is called via analog or digital set freq routines, move
type selection to those routines. This avoids having several if's at the code,
and simplifies the source code.

A sideback effect is that implementing radio and other dvb types will become
simpler.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:51 -02:00
Maxim Levitsky f36224d399 V4L/DVB (6670): V4L: saa7134: tvaudio cleanups
move some tv-audio initialization code out of tvaudio thread,
and call it on resume too.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:46 -02:00
Maxim Levitsky 5c01203fd2 V4L/DVB (6669): Add few missing bits of code to saa7134_resume
First the saa7134_initdev waits between saa7134_hwinit1
and saa7134_hwinit2 , thus it is probably wise to do the same in saa7134_resume
some hardware probably needs this.

Call saa7134_irq_video_signalchange in .resume like in saa7134_resume to make
saa7134_resume mirror perfectly the saa7134_initdev although
this call isn't strictly necessary in the saa7134_initdev,
but it won't harm anyway.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:45 -02:00
Maxim Levitsky 3203cb86d2 V4L/DVB (6668): Fix theoretical races between IRQ handler and .suspend/resume
*dev->insuspend = 1 should be set before synchronize_irq
 *ACK interrupts after synchronize_irq, to make sure there aren't
 pending interrupts.
 *Add barrier before we restart interrupts so the handler will 100%
 see the dev->insuspend

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:44 -02:00
Maxim Levitsky 0d65cd4f2b V4L/DVB (6667): Fix access to configuration space while in D3
pci_save_state should be called before pci_set_power_state
and pci_restore_state after pci_set_power_state

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:43 -02:00
Adrian Bunk 4c5efc1778 V4L/DVB (6665a): finish the VID_HARDWARE_* removal
This patch removes a few remainders of the VID_HARDWARE_* removal.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
643d01fb38b6f376cced035549f4e193018776e7
2008-01-25 19:02:42 -02:00
Mauro Carvalho Chehab c23f5949c0 V4L/DVB (6665): Fix CodingStyle
thanks to checkpatch.pl

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:41 -02:00
Mauro Carvalho Chehab cca8379811 V4L/DVB (6662): Fix standard selection for PAL
Not all 8MHz firmware are marked with F8MHz.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:40 -02:00
Mauro Carvalho Chehab 2800ae9cd6 V4L/DVB (6661): Remove firmware reload hack for analog
On some cases, xc2028/xc3028 wents into "turn off" mode. It seems that this
happens when very weak signals are tuned. To solve this, specific standard
reaload were done previously. Christopher patches changed this behavior to a
complete firmware reload.

This patch removes the hack. A much cleaner solution for this trouble is just
to sent a xc2028/3028 software reset.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:40 -02:00
Mauro Carvalho Chehab 71a2ee37e8 V4L/DVB (6660): Allow fully configuring xc3028 during xc2028_attach
xc3028 can be used on some DTV only designs (for example, DVB-S boards). Before
this patch, a DTV only board would need to call set_tuner_config callback.

This patch allows to optionally pass a xc3028_ctrl parameter, via xc3028_config
struct, fully initializing the driver for DTV.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:39 -02:00
Mauro Carvalho Chehab 5add9a6f3c V4L/DVB (6659): Convert MTS to bitfield
Xc2028.3028 has two type of firmwares: audio-standard specific ones and
baseband MTS firmwares. MTS firmwares provide stereo decoding for 6 MHz
BTSC/EIAJ and for monoaural audio decoding on 8 MHz firmwares.

It seems that the option to use MTS or a standard-specific audio decoding
depends on the way xc2028/3028 is connected.

Instead of wasting 32 (or 64 bits) to signalize if the driver needs to use MTS
firmware, this patch converts it to a bitfield that can be shared with other
proprieties of xc2028/3028.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:39 -02:00
Mauro Carvalho Chehab a5e9fe149a V4L/DVB (6658): Sets a default std, if not specified
Some drivers call set_frequency before selecting the video standard. Before
this patch, an invalid standard ID could be assumed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:38 -02:00
Mauro Carvalho Chehab c71d4bc512 V4L/DVB (6657): Fix standard selection for PAL/M, PAL/N, PAL/Nc and NTSC
Those standards use 6 MHz firmware.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:37 -02:00
Chris Pascoe 1ad0b796a3 V4L/DVB (6652): xc2028: try non-8MHZ init1 firmware
When loading init1 firmware, there may not be an 8MHz specific version.
Load the non-8MHz version if it exists.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:35 -02:00
Chris Pascoe 11a9eff9b6 V4L/DVB (6651): xc2028: mask off type correctly when searching for standard-specific types
When searching for standard-specific analog firmware, only certain
type bits are valid, much like for DTV.  Mask them off when finding
the firmware to load.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:32 -02:00
Chris Pascoe 47bd5bc648 V4L/DVB (6650): xc2028: base firmwares should have std0
When loading BASE firmware, we must use std = 0.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:32 -02:00
Chris Pascoe 45819c381f V4L/DVB (6648): xc2028: add sleep hook
Add sleep method to enable putting the tuner into standby mode.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:31 -02:00
Chris Pascoe 8bf799a621 V4L/DVB (6647): xc2028: retry firmware load if tuner does not respond
In practice, the tuner occasionally fails to respond correctly after a
firmware load.  Retry the firmware load if the firmware/hardware version
we read back from the tuner after programming does not match what we
expect.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:31 -02:00
Chris Pascoe e0f0b37a3e V4L/DVB (6646): xc2028: rework firmware (re)loading process
Define a list of valid "firmware types" for each combination of BASE,
DTV and SCODEs.  By masking the appropriate firmware bits off we can
just use one "type" for the firmware searching and also flag when we
are looking for a BASE, DTV or SCODE type firmware.  This makes it
much easier to track if we need to change device modes or flash an
individual firmware part.

Add a structure to remember what firmware properties we have.  This
contains the currently loaded/wanted  base firmware (type), video std
(id), video std requested (std_req), scode file and number in use.

Incorporate said structure into the tuner private data.

When checking whether the current firmware needs to be reloaded, first
figure out exactly what "type" of firmware we want (base, std and
scode), and then proceed to load the appropriate matching base,
std-specific and scode records iff there are any changes required.
This removes guesswork from the process because we no longer need to
individually code a check for every tuning parameter's interactions.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:30 -02:00
Chris Pascoe 59a636e50f V4L/DVB (6645): xc2028: allow selection of D2633 firmware
Add a bit to select D2633 DTV firmware to struct xc2028_ctrl, so that it can
be enabled via .set_config.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:30 -02:00
Chris Pascoe d7b22c5cfe V4L/DVB (6644): xc2028: use correct offset into scode firmware
When validating and loading SCODE firmware we need to take into account the
two-byte size header before each entry.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:29 -02:00
Chris Pascoe b1535293dc V4L/DVB (6643): xc2028: use best match instead of first partial match during firmware selection
Rather than picking the first video standard firmware that supports any of
the standards that the user has requested, try to select one that supports
as many of them as possible.  This improves the likelihood that the firmware
we select will support the user's desired TV standard.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:28 -02:00
Chris Pascoe 0a196b6fa9 V4L/DVB (6642): xc2028: don't duplicate max_len in priv
There is no need to duplicate the max_len field from the ctrl structure
in the private data.  If we use it directly from priv->ctrl, we can memcpy
the structure (apart from strings) to reduce maintenance as it grows.

Enforce a minimum max_len length of 8 data bytes (+ 1 address byte) as seems
to be required by the tuner.

Also, use kstrdup instead of open coding the string duplication.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:27 -02:00
Chris Pascoe a44f1c43df V4L/DVB (6641): xc2028: correct tuner offset for 7MHz DTV
7MHz bandwidth DVB-T needs an adjusted offset at the PLL to ensure the IF
output is correctly centered.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:27 -02:00
Chris Pascoe ddf1c5f1d7 V4L/DVB (6640): xc2028: correctly select 8MHz firmware
We were using priv->bandwidth to select the base firmware to load, not the
requested bandwidth value, oops.  Also, 7MHz Digital TV needs 8MHz base
firmware loaded.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:26 -02:00
Chris Pascoe 2ce4b3aa7c V4L/DVB (6639): xc2028: correct divisor length
The frequency divisor should only be four bytes long.  Also, display the
frequency and divisor correctly in the debug output.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:26 -02:00
Chris Pascoe 06fd82dc7b V4L/DVB (6638): xc2028: firmware loading cleanup
Hold the private lock over set_config and set priv->firm_size to 0 after a
failed firmware load to prevent firmware accidentally being freed on us.

Clean up the firmware load/error messages somewhat and rename priv->version
to priv->firm_version to make it clear which "version" it is.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:26 -02:00
Chris Pascoe b32f9fb962 V4L/DVB (6637): xc2028: add missing break
Add break to stop us from following the default failure path even upon success.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:25 -02:00
Chris Pascoe aa501be989 V4L/DVB (6636): xc2028: protect device list
Protect refcount changes and modifications to xc2028_list with a mutex.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:24 -02:00
Chris Pascoe 91240dd924 V4L/DVB (6635): xc2028: v4l2_std_id needs to be long long to display completely
Cast v4l2_std_id variables to unsigned long long so they will printk properly.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:23 -02:00
Chris Pascoe 3157ecef3b V4L/DVB (6634): xc2028: error messages missing whitespace
Fix some missing spaces in errors that may be emitted during attach failure.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:22 -02:00
Chris Pascoe 7d58d1117e V4L/DVB (6633): xc2028: make register reads atomic
Issuing register reads as a separate address write and data read transactions
means that other I2C activity could occur in between and state could get out
of sync.  Issue both the write and read in a single transaction so that the
i2c layer can prevent other users accessing the bus until we are complete.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:22 -02:00
Chris Pascoe e155d908f7 V4L/DVB (6632): xc2028: fix inverted logic in audio standard check
strcasecmp returns 0 on match, not true.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:22 -02:00
Chris Pascoe 47cc5b7810 V4L/DVB (6631): xc2028: eliminate i2c macro side-effects
The I2C macros have side effects and send_seq could cause a return from
a function with a mutex held.  Change them to behave like real functions.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:21 -02:00
Adrian Bunk 166fb6b472 V4L/DVB (6623): remove saa7134-oss
The saa7134-oss is deprecated for quite some time, it's the only remaining OSS
user outside of sound/oss/, and considering how few and what kind of
soundcards are left supported by OSS I hardly see any use cases left.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:17 -02:00
Michael Krufky 5efab70958 V4L/DVB (6620): kconfig: VIDEO_SAA7134 must select VIDEO_TVEEPROM
The ability to read Hauppauge eeprom's was recently added to saa7134,
so we must build the tveeprom module.

Thanks to Matthias Schwarzott for pointing this out.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:16 -02:00
Aidan Thornton 122d15888a V4L/DVB (6619): Use MTS firmware for the HVR-900
The HVR-900 requires the MTS version of the xc3028 firmware in order
to get any sound. The below patch selects this firmware variant on
HVR-900 cards, as well as splitting the HVR-950 into its own entry
(since I don't know if it uses the MTS variant and it will have to be
split off eventually anyway).

Signed-off-by: Aidan Thornton <makosoft@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:16 -02:00
Joe Perches ac9bb7f516 V4L/DVB (6617): drivers/media/video: Add missing "space"
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:15 -02:00
Mauro Carvalho Chehab ef8c1888b3 V4L/DVB (6614): Fix driver for i386 architectures
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:15 -02:00
Mauro Carvalho Chehab 2d4c0ac60d V4L/DVB (6613): Fix: add a missing continue statement
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:14 -02:00
Michel Ludwig 5403bbae9b V4L/DVB (6612): Allow RESET_CLK callback and avoids unneeded loading
TM5600/TM6000 needs clock reset during firmware load. This patch adds the
capability of caling a callback method for this.

Also, avoids uneeded firmware loads.

Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:14 -02:00
Michel Ludwig a37b4c9bc8 V4L/DVB (6611): Change xc2028_attach method to make easier for DVB
Removes uneeded parameters and adds an structure for passing the parameters

This patch is co-authored by Mauro Carvalho Chehab.

Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:14 -02:00
Michel Ludwig 2fc580ffeb V4L/DVB (6610): Fix a wrong typecast
Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:13 -02:00
Michael Krufky 993efa7133 V4L/DVB (6607): saa7134: add support for reading Hauppauge eeprom
Increased size of dev->eedata from 128 to 256, since the Hauppauge data begins
at byte 128.  This has been tested on boards with smaller eeproms, and caused
no problems.

Added comments to distinguish between the various versions of the HVR1110.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:13 -02:00
Michael Krufky ddf12227c3 V4L/DVB (6606): saa7134: add autodetection support for alternate subids of Hauppauge HVR1110
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:12 -02:00
Mauro Carvalho Chehab a82200fb59 V4L/DVB (6605): Add a modprobe option to manually select audio standard
While there's no public API to define audio standard, adds a hack option for
select them. This is needed only for NICAM and A2 firmwares, since AM, BTSC and
EAIJ are already properly handled, on firmware version 2.7.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:12 -02:00
Brandon Philips 0fc0686e64 V4L/DVB (6600): V4L: videobuf: don't chew up namespace STATE_.*, convert to VIDEOBUF_
s/STATE_NEEDS_INIT/VIDEOBUF_NEEDS_INIT/g
s/STATE_PREPARED/VIDEOBUF_PREPARED/g
s/STATE_QUEUED/VIDEOBUF_QUEUED/g
s/STATE_ACTIVE/VIDEOBUF_ACTIVE/g
s/STATE_DONE/VIDEOBUF_DONE/g
s/STATE_ERROR/VIDEOBUF_ERROR/g
s/STATE_IDLE/VIDEOBUF_IDLE/g

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:11 -02:00
Mauro Carvalho Chehab 1414becf15 V4L/DVB (6598): Fix standard name
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:11 -02:00
Mauro Carvalho Chehab 83fb340b31 V4L/DVB (6595): Corrects printk lines
Make the driver less verbose by default. It adds a debug parameter to make the
driver more verbose.
Also, error messages were using KERN_ERR level, instead of KERN_INFO.
A few printk messages were reviewed to make them more clear.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:11 -02:00
Mauro Carvalho Chehab 98883cdcb5 V4L/DVB (6594): Add tuner_err macro
Some tuners, like xc3028, need to print error messages. Instead of declaring
local macros, create a tuner global macro for printing tuner errors.

To preserve CodingStyle on all tuner_macros, a few CodingStyle violations were
fixed at the other macros:
	- lines with more than 80 columns
	- two statements at the same line

The patch also removes the CodingStyle violation of having emacs declarations
inside de source code (CodingStyle chapter 18).

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:10 -02:00
Mauro Carvalho Chehab f380e1d2c9 V4L/DVB (6593): Fix scode table loading
Xceive 2028/3028 has a concept of scode/dcode.
Scode is a table of 16 values (each with 12 bytes i2c sequence).
Dcode is the entry of Scode table that should be used, given a certain
frequency.

The idea is that, depending on what frequency is selected, and according with a
country-based (or standard-based?) table, the Xceive should be "hacked" to
fine-tune that specific frequency.

By default, Scode=0 is used, for undefined frequencies. Also, Scode=0 seems to
be the most used value.

This patch adds the capability of selecting a scode. However, extra work will
be needed to allow auto-selecting the proper scode, for a given set of
frequencies.

I'm not sure what would be the proper way for implementing the dcode selection.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:10 -02:00
Mauro Carvalho Chehab 43efe70253 V4L/DVB (6592): Add the capability to work with more complete firmwares
Firmware version 2.7 has other firmware types. This patch adds the capability
for the driver to work with those newer types.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:10 -02:00
Luca Risolia ddef2dcc4e V4L/DVB (6591): Adds support for MT9V111 on sn9c102
Adds a new image sensor to the sn9c102 driver.

Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:09 -02:00
Mauro Carvalho Chehab 7d497f8afa V4L/DVB (6587): Cleanup at tv norm selection
With the conversion to the vidio_ioctl2, tvnorms array is not required anymore.

Also, removed some code from V4L1 time (VIDEO_MODE_foo), specied at the
non-used video_decoder.h.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:08 -02:00
Mauro Carvalho Chehab cb77d01022 V4L/DVB (6586): Remove some dead code and make drive fully V4L2 compatible
There were some vestiges of an old V4L1 I2C driver that were called by em28xx.
This patch removes this dead code, and replaces videodev.h to videodev2.h

Now, this driver doesn't require V4L1 anymore.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:07 -02:00
Mauro Carvalho Chehab 195a4ef627 V4L/DVB (6585): Convert em28xx to video_ioctl2
Uses the newer ioctl handler at videodev. This patch also cleans up some
bad logic at the driver and do CodingStyle and other cleanups at the
resulting driver.

Also, since VIDIOCMBUF were not working, the V4L1 compat code were removed.
The compat code will eventually be re-inserted, if we find a clean way for
implementing compatibility with the old API.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:07 -02:00
Mauro Carvalho Chehab 9e31ced888 V4L/DVB (6584): Fix read() method
Backport read() fixes from Markus Rechberger.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:07 -02:00
Mauro Carvalho Chehab a225452ef8 V4L/DVB (6583): Fix em28xx read stream locking
On some situations, closing an streaming application and re-opening were
returning -EBUSY.

Uses the same locking schema also present on cx88.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:06 -02:00
Mauro Carvalho Chehab a3a048cea3 V4L/DVB (6582): Fix em28xx to allow multiple open
Allows shared access support for em28xx. Just one userspace application is
allowed to get stream. The other(s) application(s) can change V4L2 controls,
set video standards, etc.

This patch were splited from Markus Rechberger's tree and backported to 2.6.17
by Pádraig Brady.

The original patch were ported to the latest em28xx version and had CodingStyle
corrected to solve the issues pointed by scripts/checkpatch.pl.

Thanks to Pádraig Brady <P@draigBrady.com> for pointing this.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:06 -02:00
Sakari Ailus 2c94a674e0 V4L/DVB (6580): Set slave's master before master's attach call.
V4L: Int if: Set slave's master before attach, remove master argument

The master also now gets its own pointer from slave's structure.

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:06 -02:00
Adrian Bunk f760d618ab V4L/DVB (6577): et61x251/: make 5 functions static
This patch makes the following needlessly global functions in
et61x251_core.c static:
- et61x251_read_reg()
- et61x251_i2c_try_read()
- et61x251_i2c_try_write()
- et61x251_i2c_read()
- et61x251_i2c_write()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:05 -02:00
Adrian Bunk a2fbaa519b V4L/DVB (6576): cx88-mpeg.c: make 4 functions static
This patch makes the following needlessly global functions static:
- cx8802_init_common()
- cx8802_fini_common()
- cx8802_suspend_common()
- cx8802_resume_common()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:05 -02:00
Adrian Bunk 39e75cfedf V4L/DVB (6575): cx23885/: cleanups
This patch contains the following cleanups:
- make the following needlessly global code static:
  - cx23885-core.c: struct cx23885_sram_channels[]
  - cx23885-core.c: struct cx23887_sram_channels[]
  - cx23885-core.c: cx23885_wakeup()
  - cx23885-core.c: cx23885_sram_channel_setup()
  - cx23885-core.c: cx23885_sram_channel_dump()
  - cx23885-core.c: cx23885_risc_disasm()
  - cx23885-core.c: cx23885_shutdown()
  - cx23885-core.c: cx23885_reset()
  - cx23885-core.c: cx23885_dev_unregister()
  - cx23885-core.c: cx23885_risc_databuffer()
  - cx23885-core.c: cx23885_risc_stopper()
- #if 0 the following unused functions:
  - cx23885-core.c: cx23885_risc_buffer()
  - cx23885-core.c: cx23885_cancel_buffers()
- remove the following unused EXPORT_SYMBOL's:
  - cx23885-cards.c: cx23885_boards
  - cx23885-i2c.c: cx23885_call_i2c_clients

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Reviewed-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:05 -02:00
Michael Krufky bbe1e0ba52 V4L/DVB (6563): tda8290: optimize for loop in tda829x_probe function
Thanks to Trent Piepho for pointing this out.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:02 -02:00
Mauro Carvalho Chehab 98ae127cae V4L/DVB (6562): Make HVR900 to use also tveeprom
Hauppauge firmwares can be decoded using tveeprom. This patch adds HVR-900 as
a tveeprom client. It also adds xc3028 tuner entry to tveeprom.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:02 -02:00
Mauro Carvalho Chehab 80b522085a V4L/DVB (6561): Fix xc2028 get register functions and calls
The status registers require a dword for setting register. Fix it on all
occurrences, and at xc3028_get_reg. Also, improves the hardware/firmware
detection printk.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:01 -02:00
Mauro Carvalho Chehab f8b6030ccc V4L/DVB (6560): Fix a bug when setting tuner type
Tuner-type were correctly filled only by the hint function.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:01 -02:00
Mauro Carvalho Chehab b873e1a3cc V4L/DVB (6559): Fix a buffer overflow at xc2028_get_reg
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:01 -02:00
Hans Verkuil e7a2bc8a75 V4L/DVB (6557): tea5767: remove unnecessary warning
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:00 -02:00
Hans Verkuil 9dd659de9f V4L/DVB (6556): tuner: convert to bus-based I2C API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:00 -02:00
Hans Verkuil 92de1f16d1 V4L/DVB (6555): tuner: reorder functions to prepare for i2c conversion
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:59 -02:00
Hans Verkuil 159ffe77cd V4L/DVB (6553): tuner: replace default_mode_mask
The default_mode_mask global is replaced by a list of tuner structs. The
tuner driver now walks that list to see which radio and/or tv tuner
devices are registered to a given i2c adapter.

The default_mode_mask global had to go since this is no longer supported
with the new bus-based I2C API.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:59 -02:00
Michael Krufky a818e1c8f7 V4L/DVB (6551): tda8290: rule out tda988x before detecting tda8290/tda8295
To ensure prevention of detecting a tda9885/6/7 as a tda8290 or tda8295, we
will rule out the tda988x before testing the tda8290 / tda8295 id registers.

We read 8 bytes from the chip.  If they are all equal, then it is not a
tda829x, or some other error has occurred.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:58 -02:00
Michael Krufky 1f3a4e3285 V4L/DVB (6550): tda8290: return -ENODEV on probe failures
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:58 -02:00
Mauro Carvalho Chehab 232fcefb55 V4L/DVB(6548b) Fix compilation for em28xx
From: Mauro Carvalho Chehab <mchehab@infradead.org>

In file included from drivers/media/video/em28xx/em28xx-i2c.c:31:
drivers/media/video/tuner-xc2028.h:10:26: error: dvb_frontend.h: No such file or directory

In file included from drivers/media/video/em28xx/em28xx-i2c.c:31:
drivers/media/video/tuner-xc2028.h:32: warning: 'struct dvb_frontend' declared inside parameter list
drivers/media/video/tuner-xc2028.h:32: warning: its scope is only this definition or declaration, which is probably not what you want

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:58 -02:00
Mauro Carvalho Chehab e3e97fe61f V4L/DVB(6548a) Fix compilation for TDA8290
From: Mauro Carvalho Chehab <mchehab@infradead.org>

drivers/media/video/tda8290.c:27:21: error: tda827x.h: No such file or directory
drivers/media/video/tda8290.c:28:22: error: tda18271.h: No such file or directory
drivers/media/video/tda8290.c:52: error: field 'cfg' has incomplete type
drivers/media/video/tda8290.c: In function 'tda829x_find_tuner':
drivers/media/video/tda8290.c:590: error: implicit declaration of function 'tda18271_attach'
drivers/media/video/tda8290.c:598: error: implicit declaration of function 'tda827x_attach'

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:57 -02:00
Mauro Carvalho Chehab d2ba055d3b V4L/DVB (6546): Add comments for the hint methods
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:57 -02:00
Sascha Sommer fad7b958e7 V4L/DVB (6545): em28xx: autodetect Cinergy 200 USB and VGear PocketTV
Adds autodetection support for the Cinergy200 USB and the VGear PocketTV.

Whenever a usb device with generic empia em2800 usb ids is detected the device
gets scanned for connected i2c devices. If the device list matches an em2800
device in the device list the model id gets changed accordingly.

Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:56 -02:00
Michael Krufky f1f32849d6 V4L/DVB (6543): tda8290: enable probing of tda8295
Prevent the tda8295 from falsely being detected as a tda9887

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:56 -02:00
Sascha Sommer 4362559d82 V4L/DVB (6539): em28xx: add support for vgear pockettv
attached patch adds support for the vgear pockettv.
It seems to require a write to another register for audio to work.
I checked my old cinergydrv and we did the same register write there. I
therefore enabled it for all em2800 based devices.

Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:56 -02:00
Sascha Sommer 5a80415bca V4L/DVB (6538): em28xx: fix locking to allow accesses from 2 different threads at the same time
The attached patch modifies the em28xx driver so that there can be ioctls from
multiple different threads.

This is necessary for capture apps like MPlayer that use different threads for
capturing and channel tuning.

Now the locking is only done for the ioctls that change properties of the
device or access the i2c bus.

It also removes some locks that look unnecessary:

In em28xx_init_dev:
  the videodevice is not registered yet so nothing can access the hardware
 meanwhile, the device struct is not assigned to the interface yet so no race
 with disconnect is possible

In em28xx_release_resources:
  it gets only called when dev->lock is already held

Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:55 -02:00
Mauro Carvalho Chehab ea4fd5679b V4L/DVB (6537): Add entry for Pixelview Prolink PlayTV USB 2.0
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:55 -02:00
Mauro Carvalho Chehab 03910cc390 V4L/DVB (6536): Add a hint for boards without unique USB ID
This patch adds a function to allow trying to detect boards that shares
the generic IDs.

The current detection method is based at eeprom checksum.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:55 -02:00
Mauro Carvalho Chehab 3dbd85ba36 V4L/DVB (6535): Fix: Adds the generic PCI IDs for em28xx
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:54 -02:00
Mauro Carvalho Chehab 7d070e26a8 V4L/DVB (6519): Fix HVR900/HVR950 entry
- Television is now default;
- Add HVR950 name at the entry.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:54 -02:00
Mauro Carvalho Chehab ab0b9fc67c V4L/DVB (6517): CodingStyle fixup
Used scripts/Lindent + manual check + scripts/checkpatch.pl

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:54 -02:00
Mauro Carvalho Chehab 352fae1dff V4L/DVB (6516): Allow faster loading by using 64 bytes block by em28xx i2c write
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:53 -02:00
Trent Piepho 00405f8f11 V4L/DVB (6507): bttv: whitespace cleanup
Someone wasn't using the v4l-dvb commit scripts and so didn't run the
automatic whitespace cleaner on their code.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:53 -02:00
Michael Krufky 241020d19e V4L/DVB (6492): tuner: improve tuner_foo printk macros consistency
Alter the tuner_foo printk macros to indicate which module is
generating the message.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:51 -02:00
Michael Krufky 4942744f93 V4L/DVB (6491): tuner: prevent repeated "type set" message unless debug is enabled
The tuner sub-module will usually log its type during its _attach() function,
then tuner-core reports which type was attached when control is returned.

In most cases, we expect to see the same message reported from both locations.
We only need to see this second message if debug is enabled.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:51 -02:00
Hans Verkuil 7a06f3f2aa V4L/DVB (6490): Remove EXPERIMENTAL from several i2c drivers
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:51 -02:00
Hans Verkuil fdef464a7f V4L/DVB (6489): ivtv: add support for AVerMedia PVR-150 Plus
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:50 -02:00
Hans Verkuil e2a1774d9c V4L/DVB (6488): ivtv: add ASUS Falcon2 support
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:50 -02:00
Hans Verkuil 761dacd25d V4L/DVB (6486): m52790: add new Mitsubishi A/V switch i2c driver
This driver is used by the ASUS Falcon2 cx23416-based cards.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:46 -02:00
Douglas Schilling Landgraf 4be2f47054 V4L/DVB (6483): ivtv-streams: make file_operations const
Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:44 -02:00
Douglas Schilling Landgraf bdd36658fe V4L/DVB (6482): zr364: make file_operations const
zr364: make file_operations const

Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:44 -02:00
Randy Dunlap 073ad9a00c V4L/DVB (6480): bttv: uses input functions, should depend on INPUT
Several media drivers use input_(*) functions so they need to depend on
the INPUT config symbol.

drivers/built-in.o: In function `bttv_input_fini':
linux-2.6.24-rc1-git4/drivers/media/video/bt8xx/bttv-input.c:346: undefined reference to `input_unregister_device'
drivers/built-in.o: In function `bttv_input_init':
linux-2.6.24-rc1-git4/drivers/media/video/bt8xx/bttv-input.c:204: undefined reference to `input_allocate_device'
linux-2.6.24-rc1-git4/drivers/media/video/bt8xx/bttv-input.c:335: undefined reference to `input_free_device'
linux-2.6.24-rc1-git4/drivers/media/video/bt8xx/bttv-input.c:321: undefined reference to `input_register_device'
linux-2.6.24-rc1-git4/drivers/media/video/bt8xx/bttv-input.c:335: undefined reference to `input_free_device'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:41 -02:00
Mauro Carvalho Chehab 983d214e08 V4L/DVB (6477): Properly fill MODULE_AUTHOR
Most of the driver were written by Mauro Carvalho Chehab.
DTV parts were added by Michel Ludwig.

Reviewed-by: Michel Ludwig <michel.ludwig@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:37 -02:00
Mauro Carvalho Chehab 6c362c8e58 V4L/DVB (6476): Add support for analog tv on HVR-950
This patch adds USB ID for HVR-950. It also adds the callback for handling
firmware loading.

Thanks to Markus Reichberger for the reset commands.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:36 -02:00
Mauro Carvalho Chehab 1808a698a8 V4L/DVB (6475): Fix some troubles at list handling
- priv->count were wrong. Should be incremented since the first usage;
- forgot to use list_del() to remove the driver;
- Release memory if an error occurs during _attach

Thanks to Aidan Thornton <makosoft@googlemail.com> for pointing this.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:35 -02:00
Mauro Carvalho Chehab 882876bf97 V4L/DVB (6474): Add support for tuner-xc2028
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:34 -02:00
Mauro Carvalho Chehab 48aa336a84 V4L/DVB (6473): Prevents double tuner registering
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:33 -02:00
Mauro Carvalho Chehab 690c544cf8 V4L/DVB (6472): Re-inserts xc2028 attach code, fixing its parameters
I2C bus redesign changed i2c parameters. This patch re-adds tuner xc2028
attach function, replacing the parameters to the newer syntax.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:32 -02:00
Hans Verkuil 1cba97d71d V4L/DVB (6471): tuner: i2c_client cannot be part of the tuner struct
The bus-based I2C subsystem allocates the i2c_client struct. So if in order to
be able to convert the tuner to the bus-based I2C API the embedded i2c_client
struct must be removed from the tuner struct and replaced with a pointer.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:32 -02:00
Mauro Carvalho Chehab 1a156045ab V4L/DVB (6470): Avoid breaking compilation
The next patchset series will change i2c structs inside tuner. This patch
avoids breaking bissect, by commenting the still unused tuner xc2028.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:31 -02:00
Michael Krufky 0b5f4a12e6 V4L/DVB (6469): tuner: remove TUNER_PHILIPS_TDA8295
TUNER_PHILIPS_TDA8290 will autodetect a TDA8290 or a TDA8295,
so we don't need this separate entry anymore.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:30 -02:00
Michael Krufky 8c125f2ceb V4L/DVB (6468): tda8290: auto-detect tda8290 or tda8295
Consolidate tda8290_attach() and tda8295_attach() into a single function,
tda829x_attach(), which will detect chip combinations tda8290 or tda8295 with
tda8275, tda8275a or tda18271.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:30 -02:00
Hans Verkuil 393bf55732 V4L/DVB (6467): v4l2-common: minor cleanups
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:29 -02:00
Hans Verkuil 188f3457c2 V4L/DVB (6465): Use correct error codes when chip is not recognized
If the chip isn't recognized, then the correct errors should be returned.
The v4l2_i2c_attach() utility function will return 0 for all errors
except -ENOMEM to provide proper compatibility support for the old I2C
probing function.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:27 -02:00
Hans Verkuil 6235168db8 V4L/DVB (6464): tlv320aic23b: convert to bus-based I2C API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:27 -02:00
Hans Verkuil 2b14e03146 V4L/DVB (6463): upd64031a: convert to bus-based I2C API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:26 -02:00
Hans Verkuil 266669776c V4L/DVB (6462): upd64083: convert to bus-based I2C API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:25 -02:00
Hans Verkuil 08e1405440 V4L/DVB (6461): tvaudio: convert to bus-based I2C API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:24 -02:00
Hans Verkuil 1a39275a3f V4L/DVB (6459): cx25840: convert to bus-based I2C API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:22 -02:00
Hans Verkuil e8e6b99184 V4L/DVB (6458): cs53l23a: convert to bus-based I2C API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:21 -02:00
Hans Verkuil 79518dafd5 V4L/DVB (6457): msp3400: convert to bus-based I2C API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:21 -02:00
Hans Verkuil 77566dd724 V4L/DVB (6456): saa7127: convert to bus-based I2C API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:20 -02:00
Hans Verkuil fbaa3d0db4 V4L/DVB (6455): saa7115: convert to bus-based I2C API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:20 -02:00
Hans Verkuil 45eea27624 V4L/DVB (6454): vp27smpx: convert to bus-based I2C API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:19 -02:00
Hans Verkuil 49457cc279 V4L/DVB (6453): wm8739: convert to bus-based I2C API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:19 -02:00
Hans Verkuil d9a53aa902 V4L/DVB (6452): wm8775: convert to bus-based I2C API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:18 -02:00
Hans Verkuil 8ffbc65594 V4L/DVB (6451): v4l2: add support for bus-based I2C drivers
Two new headers were added: one for I2C drivers that are only used
by V4L2 drivers converted to the new bus-based I2C API, and one that
can be used by both converted and unconverted drivers (at the expense of
some additional overhead).

To support the legacy I2C API a helper function was added to v4l2-common.c.

These headers take care of all the 'boilerplate' code that all V4L2 I2C drivers
have in common and will automatically support the bus-based I2C API introduced
in kernel 2.6.22.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:16 -02:00
Michael Krufky 5ef4730d1b V4L/DVB (6450): tda9887: add missing module license
This module was always GPL, and will remain GPL

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:15 -02:00
Michael Krufky a72dd305f9 V4L/DVB (6448): tda8290: fill i2c_gate_ctrl callback
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:14 -02:00
Michael Krufky 2be1b48fd2 V4L/DVB (6447): tuner: add i2c_gate_ctrl function to struct analog_tuner_ops
In some designs, the tuner silicon may be on an i2c bus behind an i2c gate,
controlled by the analog demodulator.  We already have a method to control
such i2c gates when they are controlled by the digital demodulator, but in
some hybrid designs, there may be an i2c gate controlled by each demodulator.

For example, when in analog tuning mode, one would access the tuner by opening
the i2c gate controlled by the analog demodulator, while when in digital
tuning mode, one would access the tuner by opening the i2c gate controlled by
the digital demodulator.

We must add this callback function to analog_tuner_ops in order to handle
such configurations.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:13 -02:00
Michael Krufky 4524c1aba5 V4L/DVB (6445): tuner-core: improve comments inside function fe_release()
Explain who is responsible for freeing analog_demod_priv

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:11 -02:00
Michael Krufky af3b0f3f01 V4L/DVB (6444): tuner-core: remove excessive parenthesis
Convert all instances of "if ((ops) && (ops->foo))" to "if (ops && ops->foo)"

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:10 -02:00
Michael Krufky 31c9584c0b V4L/DVB (6443): make tda9887 build selectable via Kconfig
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:10 -02:00
Michael Krufky 5c82f4497b V4L/DVB (6442): move std if setting from tda8290 to tda827x
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:10 -02:00
Michael Krufky 1b29cedab9 V4L/DVB (6441): tuner: clean up ops checking in tuner_status function
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:10 -02:00
Michael Krufky 4e9154b8a7 V4L/DVB (6440): tuner: convert analog tuner demod sub-modules to dvb_frontend interface
Convert tda9887 and tda8290/5 to dvb_frontend interface

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:09 -02:00
Michael Krufky 16f291684c V4L/DVB (6438): tuner: move analog_demod_priv into struct dvb_frontend
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:08 -02:00
Michael Krufky e2be32ac80 V4L/DVB (6437): tuner: clear analog_demod_ops on release
Clear analog_demod_ops on release.
Fix test for analog_demod_ops after tuner attach.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:08 -02:00
Michael Krufky 1dde7a4fa2 V4L/DVB (6436): tuner: move analog_tuner_ops into dvb_frontend_ops
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:07 -02:00
Michael Krufky 5bea1cd387 V4L/DVB (6435): tda8290: add support for NXP TDA18271 tuner and TDA8295 analog demod
Add basic support for NXP TDA8295 analog demod and TDA18271 tuner silicon.

TDA8295 + TDA8275a not yet tested.
TDA8290 + TDA18271 not yet supported.

Digital mode of TDA18271 not yet tested & needs more work.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:06 -02:00
Michael Krufky 746d9732db V4L/DVB (6433): Move all tda8275/8275a tuning code from tda8290 module into tda827x module
Add analog tuning support to tda827x dvb_frontend tuner module.

Convert tda8290 module back to native tuner interface.

The tda8290 analog demodulator will be handled the same way as tda9887.
The tuner.ko module (tuner-core) will pass commands to tda8290 via the
tuner_operations interface.  tda8290 will communicate with tda827x via
the dvb_frontend interface, while passing a pointer to a private data
structure.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:05 -02:00
Mauro Carvalho Chehab de3fe21ba2 V4L/DVB (6431): Improve firmware format
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:05 -02:00
Mauro Carvalho Chehab 215b95baf9 V4L/DVB (6430): Convert tuner-xc2028 driver to the newer hybrid approach
This changeset converts tuner-xc2028 to the newer hybrid approach. It also
prevents creating twice the xc3028 private struct by both DVB and V4L parts.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:05 -02:00
Mauro Carvalho Chehab 3b20532c79 V4L/DVB (6429): Avoid having two tuner commands happening at the same time
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:04 -02:00
Michel Ludwig ff7326d4f0 V4L/DVB (6428): Make the naming of the DTV firmware files more consistent
Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:04 -02:00
Mauro Carvalho Chehab d4e7668104 V4L/DVB (6427): Some cleanups at tuner-xc2028 driver
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:04 -02:00
Mauro Carvalho Chehab 2e4160ca80 V4L/DVB (6426): Some fixes on tuner-xc2028
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:04 -02:00
Michel Ludwig 701672eb73 V4L/DVB (6425): Add experimental DVB frontend tuner interface to xc2028/3028
Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:03 -02:00
Michel Ludwig c2622e5f8e V4L/DVB (6424): Improve tuner-xc2028 script
Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:03 -02:00
Mauro Carvalho Chehab 6cb45879dc V4L/DVB (6423): Add tuner-xc2028 driver
Add support for Xceive XC2028/XC3028 tuner driver

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:02 -02:00
Mauro Carvalho Chehab 1246657785 V4L/DVB (6422): Add the pending entries for xc2028/3028 based boards
Also replaces all occurrences of TUNER_XCEIVE_XC3028 to TUNER_XC2028.

Some work is still may be required to make sure that non-tm6000 drivers will
be capable of using tuner-xc2028.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:01 -02:00
Mauro Carvalho Chehab 07533b6a80 V4L/DVB (6421): Make Kconfig reflect the changes at audio helper modules
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:01 -02:00
Mauro Carvalho Chehab 5eba35714e V4L/DVB (6420): V4L2 conversion for tda9875 from V4L1 API
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:00 -02:00
Mauro Carvalho Chehab 7a00d45cf0 V4L/DVB (6419): V4L2 port of tda7432 from V4L1 api
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:00 -02:00
Mauro Carvalho Chehab dc3d75da05 V4L/DVB (6418): Converted tvaudio from V4L1 to V4L2
V4L1 ioctls were replaced to V4L2 were applicable. The older ones
already implemented were removed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:00 -02:00
Nickolay V. Shmyrev 155c6ab9ed V4L/DVB (6417): Report detected sound carrier into rxsubchans
Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:59 -02:00
Nickolay V. Shmyrev 4b9b936f27 V4L/DVB (6416): Split hooks on volume and audio mode and rework their handling
Also convert audio_mode_gpio functions from audio_hook

Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:59 -02:00
Nickolay V. Shmyrev 40c6e683a2 V4L/DVB (6415): Restructurize volume hook and drop unused mute hook
Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:59 -02:00
Nickolay V. Shmyrev de5bec6bb5 V4L/DVB (6414): Remove bass, treble and balance from audio hook since they are unused
Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:59 -02:00
Nickolay V. Shmyrev 5b261016f0 V4L/DVB (6413): Forward VIDIOCGAUDIO and VIDIOCSAUDIO through v4l1-compat
Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:58 -02:00
Mauro Carvalho Chehab c2806d03c0 V4L/DVB (6412): Audio hooks moved to another file
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:58 -02:00
Mauro Carvalho Chehab c96dd07106 V4L/DVB (6411): remove V4L1 from being compiled when V4L2 only is selected
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:57 -02:00
Nickolay V. Shmyrev e84619b174 V4L/DVB (6410): Partial conversion from V4L1 to V4L2
This is part of the old V4L1->V4L2 bttv patch, ported to current tree
by Mauro Carvalho Chehab <mchehab@infradead.org>

Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:57 -02:00
Nickolay V. Shmyrev 302f61ad5d V4L/DVB (6409): Cleanup: removed i2c_vidiocschan
This is part of the old V4L1->V4L2 bttv patch, ported to current tree
by Mauro Carvalho Chehab <mchehab@infradead.org>

Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:56 -02:00
Nickolay V. Shmyrev 012cf21975 V4L/DVB (6408): Cleanup: Removed obsoleted code from bttv-cards
This is part of the old V4L1->V4L2 bttv patch, ported to current tree
by Mauro Carvalho Chehab <mchehab@infradead.org>

Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:56 -02:00
Steven Toth e92adc2c39 V4L/DVB (6404): cx23885: i2c 16bit reg/val read/write fix
Fix i2c reads and writes of 16bit register address / values

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>
2008-01-25 19:00:56 -02:00
Matthias Kaehlcke 289d4d2f07 V4L/DVB (6400): usbvision: Convert the usbvision->lock semaphore to the mutex API
Convert the usbvision->lock semaphore to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Reviewed-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:55 -02:00
Adrian Bunk b02044d81f V4L/DVB (6399): saa7134/: make 2 functions static
saa7134_buffer_requeue() and set_tvnorm() can become static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:55 -02:00
Mauro Carvalho Chehab 55c88610fe V4L/DVB (6386): Add support for radio on CX88_BOARD_MSI_TVANYWHERE_MASTER
This board has some special tea5767 configuration. Basically, radio 
XTAL uses a different frequency than the other supported radios. It 
uses a 13 MHz XTAL.

This patch adds the proper radio gpio and tea5767 configurations for 
the board.

Also, with PAL/BG, the board requires some special init for tda9887:
port1=0 port2=0 qss=1

Thanks to Serge Kolotylo and MIDImaster for their help on identifying 
the proper needs for this driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:55 -02:00
Mauro Carvalho Chehab 0e1165e8d0 V4L/DVB (6385): Adds the capability of configuring tea5767 support
tea5767 has several possible configurations. Before the patch, the
driver were assuming the more common configuration. However, some newer
cards, like MSI @nyware Master requires other configurations, like
de-activating a gpio port and changing chip Xtal.

This patch adds the capability of altering device configuration at
runtime. This may also be used later to activate some features like
auto-mute when signal is weak.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:54 -02:00
Mauro Carvalho Chehab 7f1711234e V4L/DVB (6384): Replace TDA9887_SET_CONFIG by TUNER_SET_CONFIG
Currently, the only tuner-specific device that allows special
configurations is tda9887. However, tea5767 also may require some
special configurations (for example, to specify a different Xtal freq).

This patch replaces TDA9887_SET_CONFIG by a more generic internal ioctl
(TUNER_SET_CONFIG). The newer one allows specifying what tuner is
appliable to a configuration set, and allows an arbitrary configuration
struct.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:54 -02:00
Dmitry Torokhov a512a8cc20 V4L/DVB: Don't access input_dev->private directly
Drivers should use input_{get|set}_drvdata() instead of accessing
input_dev->provate directly, but since these drivers do not actually
use the data stored there we can simply remove the assignments.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-21 01:11:07 -05:00
Daniel Walker a3c53e2310 fix wrong sized spinlock flags argument
Correct wrong sized spinlock flags, form int to unsigned long.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-01-17 15:42:30 -08:00
Hans Verkuil 745a4c9f0b V4L/DVB (6999): ivtv: stick to udelay=10 after all
Using an udelay of 5 seems to result in problems for several people.
For now abandon the udelay value of 5 and stick to 10, even though this
will mean a longer load time of the cx2584x firmware.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-11 15:02:23 -02:00
Hans Verkuil 89dab3573a V4L/DVB (6916): ivtv: udelay has to be changed *after* the eeprom was read, not before
The eeprom decides which Hauppauge model it is, so the decision whether to
use an udelay of 5 or 10 needs to be taken after reading the eeprom, not
before.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-07 06:46:26 -02:00
Gregor Jasny d9030f5730 V4L/DVB (6944a): Fix Regression VIDIOCGMBUF ioctl hangs on bttv driver
Fix bttv VIDIOCGMBUF locking like done in commit
820eacd84c. 

Signed-off-by: Gregor Jasny <gjasny@web.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-07 06:12:57 -02:00
Hans Verkuil c3c4c83933 V4L/DVB (6876): ivtv: mspx4xx needs a longer i2c udelay
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-24 08:07:36 -02:00
Michael Krufky 867fee9b25 V4L/DVB (6871): Kconfig: VIDEO_CX23885 must select DVB_LGDT330X
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-24 08:07:36 -02:00
Andrew Morton 4b5ae10c81 V4L/DVB (6819): i2c: fix drivers/media/video/bt866.c
usage_count got removed.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-13 17:58:05 -02:00
Michael Krufky b3aa2269bd V4L/DVB (6798): saa7134: enable LNA in analog mode for Hauppauge WinTV HVR-1110
Thanks to Hermann Pitton for noticing that this was missing.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Cc: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-13 17:44:46 -02:00
Adrian Bunk 3f84307a10 V4L/DVB (6803): buf-core.c locking fixes
After commit 19fb145799 the callers in
videobuf-core.c that already hold the lock must call
__videobuf_read_start() instead of videobuf_read_start().

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-13 00:15:25 -02:00
Mauro Carvalho Chehab 19fb145799 V4L/DVB (6609): Re-adds lock safe videobuf_read_start
videobuf_dvb needs videobuf_read_start. The EXPORT_SYMBOL_GPL() were removed by
a previous patch. However, videobuf_dvb needs this.

This patch re-adds videobuf_read_start, doing the proper lock.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-12 08:21:37 -02:00
Adrian Bunk 7d44e89218 V4L/DVB (6797): bt8xx/ section fixes
This patch fixes the following section mismatch with CONFIG_HOTPLUG=n:

<--  snip  -->

...
...

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 22:22:58 -02:00
Adrian Bunk 056827a49c V4L/DVB (6796): ivtv/ section fix
This patch fixes the following section mismatch with CONFIG_HOTPLUG=n:

<--  snip  -->

...
...

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 22:22:52 -02:00
Benoit Istin bc5483705c V4L/DVB (6746): saa7134-dvb: fix tuning for WinTV HVR-1110
There are several months my hvr1110 stop working.
This is very simple to fix, for my card revision at least, by setting a
missing field to the hauppauge_hvr_1110_config.

Signed-off-by: Benoit Istin <beistin@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:23 -02:00
Brandon Philips 0b29669c06 V4L/DVB (6751): V4L: Memory leak! Fix count in videobuf-vmalloc mmap
This is pretty serious bug.  map->count is never initialized after the
call to kmalloc making the count start at some random trash value.  The
end result is leaking videobufs.

Also, fix up the debug statements to print unsigned values.

Pushed to http://ifup.org/hg/v4l-dvb too

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:22 -02:00
Heikki Lindholm 843b1378c2 V4L/DVB (6690): saa7134: fix ignored interrupts
The saa7134 video driver starts dropping frames when used together with the
saa7134-alsa driver. Frames are dropped because when an audio event is waiting
the driver simply ignores the interrupt and passes it on to the saa7134-alsa
interrupt handler. The alsa interrupt handler in turn acknowledges all types
of events thus clearing the pending video events as well. Fix by only masking
out the audio event in the video interrupt handler and by only acknowledging
the audio event in the alsa driver.

Signed-off-by: Heikki Lindholm  <holindho@cs.helsinki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:18 -02:00
Hermann Pitton 4aa504a89a V4L/DVB (6686): saa7134: fix composite over s-video input on the Tevion MD 9717
The vmux for composite over s-video input was wrong.

Signed-off-by: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:17 -02:00
Richard Knutsson b730a81c51 V4L/DVB (6684): Complement va_start() with va_end() + style fixes
Complement va_start() with va_end() + minor style fixes in the same function.

Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:16 -02:00
Heikki Lindholm 174eb8e8cb V4L/DVB (6666): saa7134-alsa: fix period handling
The period handling in saa7134-alsa is broken in two ways. First, the
minimum number of periods of two does not work, because the dma is setup
two periods ahead in the irq handler. Fix the minimum to four periods.
Second, the code assumes that the number of periods is divisible by two,
which isn't always the case on ALSA. Fix by adding a constraint.

Signed-off-by: Heikki Lindholm  <holindho@cs.helsinki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:14 -02:00
Brandon Philips 053fcb6014 V4L/DVB (6602): V4L: Convert videobuf drivers to videobuf_stop
Drivers were using cookie cutter code for stopping the read/stream.  Use the
new videobuf_stop function which is lock safe.

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:09 -02:00
Brandon Philips 19bc5133da V4L/DVB (6601): V4L: videobuf-core locking fixes and comments
- Add comments to functions that require that caller hold q->lock
- Add __videobuf_mmap_free that doesn't hold q->lock for use within videobuf
- Add locking to videobuf_mmap_free
- Fix linux/drivers/media/common/saa7146_video.c which was holding lock around
  videobuf_read_stop
- Add locking to functions that operate on a queue
- Add videobuf_stop to take care of stopping in both the read and stream case

TODO: bttv still has an unsafe call to videobuf_queue_is_busy

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:08 -02:00
Mauro Carvalho Chehab 63337dd3f5 V4L/DVB (6581): Fix: avoids negative vma usage count
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:07 -02:00
Mauro Carvalho Chehab f4b8b3ae13 V4L/DVB (6542): Fix S-video mode on tvp5150
Thanks to Markus Reichberger to point this.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:03 -02:00
Sascha Sommer 2b2c93ac99 V4L/DVB (6540): em28xx: fix failing autodetection after the reboot
The attached patch is required so that the autodetecion code also works after
a reboot.

Setting the I2C speed does not seem to be supported for em2800.

Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:02 -02:00
Hans Verkuil 8a75601035 V4L/DVB (6485): ivtv: fix compile warning
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:01 -02:00
Mike Isely 4f663bdc65 V4L/DVB (6548): pvrusb2: Fix oops on module removal
The pvrusb2 driver is tearing down its sysfs related pieces in the
incorrect order.  This leaves dangling pointers which causes the
kernel device core to oops.  The problem has been present virtually
forever but became malignant with the changeover to the way of
handling /sys/class.  Fix is just to make sure we don't tear down the
class structure until AFTER the driver instances are deregistered.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:30 -02:00
Brandon Philips ac72fed79f V4L/DVB (6547): V4L: remove PCI from VIDEO_VIVI depends
vivi.c is a virtual driver that builds without PCI and should run on
non-pci hardware.

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:30 -02:00
Mauro Carvalho Chehab fe51f819bc V4L/DVB (6532): Add the remaining addresses for tda9887
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:29 -02:00
Ludovico Cavedon 8c6da5c41e V4L/DVB (6531): Fix a regression caused by commit 153962364d
From: Ludovico Cavedon <cavedon@sssup.it>

Signed-off-by: Ludovico Cavedon <cavedon@sssup.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:29 -02:00
Mauro Carvalho Chehab 032c2028ac V4L/DVB (6518): Fix tvp5150 default values
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:29 -02:00
Trent Piepho 6d35c8f648 V4L/DVB (6514): em28xx: Include linux/mm.h
This em28xx-video.c uses functions from this header, but doesn't include it.
It depends on some v4l headers included two levels down including poll.h,
which includes mm.h.

These v4l headers might change, so it's best to include the headers needed
directly.

It also causes problems for the out of core build system's backward
compatibility with older kernels, which is the real reason I bothered to
create a patch for something that would otherwise be so minor that it would
hardly be worth the trouble.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:28 -02:00
Alexander E. Patrakov 32d111a9f0 V4L/DVB (6506): saa7134-alsa: Fix mmap support
Trent Piepho wrote:
> I do not think the saa7134-alsa driver supports mmap.  The cx88-alsa driver
> also claimed to support mmap, but it never worked until I fixed it.  It's
> pretty clear that the code in saa7134-alsa was based on the same code as
> cx88-alsa, so it's likely it has the same bug.

You are right. The patch below (based on your cx88 patch, but I don't
really understand it) fixes mmap support in saa7134-alsa for me.
Recording via mmap (arecord -M -f S16_LE -c 2 -r 32000 -D hw:1) didn't
work at all before, works now, tested for at least 20 minutes (but,
unfortunately, with one overrun at least 0.719 ms long).

Signed-off-by: Alexander E. Patrakov <patrakov@ums.usu.ru>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:26 -02:00
Mike Isely f21daa41d1 V4L/DVB (6504): pvrusb2: Remove dead sysfs code
The pvrusb2 driver's sysfs implementation had long since implemented a
dummy hotplug function because at the time the kernel would oops
without at least the empty function being present.  Today - after
numerous class interface changes in the kernel - this pvrusb2 change
had been dutifully carried forward but an inspection of the kernel
sources shows that it is no longer needed.  So remove the dummy
function and its reference.  This also solves a recurring backwards
compatibility issue in the pvrusb2 driver as the class interface has
been getting thrashed in the kernel.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:26 -02:00
Roel Kluin 4ed53a5af7 V4L/DVB (6503): pvrusb2: Fix associativity logic error
if(!x & y) should either be if(!(x & y)) or if(!x && y)
    I made changes as seemed appropriate, but please review
    this is against current git.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:25 -02:00
Randy Dunlap cb20630cef V4L/DVB (6479): use input functions, should depend on INPUT
All of these drivers select VIDEO_IR, which uses the input subsystem,
so they should also depend on INPUT.

Problem examples:

drivers/built-in.o: In function `ir_input_key_event':
ir-functions.c:(.text+0x10849a): undefined reference to `input_event'
ir-functions.c:(.text+0x1084ac): undefined reference to `input_event'
drivers/built-in.o: In function `saa7134_set_i2c_ir':
(.text+0x11cc0a): undefined reference to `get_key_pinnacle_color'
drivers/built-in.o: In function `saa7134_set_i2c_ir':
(.text+0x11cc4f): undefined reference to `get_key_pinnacle_grey'
drivers/built-in.o: In function `saa7134_input_fini':
(.text+0x11cd8b): undefined reference to `input_unregister_device'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11d1fa): undefined reference to `input_allocate_device'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11d317): undefined reference to `input_register_device'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11d6ca): undefined reference to `input_free_device'

drivers/built-in.o: In function `saa7134_set_i2c_ir':
(.text+0x11c3f3): undefined reference to `ir_codes_hauppauge_new'
drivers/built-in.o: In function `saa7134_set_i2c_ir':
(.text+0x11c450): undefined reference to `ir_codes_pinnacle_color'
drivers/built-in.o: In function `saa7134_set_i2c_ir':
(.text+0x11c480): undefined reference to `ir_codes_purpletv'
drivers/built-in.o: In function `saa7134_set_i2c_ir':
(.text+0x11c495): undefined reference to `ir_codes_pinnacle_grey'
drivers/built-in.o: In function `saa7134_ir_start':
(.text+0x11c622): undefined reference to `ir_rc5_timer_end'
drivers/built-in.o: In function `saa7134_ir_start':
(.text+0x11c637): undefined reference to `ir_rc5_timer_keyup'
drivers/built-in.o: In function `build_key':
saa7134-input.c:(.text+0x11c769): undefined reference to `ir_extract_bits'
saa7134-input.c:(.text+0x11c7ad): undefined reference to `ir_input_keydown'
saa7134-input.c:(.text+0x11c7f0): undefined reference to `ir_input_keydown'
saa7134-input.c:(.text+0x11c7f9): undefined reference to `ir_input_nokey'
saa7134-input.c:(.text+0x11c806): undefined reference to `ir_input_nokey'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11ca07): undefined reference to `ir_codes_encore_enltv'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11caf6): undefined reference to `ir_input_init'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cbf2): undefined reference to `ir_codes_avermedia'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cc24): undefined reference to `ir_codes_pctv_sedna'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cc53): undefined reference to `ir_codes_flydvb'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cc85): undefined reference to `ir_codes_videomate_tv_pvr'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11ccb7): undefined reference to `ir_codes_pixelview'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cce9): undefined reference to `ir_codes_eztv'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cd1b): undefined reference to `ir_codes_manli'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cda8): undefined reference to `ir_codes_cinergy'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cdd7): undefined reference to `ir_codes_flyvideo'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11ce06): undefined reference to `ir_codes_asus_pc39'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11ce7d): undefined reference to `ir_codes_gotview7135'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cee1): undefined reference to `ir_codes_proteus_2309'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:23 -02:00
Adrian Bunk 04d934ff84 V4L/DVB (6432): tuner: fix CONFIG_TUNER_TEA5761=m
This patch fixes CONFIG_TUNER_TEA5761=m broken by
commit ca805d57cf.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:21 -02:00
Jeff Garzik 52c28d4b0a V4L/DVB (6407): planb: fix obvious interrupt handling bugs
irq handlers have returned a return value for years now... catch up with
the times.

Also, ditch unneeded prototype.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:20 -02:00
hermann pitton 387a299bdd V4L/DVB (6406): saa7134: fix analog audio in on medion md8800 quadro
saa7134: fix analog audio in on medion md8800 quadro, aka CTX944

Signed-off-by: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:20 -02:00
Jonathan Corbet bb8d56a4d8 V4L/DVB (6395): cafe_ccic: Add a pointer to the data sheet
Add a pointer to the (recently posted) Cafe data sheet.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:18 -02:00
Jonathan Corbet c303449741 V4L/DVB (6394): Fix a cafe_ccic resume bug
If the system is suspended while the camera is streaming, it will not
continue streaming on resume.  Save the state properly so that resume
works.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:18 -02:00
Trent Piepho a8ab68bffe V4L/DVB (6392): bttv: Update initial image size when set via V4L1 VIDIOCMCAPTURE
The V4L1 spec says that the image size should be with with VIDIOCSWIN before
requesting buffers with VIDIOCGMBUF and capturing into them with
VIDIOCMCAPTURE.

But it seems that many apps don't do this.  They set the size using the fields
in the VIDIOCMCAPTURE ioctl.  The driver doesn't know what size to capture
until it actually starts to capture.  In particular, it doesn't know what size
to capture until it has already mmap the captured buffers.  Which is quite
stupid.  Why V4L1 has size and format fields for VIDIOCMCAPTURE I have no idea.

Many drivers don't support this, including those using v4l1-compat.

The bttv does, which is probably the only reason such broken software is so
prevalent.

But, the driver doesn't adjust its idea of what size is being captured when it
is set this way.  If you try to query the driver's current setting with
v4l2-ctl, it won't be correct.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:16 -02:00
Trent Piepho 35378434e7 V4L/DVB (6391): bttv: SPICT ioctl doesn't work with vlc
The bttv driver instists that the depth specified in the call to VIDIOCSPICT
match the pixel format specified in the same call.

vlc doesn't set the depth field, which makes the SPICT ioctl always fail.

The V4L1 standard is not clear on how most operation are supposed to work, and
this is no exception.  The depth field would appear to be entirely redundant,
as the pixel format specifies a specific depth.  It could be that this field
was only meant for output from the *G*PICT ioctl and should be ignored in
*S*PICT.  This is in fact what the v4l1-compat wrapper does.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:16 -02:00
Adrian Bunk 87ae9afdca cleanup asm/scatterlist.h includes
Not architecture specific code should not #include <asm/scatterlist.h>.

This patch therefore either replaces them with
#include <linux/scatterlist.h> or simply removes them if they were
unused.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-11-02 08:47:06 +01:00
David Miller bb374b7b93 [MEDIA] IVTV: exit_ivtv_i2c() cannot be __devexit
It is referenced both from __devinit code (ivtv_probe) and
normal .text (ivtv_process_eeprom), and therefore cannot
be discarded via __devexit.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-31 07:48:21 -07:00
Jens Axboe 642f149031 SG: Change sg_set_page() to take length and offset argument
Most drivers need to set length and offset as well, so may as well fold
those three lines into one.

Add sg_assign_page() for those two locations that only needed to set
the page, where the offset/length is set outside of the function context.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-24 11:20:47 +02:00
Ralf Baechle 117636092a [PATCH] Fix breakage after SG cleanups
Commits

  58b053e4ce ("Update arch/ to use sg helpers")
  45711f1af6 ("[SG] Update drivers to use sg helpers")
  fa05f1286b ("Update net/ to use sg helpers")

converted many files to use the scatter gather helpers without ensuring
that the necessary headerfile <linux/scatterlist> is included.  This
happened to work for ia64, powerpc, sparc64 and x86 because they
happened to drag in that file via their <asm/dma-mapping.h>.

On most of the others this probably broke.

Instead of increasing the header file spider web I choose to include
<linux/scatterlist.h> directly into the affectes files.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-23 12:02:39 -07:00
Linus Torvalds ad792f4f46 Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (37 commits)
  V4L/DVB (6382): saa7134: fix NULL dereference at suspend time for cards without IR receiver
  V4L/DVB (6380): ivtvfb: Removal of the 'osd_compat' module option
  V4L/DVB (6379): patch which improves GotView Saa7135 remote control
  V4L/DVB (6378b): Updates info about the removal of V4L1 at feature-removal-schedule.txt
  V4L/DVB (6378a): Removal of VIDIOC_[G|S]_MPEGCOMP from feature-removal-schedule.txt
  V4L/DVB (6378): DiB0700-device: Using 1.10 firmware
  V4L/DVB (6357): pvrusb2: Improve encoder chip health tracking
  V4L/DVB (6356): "while (!ca->wakeup)" breaks the CAM initialisation
  V4L/DVB (6352): ir-kbd-i2c: Missing break statement
  V4L/DVB (6350): V4L: possible leak in em28xx_init_isoc
  V4L/DVB (6348): ivtv: undo video mute when closing the radio
  V4L/DVB (6347): ivtv: fix video mute when radio is used
  V4L/DVB (6346): ivtvfb: YUV output size fix when ivtvfb is not loaded
  V4L/DVB (6345): ivtvfb: YUV handling of an image which is not visible in the display area
  V4L/DVB (6343): ivtvfb: check return value of unregister_framebuffer
  V4L/DVB (6342): ivtv: fix circular locking (bug 9037)
  V4L/DVB (6341): ivtv: fix resizing MPEG1 streams
  V4L/DVB (6340): ivtvfb: screen mode change sometimes goes wrong
  V4L/DVB (6339): ivtv: set the video color to black instead of green when capturing from the radio
  V4L/DVB (6338): ivtv: fix incorrect EBUSY return
  ...
2007-10-22 19:20:22 -07:00
Jens Axboe 45711f1af6 [SG] Update drivers to use sg helpers
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-22 21:19:53 +02:00
Matthias Schwarzott f40aa808ba V4L/DVB (6382): saa7134: fix NULL dereference at suspend time for cards without IR receiver
Calling saa7134_ir_stop at suspend is no good idea
for saa7134 cards without remote control.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:53 -02:00
Ian Armstrong 6b1ec9da15 V4L/DVB (6380): ivtvfb: Removal of the 'osd_compat' module option
Due to changes in the core ivtv driver as of release 1.0, the osd_compat
module option has been rendered obsolete. This patch removes the option and
all code associated with it.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:52 -02:00
Pedro 0938e3194a V4L/DVB (6379): patch which improves GotView Saa7135 remote control
improve GoTView PCI7135 remote control working under linux.

Acked-by: Hermann Pitton <hermann-pitton@arcor.de>
Acked-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Eugene M. Roginskii <roginovicci@nm.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:52 -02:00
Mike Isely 9a607f01b0 V4L/DVB (6357): pvrusb2: Improve encoder chip health tracking
This is a minor change to help with tracking the viability of the
encoder chip within the PVR USB2 device.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:51 -02:00
Trent Piepho 415a197592 V4L/DVB (6352): ir-kbd-i2c: Missing break statement
Someone added a new case without adding a break to the one before it.

Thanks to Margus <b-berski at mbox200 dot swipnet dot se> for spotting this.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:50 -02:00
Florin Malita e7222ca9b4 V4L/DVB (6350): V4L: possible leak in em28xx_init_isoc
Coverity (CID 1929) spotted the following: if a transfer buffer
allocation fails, the last allocated urb is leaked (it hasn't been
stored in dev->urb[] yet so em28xx_uninit_isoc misses it). The patch
also includes a small typo fix.

Signed-off-by: Florin Malita <fmalita@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:49 -02:00
Hans Verkuil 2f7362ef9b V4L/DVB (6348): ivtv: undo video mute when closing the radio
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:49 -02:00
Hans Verkuil 254d6eb115 V4L/DVB (6347): ivtv: fix video mute when radio is used
When the radio is active the video should be muted when a capture
starts. However, this was done at the wrong time and the mute settings
were overwritten when cx2341x_update was called.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:48 -02:00
Ian Armstrong 195b125251 V4L/DVB (6346): ivtvfb: YUV output size fix when ivtvfb is not loaded
If the ivtvfb module isn't loaded, the valid YUV output area should be set to
full-screen. This patch fixes the case where the valid output area was not
reset when the output broadcast format was changed from NTSC to PAL. This
resulted in output being limited to the top 480 lines of the display.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:48 -02:00
Ian Armstrong 0bfeb04a9f V4L/DVB (6345): ivtvfb: YUV handling of an image which is not visible in the display area
When the ivtvfb module is loaded, the YUV output is relative to the
framebuffer output. When a virtual screen size is used, the output area for
the YUV may actually be off screen. To prevent the hardware from crashing,
the current driver will ignore an off-screen position and leave the output
visible at the last on-screen position. This may not be desirable, so this
patch will switch off the YUV output should the image move off-screen, and
re-enable it should the image move on-screen again.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:48 -02:00
Hans Verkuil d343d7f979 V4L/DVB (6343): ivtvfb: check return value of unregister_framebuffer
Prevent unloading the framebuffer if it is still in use.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:47 -02:00
Hans Verkuil 18e16f9c95 V4L/DVB (6342): ivtv: fix circular locking (bug 9037)
If you try to access the video device from within an udev rule,
then you get into a circular locking situation.

Changed the driver to postpone the registration of the devices until
everything else has been fully initialized, so that the newly created
device can be used immediately.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:47 -02:00
Hans Verkuil 34ca7d3791 V4L/DVB (6341): ivtv: fix resizing MPEG1 streams
Resizing an MPEG 1 stream would cut off the right half of the
image due to a missing divide by 2 in VIDIOC_S_FMT.

Also did some minor cleanup in this part of the code.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:46 -02:00
Ian Armstrong 6659e3ed55 V4L/DVB (6340): ivtvfb: screen mode change sometimes goes wrong
This patch partially reverts a previous change that caused the
CX2341X_OSD_SET_PIXEL_FORMAT firmware calls to be skipped when the pixel
format of the framebuffer wasn't altered by FBIOPUT_VSCREENINFO.

Unfortunately, another firmware call on the PVR350 sometimes scrambles the
display when trying to adjust the framebuffer settings. This patch re-enables
the CX2341X_OSD_SET_PIXEL_FORMAT calls to try and prevent this from
occurring.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:45 -02:00
Hans Verkuil 4339ab9365 V4L/DVB (6339): ivtv: set the video color to black instead of green when capturing from the radio
Thanks-to: Martin Dauskardt <md001@gmx.de>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:44 -02:00
Hans Verkuil af3420b449 V4L/DVB (6338): ivtv: fix incorrect EBUSY return
Trying to open the radio when a capture is in progress will make it
impossible to open the radio again since the radio stream wasn't released.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:44 -02:00
Trent Piepho a04036a312 V4L/DVB (6336): cx8802: Plug memory leak when unregistering a driver
When a cx8802 sub-driver was unregistered, the struct cx8802_driver, which was
kmalloc()ed by cx8802_register_driver(), was deleted from the list of drivers,
but never freed.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:43 -02:00
Trent Piepho 89a47942f0 V4L/DVB (6335): cx8802: Replace list_for_each+list_entry with list_for_each_entry
Less code and more efficient.

Got ride of a variable that counted the number of devices in
cx8802_unregister_driver() but was never used.  Looked leftover from a
cut&paste.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:43 -02:00
Trent Piepho 081c2fc8b9 V4L/DVB (6334): cx88: Change (struct cx8802_dev)->drvlist to a list_head and fix bugs
It was a struct cx8802_driver for no apparent reason.  Nothing uses a
cx8802_driver in the cx8802_dev struct.  The only field that was used was
devlist, a list_head.

The code in cx8802_remove() that removed any loaded sub-drivers was broken.
It would delete the current list entry, but didn't use list_for_each_safe.  It
also called list_del() on the list _head_ inside the list_for_each loop?  It
would crash if it was run, which I don't think can ever happen.

Since the cx8802 sub-drivers use the cx8802 driver, they have to be unloaded
first.  So there isn't any way for a sub-driver to still be loaded when
cx8802_remove() is called...  Except maybe with PCI hot-plug, if one removes
the PCI card while the drivers are loaded?

So I left some code in to handle that if it's actually possible.  It will
remove the sub-drivers from the device cx8802_remove() was called on, and only
that device.  If one has two DVB cards and unplugs one, there is no reason to
unload the DVB drivers for both cards.  I have no way to test this, but it
can't be worse than what was there before.

cx8802_get_driver() is passed a cx8802_dev pointer and looks for the requested
driver on that device.  It first loops over the cx8802 device list looking for
the device it was passed, which is pointless.  It doesn't need to find the
device pointer in the list, as it already has the pointer.

The list_head in the cx8802_driver struct, which joins all the _drivers_
attached to a device, was named devlist.  Changed that to drvlist, since the
devlist is used for a list of _devices_ in other cx8802 structs.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:43 -02:00
Trent Piepho f0ad90975b V4L/DVB (6333): cx88: Change void* card_priv to struct vp3054_i2c_state
card_priv was only used to store a pointer to the vp3054 state struct.
There's no need to use a void * since it doesn't have multiple types.

Make the field conditional on VP3045 support.  It was already conditional on
DVB support, but it's only used if VP3045 support is on, so that makes for a
better option to check.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:42 -02:00
Trent Piepho 7717cbedd9 V4L/DVB (6332): cx88: Only include the blackbird fields if blackbird is selected
Add some ifdefs around fields only used for blackbird support, similar to the
way the dvb fields are only included with dvb support.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:42 -02:00
Maxim Levitsky ea63d0b11e V4L/DVB (6330): V4L: saa7134: Fix interaction between tvaudio thread and the freezer
make tvaudio thread freezeable, and add proper support for that

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:41 -02:00
Maxim Levitsky c458473ebf V4L/DVB (6329): Additional Fixes for saa7134 suspend/resume
Fixes few more problems I found in my saa7134 resume code:

* Race between IRQ handler and .suspend()/.resume() functions

* Removes timeout timers on active buffers - those
	buffers will be recaptured after resume

* Adds suspend/resume for IR code - probably
	necessary if using polling mode

* Adds #ifdef CONFIG_PM overs suspend code

* Runs  a quirk in set_tvnorm in suspend/resume too

* Rearranges the order of calls in saa7134_resume to
	be exactly as in saa7134_initdev thus the card is
	initialized in exactly the same way

* Since DMA audio capture suspend/resume isn't yet supported,
	avoid re-enabling it on resume for now

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:41 -02:00
Adrian Bunk 7e7f05ca15 V4L/DVB (6328): ivtv: fix NULL dereference
We shouldn't dereference "itv" when we know it's NULL...

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:40 -02:00
Michael Krufky 1419683d85 V4L/DVB (6326): tuner-core.c: fe_has_signal() can return uninitialized value
Initialize strength to zero.

Thanks to Adrian Bunk, who spotted this with the Coverity checker.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:39 -02:00
Florin Malita fcf94c89af V4L/DVB (6325): Double-free in cx23885_initdev
Both cx23885_initdev and cx23885_dev_setup free the device in their
error path so a failure in the latter causes a double-free. Since
cx23885_dev_setup is only called from cx23885_initdev, it should be safe
to remove its deallocation and leave the cleanup up to the allocating
function.

Coverity CID 1922.

Signed-off-by: Florin Malita <fmalita@gmail.com>
CC: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:36 -02:00
Pekka Enberg a13625c518 V4L/DVB (6324): fix videobuf_cgmbuf export
As videobuf_cgmbuf is defined only if CONFIG_VIDEO_V4L1_COMPAT is enabled,
move the EXPORT_SYMBOL_GPL declaration inside the #ifdef block.  Fixes
compilation for x86_64 defconfig.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:35 -02:00
Hans Verkuil 3bcc95760c V4L/DVB (6321): Remove obsolete VIDIOC_S/G_MPEGCOMP ioctls
Remove the obsolete VIDIOC_G_MPEGCOMP and VIDIOC_S_MPEGCOMP ioctls from
the V4L2 API as per the removal schedule (October 2007).

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:30 -02:00
Mauro Carvalho Chehab 22c4a4e98e V4L/DVB (6320): v4l core: remove the unused .hardware V4L1 field
struct video_device used to define a .hardware field. While
initialized on severl drivers, this field is never used inside V4L.
However, drivers using it need to include the old V4L1 header.

This seems to cause compilation troubles with some random configs.
Better just to remove it from all drivers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:24 -02:00
Trent Piepho bbaccc0445 V4L/DVB (6187): cx88-alsa: Add TLV support
Lets mixer apps display a dB range for the volume control.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:18 -02:00
Trent Piepho 54ac005adc V4L/DVB (6185): cx88-alsa: Add mute controls, change control names
Add two mute controls.  One mutes everything, the other just mutes the analog
pass-through output.

Rename the existing volume control.  The controls are now:
Playback Volume
Playback Switch
Capture Switch

These names might seem odd, but I believe they are more correct.  The previous
"Capture Volume" control didn't actually effect the volume of the captured
audio.  Instead it controls the volume of the analog pass-thought output.  It
appears that pass-through controls like this are usually considered to be in
the playback direction, not capture.  For example, "CAPTURE feedback Playback
Volume" is the name used for a control that appears to have the same effect in
the ca0106 driver.  We only have one volume control, so we can omit the
"CAPTURE feedback" part.

If someone where to add PCM playback support to the driver, then this would be
the volume control.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:16 -02:00
Marcin Garski db955170d4 more UTF-8 conversions
Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-10-19 23:22:11 +02:00
Jan Engelhardt 96de0e252c Convert files to UTF-8 and some cleanups
* Convert files to UTF-8.

  * Also correct some people's names
    (one example is Eißfeldt, which was found in a source file.
    Given that the author used an ß at all in a source file
    indicates that the real name has in fact a 'ß' and not an 'ss',
    which is commonly used as a substitute for 'ß' when limited to
    7bit.)

  * Correct town names (Goettingen -> Göttingen)

  * Update Eberhard Mönkeberg's address (http://lkml.org/lkml/2007/1/8/313)

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-10-19 23:21:04 +02:00
Robert P. J. Day 3a4fa0a25d Fix misspellings of "system", "controller", "interrupt" and "necessary".
Fix the various misspellings of "system", controller", "interrupt" and
"[un]necessary".

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-10-19 23:10:43 +02:00
Pavel Emelyanov ba25f9dcc4 Use helpers to obtain task pid in printks
The task_struct->pid member is going to be deprecated, so start
using the helpers (task_pid_nr/task_pid_vnr/task_pid_nr_ns) in
the kernel.

The first thing to start with is the pid, printed to dmesg - in
this case we may safely use task_pid_nr(). Besides, printks produce
more (much more) than a half of all the explicit pid usage.

[akpm@linux-foundation.org: git-drm went and changed lots of stuff]
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-19 11:53:43 -07:00
Jiri Slaby 7b19ada2ed get rid of input BIT* duplicate defines
get rid of input BIT* duplicate defines

use newly global defined macros for input layer. Also remove includes of
input.h from non-input sources only for BIT macro definiton. Define the
macro temporarily in local manner, all those local definitons will be
removed further in this patchset (to not break bisecting).
BIT macro will be globally defined (1<<x)

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: <dtor@mail.ru>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Cc: <lenb@kernel.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Cc: <perex@suse.cz>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: <vernux@us.ibm.com>
Cc: <malattia@linux.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-19 11:53:42 -07:00
Ralf Baechle e8c44319c6 Replace __attribute_pure__ with __pure
To be consistent with the use of attributes in the rest of the kernel
replace all use of __attribute_pure__ with __pure and delete the definition
of __attribute_pure__.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Bryan Wu <bryan.wu@analog.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-18 14:37:32 -07:00
Jaroslav Kysela c1017a4cdb [ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2007-10-16 16:51:18 +02:00
Al Viro 64a6f9500d signedness: module_param_array nump argument
... should be unsigned int

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-14 12:41:52 -07:00
Jean Delvare cdeec3cc79 cx23885: Drop empty i2c algorithm control callback
i2c_algorithm.algo_control is about to be removed.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-13 23:56:32 +02:00
David Brownell 3be27d37c2 i2c: Remove NOP i2c_algorithm.algo_control() methods
This removes NOP implementations of i2c_algorithm.algo_control.

With this change, there are no implementations of this hook in
the kernel.org tree ... that hook seems about ripe to remove.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-10-13 23:56:32 +02:00
Al Viro 13bcd5d0e2 v4l: copy_to_user() is not a good method name
Breaks on any target that has copy_to_user() defined as a non-trivial
macro.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-13 09:58:59 -07:00
Kay Sievers 7eff2e7a8b Driver core: change add_uevent_var to use a struct
This changes the uevent buffer functions to use a struct instead of a
long list of parameters. It does no longer require the caller to do the
proper buffer termination and size accounting, which is currently wrong
in some places. It fixes a known bug where parts of the uevent
environment are overwritten because of wrong index calculations.

Many thanks to Mathieu Desnoyers for finding bugs and improving the
error handling.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-10-12 14:51:01 -07:00
Trent Piepho a991f44b79 V4L/DVB (6316): Change list_for_each+list_entry to list_for_each_entry
The rest of V4L files.

There is one list_for_each+list_entry in cpia_pp.c that
wasn't changed because it expects the loop iterator to remain NULL if
the list is empty.

A bug in vivi is fixed; the 'safe' version needs to be used because the loop
deletes the list entries.

Simplify a second loop in vivi and get rid if an un-used variable in that loop.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 13:35:29 -03:00
Trent Piepho e77e2c2f29 V4L/DVB (6315): pvrusb2: Change list_for_each+list_entry to list_for_each_entry
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 13:35:20 -03:00
Trent Piepho 6d28e98906 V4L/DVB (6314): saa7134: Replace list_for_each+list_entry with list_for_each_entry
A couple loops weren't changed because they expected the loop iterator
to be left as NULL if the list was empty.  Maybe the code should just
check for that first, then loop?

Adjust some of the loop logic to be simpler.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 13:35:07 -03:00
Trent Piepho 805a439241 V4L/DVB (6313): ivtv: Replace list_for_each+list_entry with list_for_each_entry
Also fixed a few cases of cut&paste errors where 'buf' would be set to the
first entry in the list prior to be used as the loop iterator.  In one case
the value of buf was used before it was changed, but the rest were
unnecessary.

There was one list_for_each+list_entry loop that wasn't changed, since it
depending on the loop iterator being left as NULL if the list was empty.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
CC: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 13:34:56 -03:00
Trent Piepho 8bb629e22f V4L/DVB (6312): cx88: Replace list_for_each+list_entry with list_for_each_entry
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 13:34:48 -03:00
Jiri Slaby c3e2a8e64c V4L/DVB (6308): V4L: zc0301, remove bad usage of ERESTARTSYS
zc0301, remove bad usage of ERESTARTSYS

down_read_trylock can't be interrupted and so ERESTARTSYS would reach
userspace, which is not permitted. Change it to EAGAIN

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:25 -03:00
Jiri Slaby 3abff557d5 V4L/DVB (6307): V4L: w9968cf, remove bad usage of ERESTARTSYS
w9968cf, remove bad usage of ERESTARTSYS

down_read_trylock can't be interrupted and so ERESTARTSYS would reach
userspace, which is not permitted. Change it to EAGAIN

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:25 -03:00
Maxim Levitsky acd827d63a V4L/DVB (6306): Few clenups for saa7134 resume code
*Disable DMA explictly on suspend
*Enable DMA on resume, after all buffers were configured
*Disable overlay on resume - apps should enable it when X is resumed

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:20 -03:00
Brandon Philips 49ee718ef5 V4L/DVB (6305): V4L: videobuf-core.c avoid NULL dereferences in videobuf-core
The return value of videobuf_alloc() is unchecked but this function will
return NULL on an error.  Check for NULL and make videobuf_reqbufs()
return the number of successfully allocated buffers.

Also, fix saa7146_video.c and bttv-driver.c to use this returned
buffer count.

Tested against the vivi driver.  Not tested against saa7146 or bt8xx
devices.

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:20 -03:00
Trent Piepho c726b65d07 V4L/DVB (6301): pvrusb: Update DEBUGIFC sysfs to kernel 2.6.13+
The prototypes for the show and store methods of a device_attribute changed in
kernel 2.6.13, but the code in pvrusb2 was never updated.  I guess the
DEBUGIFC stuff isn't used much....

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:20 -03:00
Trent Piepho bde00cc027 V4L/DVB (6300): CodingStyle cleanup
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:20 -03:00
Michael Krufky 21a7ad4a7e V4L/DVB (6297): cx23885: remove wrong Kconfig selection of VIDEOBUF
fix bad Kconfig dependency of cx23885 module.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:15 -03:00
Eric Sandeen 0ac3a5bbca V4L/DVB (6295): saa7134: add autodetection for KWorld ATSC-115
Recognize the KWorld ATSC115 PCI ID as a hardware clone of the ATSC110.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:15 -03:00
Kay Sievers 54bd5b66c8 V4L/DVB (6293): V4L: convert struct class_device to struct device
The currently used "struct class_device" will be removed from the
kernel. Here is a patch that converts all users in drivers/media/video/
to struct device.

Reviewed-by: Thierry Merle <thierry.merle@free.fr>
Reviewed-by: Mike Isely <isely@pobox.com>
Reviewed-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:14 -03:00
Mauro Carvalho Chehab d4cae5a500 V4L/DVB (6292): videobuf_core init always require callback implementation
In the past, videobuf_queue_init were used to initialize PCI DMA videobuffers.
This patch renames it, to avoid confusion with the previous kernel API, doing:
	s/videobuf_queue_init/void videobuf_queue_core_init/

Also, the operations is now part of the function parameter. The function will
also add a test if this is defined, otherwise producing BUG.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:14 -03:00
Mauro Carvalho Chehab d5f1b01644 V4L/DVB (6291): Fix: avoid oops on some SMP machines
This workaround fix a bug that happens on some SMP machines. On those machines,
videobuf_iolock is called too soon, before file .mmap handler. This patch calls
the scheduler before iolocking, allowing it to properly call the pending mmap.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:14 -03:00
Mauro Carvalho Chehab 5ddff43435 V4L/DVB (6290): remove videobuf_set_pci_ops
Before the videobuf redesign, a procedure for re-using videobuf without PCI
scatter/gather where provided by changing the pci-dependent operations by
other operations.

With the newer approach, those methods are obsolete and can safelly be removed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:10 -03:00
Robert P. J. Day 7568e3ce67 V4L/DVB (6289): Remove reference to dead CONFIG_UST and ust.h header
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:10 -03:00
Mauro Carvalho Chehab aecfde539e V4L/DVB (6287): Fix DMA Scatter/Gather constructor
cx23885 driver were converted to use the newer videobuf support. Unfortunately,
the constructor weren't changed. This causes an oops, since the abstract methods
(implemented as callbacks) aren't defined.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
2007-10-10 00:03:09 -03:00
Mauro Carvalho Chehab 593f18c6e4 V4L/DVB (6286): Add support for MSI TV @nywhere A/D NB
This is a Lifeview hybrid OEM board.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:09 -03:00
Jesper Juhl 925343ecdf V4L/DVB (6285): Remove pointless kmalloc() return value cast in Zoran PCI controller driver
No need to cast the void pointer returned by kmalloc() in
drivers/media/video/zoran_driver.c::v4l_fbuffer_alloc().

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:09 -03:00
Trent Piepho 409d84f85a V4L/DVB (6284): cx23885: Update to new videobuf code
cx23885 was still uses the old video-buf includes and code, which would only
`work' if one happened to be compiling against a kernel that had the old
headers.  Even then, it wouldn't actually work, it would just compile without
errors.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:09 -03:00
Trent Piepho 5a3ebe8755 V4L/DVB (6283): videobuf: Remove references to old Kconfig option name
CONFIG_VIDEO_BUF_DVB became CONFIG_VIDEOBUF_DVB.

But in these cases, it makes more sense to use CONFIG_VIDEO_SAA7134_DVB
or CONFIG_VIDEO_CX88_DVB_MODULE depending on the driver.

The reference in cx23885.h should just be removed, as the code there needs to
be included if DVB is on or off.  I do not think you can even compile the
cx23885 driver without DVB.  It's clearly just leftover from when the file was
obvious copied from the cx88 driver (which is not mentioned in the copyright
BTW).

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:08 -03:00
Maxim Levitsky d00cd2985e V4L/DVB (6278): Buf: fix typo that caused data loss when readng streams from device
If videobuf_read_stream reads two or more buffers it was overwriting the first one

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
2007-10-10 00:03:08 -03:00
Mauro Carvalho Chehab 14f37aee29 V4L/DVB (6277): vivi cleanup: remove the unused vars
Vivi driver is now simpler. This patch removes the now unused vars.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:08 -03:00
Brandon Philips 00f98d0804 V4L/DVB (6276): V4L: videobuf-core.c lock before streaming check
The reading/streaming fields are used for mutual exclusion of the queue and
should be protected by the queue lock.

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
2007-10-10 00:03:05 -03:00
Brandon Philips ba32bd95d4 V4L/DVB (6275): V4L: vivi.c remove the "resource" locking
The "resource" locking in vivi isn't needed since
streamon/streamoff/read_stream do mutual exclusion using
q->reading/q->streaming.

Plus it is sort of broken:

a) res_locked() use in vivi_read() is racey.
b) res_free() calls mutex_lock twice causing streamoff to break

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:05 -03:00
Brandon Philips 85c7c70bc2 V4L/DVB (6274): V4L: vivi.c replace logic in vivi_poll with videobuf_poll_stream
Since vivi is using videobuf_read_stream() it can use videobuf_poll_stream()
now.

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:05 -03:00
Brandon Philips a326ae1126 V4L/DVB (6273): V4L: vivi.c vidioc_try_fmt_cap() negotiate a valid field
If the client provides V4L2_FIELD_ANY vivi should return a valid field :)

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:00 -03:00
Maxim Levitsky 11f7078c10 V4L/DVB (6272): V4L: properly fix support for capturing interlaced video in saa7134
By "capturing interlaced video" I mean that card ensures that top field
is really top and vice versa (I think it takes the filed ID from signal)
Properly turn on/off that support depending on signal state

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:59 -03:00
Maxim Levitsky cb71201f20 V4L/DVB (6271): V4L: Add basic support for suspend/resume for saa7134
This adds support for suspend/resume for core of saa7134

Should fix bug#7220

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:59 -03:00