Commit graph

485 commits

Author SHA1 Message Date
Michael Krufky 42f9a03ed3 V4L/DVB (13215): tda18271: add support for the set_config method
Add the set_config method to allow drivers to configure the
tda18271 driver options after attach.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:40:55 -02:00
Michael Krufky 1724c8fa7e V4L/DVB (13214): tda18271: allow for i2c buses that cant send 16 bytes at once
There is already an option for sending 16 byte chunks rather that writing
39 bytes all at once during the tuner's initialization.  Some i2c buses
can't send 16 bytes at once, so create an option for sending 8 byte chunks.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:40:55 -02:00
Devin Heitmueller 760c466c66 V4L/DVB (13188): xc5000: return an error on tuning attempts if firmware not loaded
Xc5000 tuning attempts shouldn't return zero in the case where the firmware
did not load successfully.

Thanks to Michael Krufky for pointing out this issue.

Cc: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:40:48 -02:00
Igor M. Liplianin 9d2ba7ad80 V4L/DVB (13135): Add support for TeVii remotes
The patch brings infrared remote support for some cx88 based cards.
Such as TeVii S460,S420.

Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:40:29 -02:00
Igor M. Liplianin d8d8622552 V4L/DVB (13134): Add support for TBS-likes remotes
The patch brings infrared remote support for some cx88 based cards.
Such as:
TeVii S460,S420; Omicom SS4; SatTrade ST4200;
TBS 8920,8910; Prof 7300,6200.

Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:40:29 -02:00
Michael Krufky c0faeee5a3 V4L/DVB (13112): tda18271: display some state information in debug output
Display i2c adapter id, address and master / slave role in debug output.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:40:24 -02:00
Michael Krufky 3a6b49fef6 V4L/DVB (13111): tda18271: more signedness fixes
Convert tda18271_rf_tracking_filter_cal.rf_[ab][12] from int to s32.
Convert tda18271_priv.tm_rfcal from unsigned int to u8.
Cast subtractions between u32 values as s32.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:40:23 -02:00
Michael Krufky 3986bd116f V4L/DVB (13110): tda18271: use temporary variables in tda18271_rf_tracking_filters_init
Use temporary variables for signed calulations between unsigned values

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:40:23 -02:00
Henk Vergonet b450b92e16 V4L/DVB (13108): tda8290: enable deemphasis_50 module parameter
This adds a forgotten module_param macro needed to set a deemphasis of 50us.
It is the standard setting for commercial FM radio broadcasts outside the US.

Signed-off-by: Henk Vergonet <Henk.Vergonet@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:40:23 -02:00
Andy Walls 1d23a00243 V4L/DVB (13099): ir-functions: Export ir_rc5_decode() for use by the cx23885 module
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:40:21 -02:00
Devin Heitmueller 496e9057ad V4L/DVB (13076): xc5000: make the definition of the FM input part of the xc5000 config struct
Remove hard-coded definition of the xc5000 FM radio input, making it a
parameter passed in when doing the attach call.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:40:13 -02:00
Beholder Intl. Ltd. Dmitry Belimov d7009cdc28 V4L/DVB (13075): xc5000: add FM radio support
Add FM radio for the xc5000 silicon tuner chip.

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:40:13 -02:00
André Goddard Rosa af901ca181 tree-wide: fix assorted typos all over the place
That is "success", "unknown", "through", "performance", "[re|un]mapping"
, "access", "default", "reasonable", "[con]currently", "temperature"
, "channel", "[un]used", "application", "example","hierarchy", "therefore"
, "[over|under]flow", "contiguous", "threshold", "enough" and others.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-04 15:39:55 +01:00
Alan Cox 361c95119a V4L/DVB (13530): Fix wrong parameter order in memset
Edwin Török found the following:

In function ‘memset’,
inlined from ‘ir_input_init’ at drivers/media/common/ir-functions.c:67:
/home/edwin/builds/linux-2.6/arch/x86/include/asm/string_64.h:61:
warning: call to ‘__warn_memset_zero_len’ declared with attribute
warning: memset used with constant zero length parameter; this could be
due to transposed parameters
memset(ir->ir_codes, sizeof(ir->ir_codes), 0);

In actual practice the only caller I can find happens to already have cleared
the buffer before calling ir_input_init.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-11-27 18:50:43 -02:00
Seth Barry a57c1dcb93 V4L/DVB (13109): tda18271: fix signedness issue in tda18271_rf_tracking_filters_init
While having tda18271 module set with debug=17 (cal & info prints) and
cal=0 (delay calibration process until first use) - I discovered that
during the calibration process, if the frequency test for 69750000
returned a bcal of 0 (see tda18721-fe.c in tda18271_powerscan func) that
the tuner wouldn't be able to pickup any of the frequencies in the range
(all the other frequencies bands returned bcal=1).  I spent some time
going over the code and the NXP's tda18271 spec (ver.4 of it i think) and
adding a lot of debug prints and walking/stepping through the calibration
process.  I found that when the powerscan fails to find a frequency, the
rf calibration is not run and the default value is supposed to be used in
its place (pulled from the RF_CAL_map table) - but something was getting
goofed up there.

Now, my c coding skills are very rusty, but i think root of the problem is
a signedness issue with the math operation for calculating the rf_a1 and
rf_a2 values in tda18271_rf_tracking_filters_init func, which results in
values like 20648 for rf_a1 (when it should probably have a value like 0,
or so slightly negative that it should be zero - this bad value for rf_a1
would in turn makes the approx calc within
tda18271c2_rf_tracking_filters_correction go out of whack).  The simplest
solution i found was to explicitly convert the signedness of the
denominator to avoid the implicit conversion.  The values placed into the
u32 rf_freq array should never exceed about 900mhz, so i think the s32 max
value shouldn't be an issue in this case.

I've tested it out a little, and even when i get a bcal=0 with the
modified code, the default calibration value gets used, rf_a1 is zero, and
the tuner seems to lock on the stream and mythtv seems to play it fine.

Signed-off-by: Seth Barry <seth@cyberseth.com>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
CC: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-11-07 12:55:04 -02:00
Michael Krufky 4d8317876d V4L/DVB (13107): tda18271: fix overflow in FM radio frequency calculation
Multiplication by 62500 causes an overflow in the 32 bit freq variable,
which is later divided by 1000 when using FM radio.

This patch prevents the overflow by scaling the frequency value correctly
upfront.  Thanks to Henk Vergonet for spotting the problem and providing
a preliminary patch, which this changeset was based upon.

Cc: Henk Vergonet <Henk.Vergonet@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
CC: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-11-07 12:55:04 -02:00
Michael Krufky 93463895ae V4L/DVB (12964): tuner-core: add support for NXP TDA18271 without TDA829X demod
Add support for NXP TDA18271 as a standalone tuner, allowing the use of
analog demodulators other than the Philips/NXP TDA829x.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:16:01 -03:00
Antti Palosaari e558170a91 V4L/DVB (12950): tuner-simple: add Philips CU1216L
add Philips CU1216L NIM

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:15:27 -03:00
Henk Vergonet d1f7510b91 V4L/DVB (12871): tda18271: fix bad data in tda18271_cid_target table
Fixed one value and removed a duplicate in tda18271_cid_target[],
based on table 54 "CID_Target_map" in Rev.04 of the TDA18271HD datasheet.

Signed-off-by: Henk Vergonet <Henk.Vergonet@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:13:52 -03:00
Henk Vergonet b5d189702b V4L/DVB (12870): tda18271: update temperature compensation calculatation formula
Update the tda18271c2_rf_tracking_filters_correction function to include
the modified temperature compensation calculatation formula as described
in Rev.04 of the TDA18271HD datasheet.

Signed-off-by: Henk Vergonet <Henk.Vergonet@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:13:50 -03:00
Michael Krufky ecda427340 V4L/DVB (12869): tda18271: fix comments and make tda18271_agc debug less verbose
Don't display "no agc configuration provided" unless DBG_ADV is set.

Fix comments in function, tda18271_agc.  This config variable is not
for LNA configuration -- it is for external AGC configuration.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:13:49 -03:00
Michael Krufky 650901c0b6 V4L/DVB (12868): tda18271: improve error log in function tda18271_write_regs
Display function parameters, idx and len, in error log.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:13:48 -03:00
Michael Krufky d5abef6be1 V4L/DVB (12867): tda18271: ensure that configuration options are set for multiple instances
For the case of multiple tuner instances, ensure that non-default
configuration options are saved into the driver's state.

This resolves an issue where a configuration option may not be
carried into the driver if the analog side of a hybrid driver
initializes before the digital side.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:13:47 -03:00
Michael Krufky 1216531a1f V4L/DVB (12866): tda18271: move small_i2c assignment to the state config block
minor cleanup: move small_i2c assignment to the state config block

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:13:45 -03:00
Michael Krufky cc7e26d47f V4L/DVB (12865): tda18271: move tda18271_sleep directly below tda18271_init
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:13:44 -03:00
Michael Krufky 4240b460f0 V4L/DVB (12864): tda18271: change output feature configuration to a bitmask
For better readability, treat the low power standby mode configuration
as an output option feature configuration, and change it to a bitmask.

If left unconfigured, all features will remain enabled, just as the
default configuration was before these changes were introduced.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:13:43 -03:00
Michael Krufky 2dfca76303 V4L/DVB (12863): tda18271: add new standby mode: slave tuner output / loop thru on
Add new standby mode:
TDA18271_STANDBY_LT_ON = slave tuner output loop thru on w/ xtal osc off

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:13:41 -03:00
Michael Krufky 72c8364a66 V4L/DVB (12862): tda18271: add debug to show which standby mode is in use
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:13:40 -03:00
Michael Krufky 81259f210e V4L/DVB (12861): tda18271: add support for additional low-power standby modes
By default, the driver enters standby mode with slave tuner output
loop thru enabled and xtal oscillator on.

Not all designs require that slave tuner output loop thru and
xtal oscillator remain active while in standby mode, so two
additional standby modes have been added:

- standby mode with xtal oscillator on (loop thru off)

- total power off

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:13:39 -03:00
Mauro Carvalho Chehab 715a223323 V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:

1) It requires that the scancode to be at the range 00-7f;

2) keycodes should be masked on 7 bits in order for it to work;

3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;

4) it is different than what is done with dvb-usb approach;

5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.

This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
       u16     scancode;
       u32     keycode;
};

This is very close to what dvb does. So, a further integration with DVB
code will be easy.

While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.

The only notable effect is the redution of about 35% of the ir-common
module size:

   text    data     bss     dec     hex filename
   6721   29208       4   35933    8c5d old/ir-common.ko
   5756   18040       4   23800    5cf8 new/ir-common.ko

In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.

This patch itself shouldn't be doing any functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:47 -03:00
Mauro Carvalho Chehab 6d888a66be V4L/DVB (12591): em28xx: Add entry for GADMEI UTV330+ and related IR keymap
[mchehab@redhat.com: Fix a few wrong IR keymaps]
Signed-off-by: Shine Liu <shinel@foxmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:44 -03:00
Michael Krufky 81016b496e V4L/DVB (12578): tda18271: allow drivers to request RF tracking filter calibration during attach
On certain master / slave dual tuner configurations, tuning performance
improves when the RF tracking filter calibration is performed sequentially.

This patch allows for the bridge driver to specify this behavior in the
configuration structure at attach-time.

The "cal" module option will continue to override this attach-time
configuration: set cal=0 to prevent RF tracking filter calibration
on startup, and set cal=1 to force it.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Reviewed-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:37 -03:00
Michael Krufky ee8145d563 V4L/DVB (12577): tda18271: remove excess whitespace from tda_foo printk macros
remove excess spacing from the tda_foo printk macros & line things up better

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:35 -03:00
Michael Krufky 1b6b73336d V4L/DVB (12576): tda18271: simplify debug printk macros
Rename dprintk to tda_dprintk to be consistent with the other tda_foo macros.

Move KERN_DEBUG facility level to tda_dprintk.

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:34 -03:00
Dmitri Belimov 5bc53a9f91 V4L/DVB (12573): FM1216MK5 FM radio
Implement Philips FM1216MK5.

1. Implement get_stereo function.
2. Add correct data byte for FM radio mode

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:33 -03:00
Mauro Carvalho Chehab 092315a76c V4L/DVB (12567): ir-keymaps: use KEY_CAMERA for snapshots
KEY_CAMERA is already used for a long time with webcam drivers to take a picture.
On other media drivers, due to the lack of a snapshot button, random KEY codes
were sent, being KEY_SHUFFLE the most used one, probably due to cut-and-paste
from other remotes, since one of them uses the same key for snapshot and shuffle.

The better is to use KEY_CAMERA on all drivers solving this issue. This
follows the IR standard map as defined at:
	http://linuxtv.org/wiki/index.php/Remote_Controllers

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:32 -03:00
Mauro Carvalho Chehab cd748871fe V4L/DVB (12566): ir-keymaps: Fix IR mappings for channel and volume +/- keys
Use standard definitions for channel controls, as defined at:
	http://linuxtv.org/wiki/index.php/Remote_Controllers

While here, fix a few broken up/down/left/right mappings

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:31 -03:00
Mauro Carvalho Chehab f545cb4394 V4L/DVB (12565): ir-keymaps: standardize timeshift key
Each remote were using a different keycode for timeshift. Use the same
keycode for all of them, using the map as defined at:
	http://linuxtv.org/wiki/index.php/Remote_Controllers

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:29 -03:00
Mauro Carvalho Chehab 62f1aa9f98 V4L/DVB (12564): ir-keymaps: Replace most KEY_[A-Z] to the proper definitions
There are several IR's that were using IR to type a letter that it is
known by some random application. Instead, the better is to use
the standard definitions found at:
	http://linuxtv.org/wiki/index.php/Remote_Controllers

And, if needed, submit a patch for the application to understand the
media keys.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:29 -03:00
Mauro Carvalho Chehab 7f9d691361 V4L/DVB (12563): ir-keymaps: add a link to the IR standard layout page
While we're still discussing it, let's point to the wiki page. In
the future, this should be added at V4L2 API spec DocBooks.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:28 -03:00
Mauro Carvalho Chehab 88d25a1ee4 V4L/DVB (12562): ir-keymaps: replace KEY_KP[0-9] to KEY_[0-9]
This is needed to match the standard mapping defined at:
	http://linuxtv.org/wiki/index.php/Remote_Controllers#Remote_Controllers

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:27 -03:00
Mauro Carvalho Chehab a83520f432 V4L/DVB (12560): Fix a number of EXPORT_SYMBOL warnings
Make Checkpatch tool happy:

-:2349: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable

On all cases, it were just a blank line at the wrong place. Yet, fixing it is trivial

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:27 -03:00
Mauro Carvalho Chehab 5d35364e31 V4L/DVB (12559): Properly indent comments with tabs
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:26 -03:00
Mauro Carvalho Chehab 3b82bddb15 V4L/DVB (12558): CodingStyle: Use [0x0f] instead of [ 0x0f ]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:24 -03:00
Mauro Carvalho Chehab 97fd4f7fb6 V4L/DVB (12557): Use C99 comment CodingStyle
The ir-keymaps.c has frequent additions. As people tend to copy an old
keyboard entry, a bad CodingStyle at an ancient entry may result on a
freshly bad CodingStyle patch.

So, better to fix the CodingStyle for the entire file.

This patch is the first of a series of patches fixing it, generated by
some perl magic plus manual handling.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:24 -03:00
Igor M. Liplianin ecfcfec804 V4L/DVB (12463): Add support for Compro VideoMate S350 DVB-S PCI card.
Add Compro VideoMate S350 DVB-S driver.
The card uses zl10313, zl10039, saa7130 integrated circuits.

Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:18:57 -03:00
Devin Heitmueller 8cd9aaefad V4L/DVB (12444): em28xx: add support for Terratec Cinergy Hybrid T USB XS remote control
Add support for the remote control that comes with the Cinergy Hybrid T USB XS

Thanks to Jelle de Jong for providing sample hardware to test with.

Cc: Jelle de Jong <jelledejong@powercraft.nl>
Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:18:52 -03:00
Andy Walls e3e1920b28 V4L/DVB (12334): tuner-simple: Add an entry for the Partsnic PTI-5NF05 NTSC tuner
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:18:10 -03:00
Devin Heitmueller 93b999239c V4L/DVB (12394): cx88: Disable xc3028 power management for Geniatech x8000
A user discovered that the Geniatech x8000 encountered a regression when
the xc3028 power management was introduced.  The xc3028 never recovers after
setting the powerdown register, which is probably because the xc3028 reset
GPIO is not properly configured.  Since I do not have access to the hardware
and thus cannot determine the correct GPIO configuration, just disable xc3028
power management on this board, which fixes the regression.

Thanks to user "ritec" for reporting the issue and testing the fix.

Cc: rictec <rictec@netcabo.pt>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-13 20:39:07 -03:00
Jan Nikitenko 458f9aa391 V4L/DVB (12341): zl10353 and qt1010: fix stack corruption bug
Fixes stack corruption bug present in dump_regs function of zl10353 and
qt1010 drivers: the buffer buf was one byte smaller than required -
there are 4 chars for address prefix, 16 * 3 chars for dump of 16 eeprom
bytes per line and 1 byte for zero ending the string required, i.e. 53
bytes, but only 52 were provided.

The one byte missing in stack based buffer buf can cause stack
corruption possibly leading to kernel oops, as discovered originally
with af9015 driver (af9015: fix stack corruption bug).

Signed-off-by: Jan Nikitenko <jan.nikitenko@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-13 20:39:02 -03:00
Andy Walls 6e707b4c6d V4L/DVB (12167): tuner-xc2028: Fix 7 MHz DVB-T
The following patch should fix 7 MHz DVB-T with the XC3028 using the
DTV7 firmware from the xc3028-v27.fw firmware image.

Tested-by: Terry Wu <terrywu2009@gmail.com>
[mchehab@redhat.com: thanks to John Ferlito, we have a real test in Australia]
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-05 14:29:57 -03:00
Devin Heitmueller a4c473033b V4L/DVB (12102): em28xx: add Remote control support for EVGA inDtube
Add an IR profile for the EVGA inDtube remote control (which is an NEC type
remote)

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-23 03:14:25 -03:00
Linus Torvalds 0dd5198672 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (425 commits)
  V4L/DVB (11870): gspca - main: VIDIOC_ENUM_FRAMESIZES ioctl added.
  V4L/DVB (12004): poll method lose race condition
  V4L/DVB (11894): flexcop-pci: dmesg visible names broken
  V4L/DVB (11892): Siano: smsendian - declare function as extern
  V4L/DVB (11891): Siano: smscore - bind the GPIO SMS protocol
  V4L/DVB (11890): Siano: smscore - remove redundant code
  V4L/DVB (11889): Siano: smsdvb - add DVB v3 events
  V4L/DVB (11888): Siano: smsusb - remove redundant ifdef
  V4L/DVB (11887): Siano: smscards - add board (target) events
  V4L/DVB (11886): Siano: smscore - fix some new GPIO definitions names
  V4L/DVB (11885): Siano: Add new GPIO management interface
  V4L/DVB (11884): Siano: smssdio - revert to stand alone module
  V4L/DVB (11883): Siano: cards - add two additional (USB) devices
  V4L/DVB (11824): Siano: smsusb - change exit func debug msg
  V4L/DVB (11823): Siano: smsusb - fix typo in module description
  V4L/DVB (11822): Siano: smscore - bug fix at get_device_mode
  V4L/DVB (11821): Siano: smscore - fix isdb-t firmware name
  V4L/DVB (11820): Siano: smscore - fix byte ordering bug
  V4L/DVB (11819): Siano: smscore - fix get_common_buffer bug
  V4L/DVB (11818): Siano: smscards - assign gpio to HPG targets
  ...
2009-06-16 21:15:42 -07:00
Dmitri Belimov 436ae1381e V4L/DVB (11934): Change order for FM tune
Change order data of buffer in FM simple_tune function. It is usefull for:

1. Set data of tuner with CP bit UP. 0xCE for MK5 or 0xC6 for MK3
2. When call simple_fm_tune, read this byte from config and overwrite
this byte in function simple_radio_bandswitch for set CP bit to OFF.

Of course it can be usefull for other tuner for overwrite default
settings of FM.

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 19:07:25 -03:00
Andy Walls 5ddc9b100f V4L/DVB (11933): tuner-simple, tveeprom: Add Philips FQ1216LME MK3 analog tuner
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 19:07:25 -03:00
Mauro Carvalho Chehab e2860d9621 V4L/DVB (11922): tuner-xc2028: cleanup: better use tuner type defines
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 19:07:18 -03:00
Mauro Carvalho Chehab 0a863975e2 V4L/DVB (11918): tuner-xc2028: Fix offset frequencies for DVB @ 6MHz
Both ATSC and DVB @ 6MHz bandwidth require the same offset.

While we're fixing it, let's cleanup the bandwidth setup to better
reflect the fact that it is a function of the bandwidth.

Thanks to Terry Wu <terrywu2009@gmail.com> for pointing this issue and
to Andy Walls <awalls@radix.net> for an initial patch for this fix.

Cc: Terry Wu <terrywu2009@gmail.com>
Acked-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 19:07:18 -03:00
Mauro Carvalho Chehab a1014d70db V4L/DVB (11917): Fix firmware load for DVB-T @ 6MHz bandwidth for xc3028/xc3028L
The only two countries that are known to use 6MHz bandwidth are Taiwan
and Uruguay. Both use QAM subcarriers at OFTM.

This patch fixes the firmware load for such countries, where the
required firmware is the QAM one.

This also confirms the previous tests where it was noticed that the 6MHz
QAM firmware doesn't work for cable. So, this patch also removes support
for DVB-C, instead of just printing a warning.

Thanks to Terry Wu <terrywu2009@gmail.com> for pointing this issue and
to Andy Walls <awalls@radix.net> for an initial patch for this fix.

Cc: Terry Wu <terrywu2009@gmail.com>
Acked-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 19:07:17 -03:00
Devin Heitmueller e80858e88b V4L/DVB (11806): xc5000: add copyright line
Add copyright line for xc5000.c.

Cc: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:08 -03:00
Devin Heitmueller a37791c540 V4L/DVB (11804): xc5000: poll at 5ms interval for register write command completion
Instead of polling at 100ms intervals for register writes, poll at 5ms
intervals.  This is consistent with the xc5000 specification, and improves
tuning time by up to 500 ms on devices that such as the au0828 which do not
properly implement i2c clock stretching (since the five register writes that
occur for a tuning request often do not complete immediately but do complete
far before 100ms has gone by).

The net amount of time we wait before timing out is unchanged (500ms).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:07 -03:00
David T.L. Wong 6c99080d8e V4L/DVB (11803): xc5000: add support for DVB-T tuning
This patch adds XC5000 supports for DVB-T 6MHz and 8MHz bandwidth.

Signed-off-by: David T.L. Wong <davidtlwong@gmail.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:07 -03:00
Devin Heitmueller a6301d1d57 V4L/DVB (11802): xc5000: switch to new xc5000 firmware 1.6.114 with redistribution rights
Xceive has graciously allowed us to now freely redistribute the xc5000
firmware, which eliminates the need for users to manually extract the blob
from the Hauppauge driver.

Thanks to Brian Mathews <bmathews@xceive.com> for providing this code

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:07 -03:00
Devin Heitmueller 4900877b7c V4L/DVB (11800): tuner-xc2028: show the proper module description for no_poweroff option
There was a typo in the module description for the "no_poweroff" option, where the
help was being associated with the "debug" option instead.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:07 -03:00
Devin Heitmueller b6bd5eb871 V4L/DVB (11798): xc5000: add "no_poweroff" module option
Provide for the ability for a user to disable putting the tuner to sleep, in
case he doesn't want to incur the cost of reloading the firmware when starting
up his/her application.  The module options are intentionally identical to
xc3028.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:06 -03:00
Devin Heitmueller 34a0db9202 V4L/DVB (11797): xc5000: cleanup firmware loading messages
Make it a little more obvious in the dmesg output what is going on during
firmware upload.  This is more important for boards like the HVR-950q that
take nearly seven seconds to do the upload.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:06 -03:00
Devin Heitmueller 81c4dfe776 V4L/DVB (11796): xc5000: start using the newer "finerfreq" tuning command
Starting in firmware version 1.1.44, Xceive recommends using the FINERFREQ for
all normal tuning (the doc indicates reg 0x03 should only be used for fast
scanning for channel lock)

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:06 -03:00
Devin Heitmueller bae7b7d73d V4L/DVB (11795): xc5000: add build version to debug info
Expose the firmware build number along with the other version info

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:06 -03:00
Devin Heitmueller 7f05b530be V4L/DVB (11793): xc5000: Properly support power down for newer firmware
Xceive got rid of the XREG_POWER_DOWN register in later firmware revisions.
Their technical support informed me that the correct way to put the tuner
to sleep is to pull the reset pin (but don't reload the firmware).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:05 -03:00
Devin Heitmueller 361d4892cd V4L/DVB (11792): xc5000: switch to new version of Xceive firmware
This switches to a new version of the xc5000 firmware, extracted from the
latest Hauppauge driver.  It includes the support for the XREG_BUSY register
(a lack of which was causing tuning to take 3200ms instead of around 300ms).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:05 -03:00
Devin Heitmueller a78baacffe V4L/DVB (11791): xc5000: do not sleep after digital tuning
Don't sleep for 400ms polling the tuner's lock if in digital mode (since the
xc5000 lock status registers appear to only be reliable in analog mode)

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:05 -03:00
Devin Heitmueller 8e4c67972e V4L/DVB (11790): xc5000: restore sleep routine
Bring back the code that puts the xc5000 to sleep.  For the Pinnacle 801e
this results in power consumption at idle dropping from 325ma to 124ma.

If there are *actually* any devices that don't work in this configuration,
they should set dvb_frontend.ops.tuner_ops.sleep to NULL (per mkrufky's
suggestion)

Also, had to make sure we were making sure the firmware was loaded in the
digital version of set_params, or else we end up get i2c errors if the
device is asleep

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:05 -03:00
Devin Heitmueller 7988fc216d V4L/DVB (11789): xc5000: check xc5000_readreg return value for XC_RESULT_SUCCESS
Make return value checking for calls to i2c routines explicit.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:05 -03:00
Devin Heitmueller d7800d4ea9 V4L/DVB (11788): xc5000: cleanup i2c write routines
Cleanup the i2c write routine, getting rid of a passthrough function with only
one caller

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:05 -03:00
Devin Heitmueller bdd335636a V4L/DVB (11787): xc5000: cleanup i2c read routines
This patch centralizes the i2c read functions, and eliminates pass-through
function only called by one caller.

Make reading of xc5000 registers an atomic i2c transaction in case we're on a
multi-master bus.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:04 -03:00
Devin Heitmueller 91bd625e21 V4L/DVB (11786): xc5000: handle tuner reset failures properly
Properly handle tuner reset failures (before it was always returning success)

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:04 -03:00
Dmitri Belimov 8475cbcb0f V4L/DVB (11775): tuner: add support Philips MK5 tuner
Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:04 -03:00
Jean Delvare e9785250ef V4L/DVB (11723): Link firmware to physical device
Use the physical device rather than the i2c adapter as the reference
device when loading firmwares. This will prevent the sysfs name
collision with i2c-dev that has been reported many times.

I may have missed other drivers which need the same fix.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:56 -03:00
Samuel Ortiz 4327b77ed7 firmware: tuners/xc2028: prepare for FIRMWARE_NAME_MAX removal
We're going to remove the FIRMWARE_NAME_MAX definition in order to avoid any
firmware name length restriction.
This patch gets rid of the xc2028 FIRMWARE_NAME_MAX reference.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Michel Ludwig <michel.ludwig@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:30:25 -07:00
Linus Torvalds 811158b147 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (28 commits)
  trivial: Update my email address
  trivial: NULL noise: drivers/mtd/tests/mtd_*test.c
  trivial: NULL noise: drivers/media/dvb/frontends/drx397xD_fw.h
  trivial: Fix misspelling of "Celsius".
  trivial: remove unused variable 'path' in alloc_file()
  trivial: fix a pdlfush -> pdflush typo in comment
  trivial: jbd header comment typo fix for JBD_PARANOID_IOFAIL
  trivial: wusb: Storage class should be before const qualifier
  trivial: drivers/char/bsr.c: Storage class should be before const qualifier
  trivial: h8300: Storage class should be before const qualifier
  trivial: fix where cgroup documentation is not correctly referred to
  trivial: Give the right path in Documentation example
  trivial: MTD: remove EOL from MODULE_DESCRIPTION
  trivial: Fix typo in bio_split()'s documentation
  trivial: PWM: fix of #endif comment
  trivial: fix typos/grammar errors in Kconfig texts
  trivial: Fix misspelling of firmware
  trivial: cgroups: documentation typo and spelling corrections
  trivial: Update contact info for Jochen Hein
  trivial: fix typo "resgister" -> "register"
  ...
2009-04-03 15:24:35 -07:00
Trent Piepho f911eab66d V4L/DVB (11261): saa7146: Remove buffer type check from vidioc_g_parm
The v4l2-ioctl core now only allows buffer types for which the
corresponding ->vidioc_try_fmt_xxx() methods are defined to be used with
vidioc_(g|s)_parm.

The driver was only allowing VIDEO_CAPTURE buffers for g_parm, but since
the driver defines ->vidioc_try_fmt_vid_overlay() it will now allow
VIDEO_OVERLAY buffers as well.  This should be fine as the fields the
driver fills in, readbuffers and frame rate, aren't wrong for VIDEO_OVERLAY
buffers.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:44 -03:00
klaas de waal cf47d878e5 V4L/DVB (11236): tda827x: fix locking issues with DVB-C
Separate tuning table for DVB-C solves tuning problem at 388MHz

TechnoTrend C-1501 DVB-C card does not lock on 388MHz. I assume that
existing frequency table is valid for DVB-T.

This is suggested by the name of the table: tda827xa_dvbt.

Added a table for DVB-C with the name tda827xa_dvbc.

Added runtime selection of the DVB-C table when the tuner is type
FE_QAM.

This should leave the behaviour of this driver with with DVB_T tuners
unchanged. This modification is in file tda827x.c

The tda827x.c gives the following warning message when debug=1:

tda827x: tda827x_config not defined, cannot set LNA gain!

Solved this by adding a tda827x_config struct in budget-ci.c.

Signed-off-by: Klaas de Waal <klaas.de.waal@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:42 -03:00
Andy Walls cea0213de7 V4L/DVB (11233): mxl5005s: Switch in mxl5005s_set_params should operate on correct values
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:42 -03:00
Mauro Carvalho Chehab 1398ae1fe6 V4L/DVB (11127): Kconfig: replace all occurrences of CUSTOMIZE to CUSTOMISE
There are several Kconfig items using CUSTOMIZE. Yet, most use the English
writing CUSTOMISE. This generates lots of trouble, because people sometimes type
the Kbuild item different.

Let's standardise every occurrence using the same syntax.

The changes were generated by this small shell script:

for i in `find linux -type f`; do sed s,CUSTOMIZE,CUSTOMISE,g $i >/tmp/a && mv /tmp/a $i; done

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:31 -03:00
Devin Heitmueller ea2278633a V4L/DVB (11059): xc5000: fix bug for hybrid xc5000 devices with IF other than 5380
The xc5000 driver has a bug where the IF is always set to whatever the first
caller to dvb_attach() provides.  This fails when the device requires an IF
other than 5380 and the analog driver is loaded first through tuner-core
(which always supplies the hard-coded value of 5380).

Thanks to Michael Krufky <mkrufky@linuxtv.org> and Steven Toth
<stoth@linuxtv.org> for providing sample hardware, engineering level support,
and testing.

Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:24 -03:00
Mauro Carvalho Chehab 1fab14ed1a V4L/DVB (10951): xc5000: Fix CodingStyle errors introduced by the last patch
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:18 -03:00
Sri Deevi 0356baad85 V4L/DVB (10950): xc5000: prepare it to be used by cx231xx module
Signed-off-by: Srinivasa Deevi <srinivasa.deevi@conexant.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:18 -03:00
Mauro Carvalho Chehab 0aab2e6044 V4L/DVB (10897): Fix Kbuild MEDIA_TUNER_CUSTOMIZE dependencies
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:14 -03:00
Michael Krufky adcc4b3e75 V4L/DVB (10876): tda18271: add support for AGC configuration via tuner callback
The tda827x driver supports a feature that the tda18271 driver was lacking
until now.  This patch adds support for device-level configuration via the
tuner callback configuration interface.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:11 -03:00
Oliver Endriss 632fe9fe44 V4L/DVB (10843): saa7146: Clean-up i2c error handling
saa7146: Clean-up i2c error handling

Simplify i2c error handling and fix incorrect handling of
address errors in poll mode.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:08 -03:00
Trent Piepho 717167e8ae V4L/DVB (10814): saa7146: some small fixes
vidioc_enum_fmt_vid_overlay() did nothing but call
vidioc_enum_fmt_vid_cap(), so just make
saa7146_video_ioctl_ops.vidioc_enum_fmt_vid_overlay point to
vidioc_enum_fmt_vid_cap() and get ride of vidioc_enum_fmt_vid_overlay().

Have gparm use v4l2_video_std_frame_period to fill in the frame period
instead of just assuming PAL.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:06 -03:00
Michael Krufky 7434ca4343 V4L/DVB (10784): mxl5007t: update driver for MxL 5007T V4
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Asaf Fishov <afishov@maxlinear.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:03 -03:00
Michael Krufky 3d0081dd10 V4L/DVB (10783): mxl5007t: fix devname for hybrid_tuner_request_state
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:03 -03:00
Michael Krufky d202515bd1 V4L/DVB (10782): mxl5007t: warn when unknown revisions are detected
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:03 -03:00
Michael Krufky d90958e6d0 V4L/DVB (10781): mxl5007t: mxl5007t_get_status should report if tuner is locked
report TUNER_STATUS_LOCKED if rf_locked or ref_locked

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:03 -03:00
Michael Krufky b1ff363bfe V4L/DVB (10780): mxl5007t: remove function mxl5007t_check_rf_input_power
This function does not work properly and is not necessary - remove it for now.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:03 -03:00
Michael Krufky 69e2333324 V4L/DVB (10779): mxl5007t: remove analog tuning code
Analog doesn't work in this driver yet. This code just adds extra bloat,
so remove it for now.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:02 -03:00
Igor M. Liplianin b72857dd45 V4L/DVB (10744): dm1105: infrared remote code is remaked.
The driver infrared remote code part is altered to switch to a work queue.
Also ir_codes table moved to ir-common module for shared access.

Signed-off-by: Igor M. Liplianin <liplianin@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:00 -03:00
Hans Verkuil 7f6adeaf2d V4L/DVB (10730): v4l-dvb: cleanup obsolete references to v4l1 headers.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
[mchehab@redhat.com: fix compilation of tea575x-tuner.c]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:59 -03:00
Roel Kluin 51ca3bddf3 V4L/DVB (10657): [PATCH] V4L: missing parentheses?
Add missing parentheses

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:51 -03:00
Oldřich Jedlička cb3bf504f7 V4L/DVB (10632): Added support for AVerMedia Cardbus Hybrid remote control
Added support for I2C device at address 0x40 and subaddress 0x0d/0x0b
that provides remote control key reading support for AVerMedia Cardbus
Hybrid card, possibly for other AVerMedia Cardbus cards.

The I2C address 0x40 doesn't like the SAA7134's 0xfd quirk, so it was
disabled.

[mchehab@redhat.com: CodingStyle fixes]
Signed-off-by: Oldřich Jedlička <oldium.pro@seznam.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:49 -03:00
Roel Kluin 7d979a86a9 V4L/DVB: calibration still successful at 10
With while (i++ < 10) { ... } i can reach 11, so callibration still
succeeds at i == 10.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:49 -03:00
Mauro Carvalho Chehab 9fc2c5ee5d V4L/DVB (10515): Adds IR table for the IR provided with this board and includes it at
Kaiomy entry.

Thanks to Peter Senna Tschudin <peter.senna@gmail.com> for borrow me one
of those devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:43 -03:00
Mauro Carvalho Chehab 3106381440 V4L/DVB (10505): tda8290: Print an error if i2c_gate is not provided
While here, be sure that gate will be kept disabled if an error occurs.

Cc: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:42 -03:00
Mauro Carvalho Chehab 68d5ce7021 V4L/DVB (10504): tda827x: Be sure that gate will be open/closed at the proper time
The gate control logic is broken: several routines just keep it open;
other rotines close it properly; there are even other routines that
assumes that it is open without really checking or opening it.

Instead of having to manually handle the gate control and having such
troubles, let a sub-routine take care of the gate, opening it before
i2c_transfer and closing it after that. This avoids leaving the gate
into a random state.

Cc: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:42 -03:00
Hans Verkuil 230b65f994 V4L/DVB (10502): saa7146: move v4l2 device registration to saa7146_vv.
Doing the v4l2_device registration in the saa7146 core will make it
dependent on v4l2, even for DVB-only boards. This registration and
unregistration belongs in saa7146_vv instead.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:42 -03:00
Hans Verkuil eae4d69b6a V4L/DVB (10501): saa7146: prevent unnecessary loading of v4l2-common.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:42 -03:00
Hans Verkuil 5a5b9647af V4L/DVB (10500): saa7146: setting control while capturing should return EBUSY, not EINVAL.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:42 -03:00
Hans Verkuil 1b8dac150a V4L/DVB (10499): saa7146: convert saa7146 and mxb in particular to v4l2_subdev.
Modified mxb to load the i2c modules through v4l2_subdev. So no more probing.
Modified tea6415c and tea6420 to use the standard routing ops to do the
routing, rather than using private commands. Dropped the private commands
from tda9840 (they were never used except during initialization of the
module).

Added saa7146 support for VIDIOC_DBG_G_CHIP_IDENT.

Converted saa5246a and saa5249 to v4l2_subdev.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:42 -03:00
Hans Verkuil d30e21ddcd V4L/DVB (10498): saa7146: the adapter class will be NULL when v4l2_subdev is used.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:42 -03:00
Hans Verkuil 45d809431d V4L/DVB (10497): saa7146: i2c adapdata now points to v4l2_device.
Prepare for converting to v4l2_subdev.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:41 -03:00
Hans Verkuil ef77a26be1 V4L/DVB (10496): saa7146: implement v4l2_device support.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:41 -03:00
Jochen Friedrich b72dbaefbd V4L/DVB (10452): Add Freescale MC44S803 tuner driver
Add Freescale MC44S803 tuner driver.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:39 -03:00
Hans Verkuil d0852ed27c V4L/DVB (10313): saa7146: fix VIDIOC_ENUMSTD.
The previous conversion to video_ioctl2 broke VIDIOC_ENUMSTD. This
is now fixed.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:27 -03:00
Hans Verkuil b960074fec V4L/DVB (10271): saa7146: convert to video_ioctl2.
The conversion to video_ioctl2 is the first phase to converting this driver
to the latest v4l2 framework.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:24 -03:00
Matt LaPlante 692105b8ac trivial: fix typos/grammar errors in Kconfig texts
Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-30 15:22:01 +02:00
Mauro Carvalho Chehab ef88f2b563 V4L/DVB (10527): tuner: fix TUV1236D analog/digital setup
As reported by David Engel <david@istwok.net>, ATSC115 doesn't work
fine with mythtv. This software opens both analog and dvb interfaces of
saa7134.

What happens is that some tuner commands are going to the wrong place,
as shown at the logs:

Feb 12 20:37:48 opus kernel: tuner-simple 1-0061: using tuner params #0 (ntsc)
Feb 12 20:37:48 opus kernel: tuner-simple 1-0061: freq = 67.25 (1076), range = 0, config = 0xce, cb = 0x01
Feb 12 20:37:48 opus kernel: tuner-simple 1-0061: Freq= 67.25 MHz, V_IF=45.75 MHz, Offset=0.00 MHz, div=1808
Feb 12 20:37:48 opus kernel: tuner 1-0061: tv freq set to 67.25
Feb 12 20:37:48 opus kernel: tuner-simple 1-000a: using tuner params #0 (ntsc)
Feb 12 20:37:48 opus kernel: tuner-simple 1-000a: freq = 67.25 (1076), range = 0, config = 0xce, cb = 0x01
Feb 12 20:37:48 opus kernel: tuner-simple 1-000a: Freq= 67.25 MHz, V_IF=45.75 MHz, Offset=0.00 MHz, div=1808
Feb 12 20:37:48 opus kernel: tuner-simple 1-000a: tv 0x07 0x10 0xce 0x01
Feb 12 20:37:48 opus kernel: tuner-simple 1-0061: tv 0x07 0x10 0xce 0x01

This happens due to a hack at TUV1236D analog setup, where it replaces
tuner address, at 0x61 for 0x0a, in order to save a few memory bytes.

The code assumes that nobody else would try to access the tuner during
that setup, but the point is that there's no lock to protect such
access. So, this opens the possibility of race conditions to happen.

Instead of hacking tuner address, this patch uses a temporary var with
the proper tuner value to be used during the setup. This should save
the issue, although we should consider to write some analog/digital
lock at saa7134 driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-02-17 09:43:08 -03:00
Hans Verkuil ba3ed4c57f V4L/DVB (10270): saa7146: fix unbalanced mutex_lock/unlock
The default case of the switch didn't unlock the mutex.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-29 08:47:01 -02:00
Hans Verkuil cf8e193a48 V4L/DVB (10248): v4l-dvb: fix a bunch of compile warnings.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-29 08:38:04 -02:00
Michael Krufky 439b72b69e V4L/DVB (10182): tda8290: fix TDA8290 + TDA18271 initialization
Don't call tda8290_init_tuner unless we have either a TDA8275 or TDA8275A
present. Calling this function will cause a TDA18271 to get sick, so we
should only call it when needed.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07 22:18:55 -02:00
Mauro Carvalho Chehab 4c27f1a4da V4L/DVB (10179): tda8290: Fix two sparse warnings
/home/v4l/master/v4l/tda8290.c:233:7: warning: symbol 'i' shadows an earlier one
/home/v4l/master/v4l/tda8290.c:178:3: warning: symbol 'fm_mode' was not declared. Should it be static?

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07 22:18:55 -02:00
Michael Krufky 6b55009e1d V4L/DVB (10170): tuner-simple: prevent possible OOPS caused by divide by zero error
A user reported the following OOPS with his pcHDTV HD5500 card, which
uses a cx88 PCI bridge with a LG-TDVS-H06xF frontend module, made up
of a TUA6034 tuner, TDA988x IF demod, and LG DT3303 ATSC/QAM demod.

Somehow, tuner-core gets loaded before the digital driver configures
the tuner, and tuner-core somehow incorrectly sets the tuner type to
LG NTSC (TAPE series) instead of LG TDVS-H06xF.  This tuner type does
not have the tuning stepsize defined, so an OOPS occurs during the
digital tune function.

We still dont know how the type gets set incorrectly in the first place.
The user has a tainted kernel with a binary nividia module, which COULD
have something to do with this, but it's hard to say for sure.

Nevertheless, to avoid this division by zero, we should check that
stepsize is defined.  If stepsize is not defined, print an error and
bail out on the tune request.

cx8800 0000:05:01.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
cx88[0]: subsystem: 7063:5500, board: pcHDTV HD5500 HDTV [card=47,autodetected], frontend(s): 1
cx88[0]: TV tuner type 47, Radio tuner type -1
tuner' 2-0043: chip found @ 0x86 (cx88[0])
tda9887 2-0043: creating new instance
tda9887 2-0043: tda988[5/6/7] found
tuner' 2-0061: chip found @ 0xc2 (cx88[0])
tuner-simple 2-0061: creating new instance
tuner-simple 2-0061: type set to 47 (LG NTSC (TAPE series))
cx88[0]/0: found at 0000:05:01.0, rev: 5, irq: 19, latency: 32, mmio: 0xea000000
cx88[0]/0: registered device video1 [v4l2]
cx88[0]/0: registered device vbi1
cx88_audio 0000:05:01.1: PCI INT A -> GSI 19 (level, low) -> IRQ 19
cx88[0]/1: CX88x/0: ALSA support for cx2388x boards
cx88[0]/2: cx2388x 8802 Driver Manager
cx88-mpeg driver manager 0000:05:01.2: PCI INT A -> GSI 19 (level, low) -> IRQ 19
cx88[0]/2: found at 0000:05:01.2, rev: 5, irq: 19, latency: 32, mmio: 0xec000000
cx8802_probe() allocating 1 frontend(s)
cx88/2: cx2388x dvb driver version 0.0.6 loaded
cx88/2: registering cx8802 driver, type: dvb access: shared
cx88[0]/2: subsystem: 7063:5500, board: pcHDTV HD5500 HDTV [card=47]
cx88[0]/2: cx2388x based DVB/ATSC card
tuner-simple 2-0061: attaching existing instance
tuner-simple 2-0061: type set to 64 (LG NTSC (TAPE series))
tda9887 2-0043: attaching existing instance
DVB: registering new adapter (cx88[0])
DVB: registering adapter 0 frontend 0 (LG Electronics LGDT3303 VSB/QAM Frontend)...
[snip]
stepsize=0
divide error: 0000 [1] SMP
CPU 1
Modules linked in: nls_utf8 fuse sco bridge stp bnep l2cap bluetooth sunrpc nf_conntrack_netbios_ns nf_conntrack_ftp ip6t_REJECT nf_conntrack_ipv6 ip6table_filter ip6_tables ipv6 cpufreq_ondemand acpi_cpufreq freq_table xfs lgdt330x dm_multipath cx88_dvb cx88_vp3054_i2c uinput tda9887 tda8290 snd_emu10k1_synth snd_emux_synth snd_seq_virmidi snd_seq_midi_emul tuner_simple tuner_types tuner msp3400 cx8800 cx88_alsa cx8802 snd_emu10k1 cx88xx snd_rawmidi snd_ac97_codec ir_common ac97_bus saa7115 snd_seq_dummy snd_seq_oss snd_seq_midi_event videobuf_dvb snd_seq dvb_core snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_device videobuf_dma_sg ppdev parport_pc snd_timer videobuf_core snd_page_alloc btcx_risc emu10k1_gp ivtv i2c_algo_bit cx2341x snd_util_mem snd_hwdep nvidia(P) gameport v4l2_common i2c_i801 snd soundcore parport videodev v4l1_compat v4l2_compat_ioctl32 tveeprom i2c_core pcspkr iTCO_wdt iTCO_vendor_support sky2 joydev floppy shpchp ata_generic pata_acpi pata_jmicron [last unloaded: microcode]
Pid: 3553, comm: kdvb-ad-0-fe-0 Tainted: P          2.6.27.9-159.fc10.x86_64 #1
RIP: 0010:[<ffffffffa09bc37a>]  [<ffffffffa09bc37a>] simple_dvb_calc_regs+0xab/0x281 [tuner_simple]
RSP: 0018:ffff8800605dfd30  EFLAGS: 00010246
RAX: 000000000365c040 RBX: ffff8800605dfdb0 RCX: ffff88007acb8c10
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000246
RBP: ffff8800605dfda0 R08: ffff8800605dfba0 R09: 0000000000000082
R10: 00000010e73c9df1 R11: 0000000100000000 R12: ffff88007ac29c00
R13: ffff88007ac29c00 R14: ffff88007acbb408 R15: ffffffffa09b6fb0
FS:  0000000000000000(0000) GS:ffff88007f804880(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 00000000004e8f40 CR3: 000000007114e000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process kdvb-ad-0-fe-0 (pid: 3553, threadinfo ffff8800605de000, task ffff88006fca0000)
Stack:  ffff8800605dfd40 00000000ffffffa1 ffff88007c055860 0000000000000001
 ffff8800605dfda0 ffff8800605dfda0 ffff88007acb8c10 ffffffffa004e48c
 8e01880000000390 ffff88007acb8c10 ffff88007ac29c00 0000000000000000
Call Trace:
 [<ffffffffa004e48c>] ? i2c_transfer+0x80/0x8b [i2c_core]
 [<ffffffffa09bc768>] simple_dvb_set_params+0x3e/0x9b [tuner_simple]
 [<ffffffffa0a0335a>] lgdt330x_set_parameters+0x188/0x1b9 [lgdt330x]
 [<ffffffffa08c9116>] dvb_frontend_swzigzag_autotune+0x18e/0x1b5 [dvb_core]
 [<ffffffffa08c9f6a>] dvb_frontend_swzigzag+0x1bc/0x21e [dvb_core]
 [<ffffffffa08ca4f4>] dvb_frontend_thread+0x528/0x62b [dvb_core]
 [<ffffffff810551e1>] ? autoremove_wake_function+0x0/0x38
 [<ffffffffa08c9fcc>] ? dvb_frontend_thread+0x0/0x62b [dvb_core]
 [<ffffffff81054e9b>] kthread+0x49/0x76
 [<ffffffff810116e9>] child_rip+0xa/0x11
 [<ffffffff81010a07>] ? restore_args+0x0/0x30
 [<ffffffff81054e52>] ? kthread+0x0/0x76
 [<ffffffff810116df>] ? child_rip+0x0/0x11

Code: 48 8b 05 2a 4e 00 00 41 8b 77 1c 31 d2 0f b7 40 0a 89 f1 03 45 d0 d1 e9 03 0d 23 4e 00 00 69 c0 24 f4 00 00 8d 04 01 48 8b 4d c0 <f7> f6 8a 55 d6 88 53 04 41 89 c4 c1 e8 08 88 43 01 8a 45 d7 44
RIP  [<ffffffffa09bc37a>] simple_dvb_calc_regs+0xab/0x281 [tuner_simple]
 RSP <ffff8800605dfd30>

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-02 17:15:18 -02:00
Mauro Carvalho Chehab 0b82c5d674 V4L/DVB (10162): tuner-simple: Fix tuner type set message
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-02 17:14:44 -02:00
Hans Verkuil 069b747931 V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl.
Since internal to v4l2 the ioctl prototype is the same regardless of it
being called through .ioctl or .unlocked_ioctl, we need to convert it all
to the long return type of unlocked_ioctl.

Thanks to Jean-Francois Moine for posting an initial patch for this and
thus bringing it to our attention.

Cc: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-02 17:11:34 -02:00
Hans Verkuil bec43661b1 V4L/DVB (10135): v4l2: introduce v4l2_file_operations.
Introduce a struct v4l2_file_operations for v4l2 drivers.

Remove the unnecessary inode argument.

Move compat32 handling (and llseek) into the v4l2-dev core: this is now
handled in the v4l2 core and no longer in the drivers themselves.

Note that this changeset reverts an earlier patch that changed the return
type of__video_ioctl2 from int to long. This change will be reinstated
later in a much improved version.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-02 17:11:12 -02:00
Devin Heitmueller d553cc958a V4L/DVB (9923): xc5000: remove init_fw option
The init_fw option was broken for the HVR-950q because we would call the reset
callback inside of dvb_attach() and the callback had not been setup yet.

Michael Krufky (who added the init_fw feature) says it's no longer required,
so just remove the option completely.

Thanks to user Zzeiss from #linuxtv chat for reporting the issue and
Michael Krufky <mkrufky@linuxtv.org> for proposing the fix.

Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Acked-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:39:19 -02:00
Mauro Carvalho Chehab e278e746bc V4L/DVB (9913): tuner-xc2028: allow printing stack trace as debug on sleep code
tuner-xc3028 can be put to sleep to save power. However, if not properly
recovered from sleep, the device won't work. It is noticed that some
devices doesn't recover properly, so let's add a dump_stack() as a debug
option, to allow us to track when this happens.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:39:15 -02:00
Mauro Carvalho Chehab 9af0ef27a0 V4L/DVB (9775): tda8290: fix FM radio
tda8290 were using some random video standard for FM. This results on random
errors. Instead, program tda8290 in expert mode, using a configuration near the
one specified on NXP datasheet for tda8295 (available on their site).

Also, properly display that the device is on radio mode.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:19 -02:00
Mauro Carvalho Chehab 92d90f1a57 V4L/DVB (9774): tda827x: fix returned frequency
Probably due to a removed code, tda827x were doing some wrong calculus at the
returned frequency. I suspect that the original idea were to return the
programmed divisor converted into frequency again.

However, the current code is sometimes multiplying the programmed frequency by
62500, and, on other cases, like radio, it dividing it by 1000.

Instead of doing such math, let's just store the frequency value as requested by
the caller module.

Cc: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:18 -02:00
Mauro Carvalho Chehab e5218eedae V4L/DVB (9773): tda827x: fix printk message when in FM mode
Cc: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:17 -02:00
Mauro Carvalho Chehab 26d5f3a3fe V4L/DVB (9772): saa7134: Add support for Kworld Plus TV Analog Lite PCI
Thanks to Sistema Fenix (http://www.sistemafenix.com.br/) for sponsoring
this
development.

Signed-off-by: Gilberto <gilberto@sistemafenix.com.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:17 -02:00
Mauro Carvalho Chehab 10f201af1b V4L/DVB (9771): tuner-xc2028: fix a small warning
/home/mauro/v4l-dvb/v4l/tuner-xc2028.c: In function 'xc2028_sleep':
/home/mauro/v4l-dvb/v4l/tuner-xc2028.c:1111: warning: 'return' with no value, in function returning non-void

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:16 -02:00
Mauro Carvalho Chehab 74a89b2ae3 V4L/DVB (9769): tuner-xc2028: powers device of when not used
Since the firmware load is now fast on most boards, better to keep the tuner
off by default. A modprobe parameter were added to keep the old behavior,
to be used by old devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:15 -02:00
Julia Lawall 802971257a V4L/DVB (9638): drivers/media: use ARRAY_SIZE
ARRAY_SIZE is more concise to use when the size of an array is divided by
the size of its type or the size of its first element.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@i@
@@

@depends on i using "paren.iso"@
type T;
T[] E;
@@

- (sizeof(E)/sizeof(E[...]))
+ ARRAY_SIZE(E)

@depends on i using "paren.iso"@
type T;
T[] E;
@@

- (sizeof(E)/sizeof(T))
+ ARRAY_SIZE(E)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:34 -02:00
Devin Heitmueller 60245e858d V4L/DVB (9629): Add support for the ATI TV Wonder HD 600 USB Remote Control
Add support for the ATI TV Wonder HD 600 USB Remote Control
(required a new keymap)

[mchehab@redhat.com: Fix CodingStyle]
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:34 -02:00
Hans Verkuil f473bf76c7 V4L/DVB (9503): v4l: remove inode argument from video_usercopy
The inode argument was never used. Removing it from video_usercopy
brings the function pointer type of video_usercopy in line with similar
v4l2 functions, thus simplifying several drivers.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:26 -02:00
Frederic CAND b84ca9f2a0 V4L/DVB (9497): tda9887/cx88: Adds SECAM/BGH standards
Adds secam bgh support

Signed-off-by: Frederic CAND <frederic.cand@anevia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:25 -02:00
Mauro Carvalho Chehab b1f88407f3 V4L/DVB (9330): Get rid of inode parameter at v4l_compat_translate_ioctl()
The inode parameter at v4l_compat_translate_ioctl() were just passed over several
places just to keep compatible with fops.ioctl. However, it weren't used anywere.

This patch gets hid of this unused parameter.

Cc: Laurent Pinchart <laurent.pinchart@skynet.be>
Cc: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-21 14:31:45 -02:00
Hans Verkuil c6330fb86f V4L/DVB (9327): v4l: use video_device.num instead of minor in video%d
The kernel number of a v4l2 node (e.g. videoX, radioX or vbiX) is now
independent of the minor number. So instead of using the minor field
of the video_device struct one has to use the num field: this always
contains the kernel number of the device node.

I forgot about this when I did the v4l2 core change, so this patch
converts all drivers that use it in one go. Luckily the change is
trivial.

Cc: michael@mihu.de
Cc: mchehab@infradead.org
Cc: corbet@lwn.net
Cc: luca.risolia@studio.unibo.it
Cc: isely@pobox.com
Cc: pe1rxq@amsat.org
Cc: royale@zerezo.com
Cc: mkrufky@linuxtv.org
Cc: stoth@linuxtv.org
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-21 14:31:37 -02:00
Jose Alberto Reguero ca341e4d1b V4L/DVB (9272): mxl5005s: Bug fix stopped DVB-T from working the second time around.
Jose reported:

I am using a Avermedia Volar X with af9015 driver(DVB-T).

The first time you use the card, first call reconfigure with MXL_QAM,
and when tune DVB-T it calls reconfigure with MXL_DVBT. But if you close
the frontend and open again, it calls reconfigure with MXL_QAM, but not
call reconfigure with MXL_DVBT because state->current_mode don't change
(is MXL_DVBT).

Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:30:33 -03:00
Darron Broad 953cafc04e V4L/DVB (9268): tuner: add FMD1216MEX tuner
This tuner was already supported by proxy as an FMD1216ME, however,
the MEX uses a different FM Radio IF so this addition is now required.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:29:09 -03:00
Steven Toth 5c310b1360 V4L/DVB (9263): mxl5005s: Checkpatch compliance
mxl5005s: Checkpatch compliance

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:28:08 -03:00
Steven Toth 8f3cd53006 V4L/DVB (9261): xc5000: Checkpatch compliance
xc5000: Checkpatch compliance

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:27:59 -03:00
Brian Rogers ba340b40a5 V4L/DVB (9168): Add support for MSI TV@nywhere Plus remote
The IR controller has a couple quirks. It won't respond until some other
device on the bus is probed. To work around that, probe 0x50 first.
Then, since it won't respond to a zero-byte read, probe with a one-byte
read.

Signed-off-by: Brian Rogers <brian_rogers@comcast.net>
[mchehab.redhat.com: Fix merge conflicts and remove an unused var]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-13 09:57:34 -02:00
Mauro Carvalho Chehab 9b00019139 V4L/DVB (9061): saa7134: Add support for Real Audio 220
Thanks to Sistema Fenix (http://www.sistemafenix.com.br/) for sponsoring
this development.

Signed-off-by: Gilberto <gilberto@sistemafenix.com.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:37:10 -02:00
Mauro Carvalho Chehab 36f6bb97ca V4L/DVB (9060): saa7134: Add support for Avermedia PCI pure analog (M135A)
Thanks to Sistema Fenix (http://www.sistemafenix.com.br/) for sponsoring
this development.

Signed-off-by: Gilberto <gilberto@sistemafenix.com.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:37:10 -02:00
Mauro Carvalho Chehab bf1ece6a4f V4L/DVB (9059): saa7134: Add support for Encore version 5.3 board
Thanks to Sistema Fenix (http://www.sistemafenix.com.br/) for sponsoring
this development.

Signed-off-by: Gilberto <gilberto@sistemafenix.com.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:37:10 -02:00
Mauro Carvalho Chehab 0975fc6871 V4L/DVB (9055): tuner-xc2028: Do a better job selecting firmware type
Firmware selection is very tricky on this device. This patch do a better
selection of the proper firmware type, by using a code to hint if the
firmware to be loaded should be D2620 or D2633.

It also allows overriding the hint at the control structure.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:37:09 -02:00
Michael Krufky d7cba043d7 V4L/DVB (9049): convert tuner drivers to use dvb_frontend->callback
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:37:09 -02:00
Antti Palosaari 6e623433f7 V4L/DVB (8970): mt2060: implement I2C-gate control
- implement I2C-gate control

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:37:02 -02:00
Julia Lawall c87994db01 V4L/DVB (8954): common/tuners: Drop code after return or goto
The break after the return or goto serves no purpose.

Signed-off-by: Julia Lawall <julia@diku.dk>
Reviewed-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:37:01 -02:00
Michael Krufky 3065096190 V4L/DVB (8951): xc5000: dont pass devptr in xc5000_attach()
Dont pass devptr in xc5000_attach, dont store it in xc5000_priv.
This pointer is passed into the tuner_callback function, which always
expects a pointer to fe->dvb->priv or i2c_adapter->algo_data.

This prevents future possible bugs in new drivers, such as using a "devptr"
other that the standard fe->dvb->priv in a DVB driver.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:37:01 -02:00
Michael Krufky 2a6003c207 V4L/DVB (8950): xc5000: prevent an OOPS if analog driver is unloaded while digital is in use
Prevent an OOPS if xc5000_attach was called by tuner.ko before being called by
the DVB adapter driver. The OOPS occurs when a digital tune request is made
after tuner.ko is unloaded.

When tuner.ko is unloaded, it takes the xc5000_config structure with it.

Rather than storing a pointer to the xc5000_config structure, just store the
if_khz and tuner_callback inside the xc5000_priv internal state structure.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:37:01 -02:00
Michael Krufky 89fd28545c V4L/DVB (8949): xc5000: allow multiple driver instances for the same hardware to share state
Convert xc5000 to use the hybrid_tuner_request_state and
hybrid_tuner_release_state macros to manage state sharing between
hybrid tuner instances.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:37:01 -02:00
Michael Krufky ffb412346b V4L/DVB (8948): xc5000: kill xc5000_priv.h
move struct xc5000_priv into xc5000.c and delete xc5000_priv.h

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:37:00 -02:00
Hans Verkuil 601e9444f2 V4L/DVB (8786): v4l2: remove the priv field, use dev_get_drvdata instead
Remove the priv field and let video_get/set_drvdata use dev_get_drvdata
and dev_set_drvdata instead.

Convert all drivers that still used priv directly.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:36:54 -02:00
Hans Verkuil 614b147b4f V4L/DVB (8745): v4l2: fix a bunch of compile warnings.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:36:52 -02:00
Mauro Carvalho Chehab 7d341a6a52 V4L/DVB (8628): bttv: Add support for Encore ENLTV2-FM
Thanks to Sistema Fenix (http://www.sistemafenix.com.br/) and CDI Brasil
(www.cdibrasil.com.br/) for sponsoring this development.

Signed-off-by: Gilberto <gilberto@sistemafenix.com.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-10-12 09:36:47 -02:00
Mauro Carvalho Chehab 8f2b7b7060 V4L/DVB (8626): Add support for TCL tuner MF02GIP-5N-E
Thanks to Sistema Fenix (http://www.sistemafenix.com.br/) and CDI Brasil
(www.cdibrasil.com.br/) for sponsoring this development.

Signed-off-by: Gilberto <gilberto@sistemafenix.com.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:36:47 -02:00
Devin Heitmueller 5ea7fe48a9 V4L/DVB (8967): Use correct XC3028L firmware for AMD ATI TV Wonder 600
The AMD ATI TV Wonder 600 has an XC3028L and *not* an XC3028, so we need to
load the proper firmware to prevent the device from overheating.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-04 22:43:41 -03:00
Steven Toth 6d8976164d V4L/DVB (8805): Steven Toth email address change
I need this so I can better isolate my linux email from my
corporate email.

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-09-03 18:37:21 -03:00
Hans Verkuil c6eb8eafdb V4L/DVB (8757): v4l-dvb: fix a bunch of sparse warnings
Fixed a lot of sparse warnings: mostly warnings about shadowed variables
and signed/unsigned mismatches.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-09-03 18:37:13 -03:00
Mauro Carvalho Chehab f3409f71a7 V4L/DVB (8549): mxl5007: Fix an error at include file
mxl5007 was forcing for its compilation:

In file included from drivers/media/common/tuners/mxl5007t.c:25:drivers/media/common/tuners/mxl5007t.h:80:1: warning: "CONFIG_MEDIA_TUNER_MXL5007T" redefined
In file included from <command-line>:0:
./include/linux/autoconf.h:2782:1: warning: this is the location of the previous definition

Probably, some temporary hack for testing.

Cc: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-27 19:36:08 -03:00
Hans Verkuil 429e90893c V4L/DVB (8546): saa7146: fix read from uninitialized memory
The offset field of the scatterlist entry *after* the last valid scatterlist
entry was used instead of the first scatterlist entry (as was the intention
of this code).

This worked fine until the kzalloc of the sglist was replaced with kmalloc
and sg_init_table only zeroed the exact needed length. Apparently kzalloc
zeroes a bit more than is strictly necessary so the offset field was
always 0 in the past.

But now the offset field was suddenly random and this led to broken captures.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-27 18:07:58 -03:00
Adrian Bunk 445c2714cf V4L/DVB (8534): remove select's of FW_LOADER
After commit d9b19199e4
(always enable FW_LOADER unless EMBEDDED=y) we can remove
the FW_LOADER select's and corresponding dependencies
on HOTPLUG.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-27 12:24:37 -03:00
Michael Krufky 74b9ef2116 V4L/DVB (8532): mxl5007t: remove excessive locks
The use of mutex locking is overly paranoid in this driver.
The only locks we need are around the manipulation of the
register arrays. The other locks are not needed - remove them.

Thanks to Steven Toth for pointing this out.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-27 11:07:35 -03:00
Michael Krufky c39c1fd293 V4L/DVB (8531): mxl5007t: move i2c gate handling outside of mutex protected code blocks
There is no reason to protect the i2c gate handling within the mxl5007t
state mutex.

Thanks to Steven Toth for pointing this out.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-27 11:07:33 -03:00
Michael Krufky 452a53a247 V4L/DVB (8529): mxl5007t: enable _init and _sleep power management functionality
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-27 11:07:30 -03:00
Michael Krufky 2a83e4d5e4 V4L/DVB (8528): add support for MaxLinear MxL5007T silicon tuner
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Asaf Fishov <afishov@maxlinear.com>
Signed-off-by: Charles Kim <ckim@maxlinear.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-27 11:07:18 -03:00
Hans Verkuil f796804f01 V4L/DVB (8526): saa7146: fix VIDIOC_ENUM_FMT
VIDIOC_ENUM_FMT should keep the index and type fields. Instead,
type was zeroed.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-27 11:07:14 -03:00
Hans Verkuil 0ea6bc8d43 V4L/DVB (8523): v4l2-dev: remove unused type and type2 field from video_device
The type and type2 fields were unused and so could be removed.
Instead add a vfl_type field that contains the type of the video
device.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-27 11:07:10 -03:00
roel kluin 1ffdddd6fa V4L/DVB (8493): mt20xx: test below 0 on unsigned lo1a and lo2a
lo1a and lo2a are unsigned ints so these tests won't work.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-26 13:18:19 -03:00
Hans Verkuil f894dfd735 V4L/DVB (8488): videodev: remove some CONFIG_VIDEO_V4L1_COMPAT code from v4l2-dev.h
The video_device_create_file and video_device_remove_file functions can be
removed from v4l2-dev.h, removing the dependency on videodev.h in v4l2-dev.h.

Also removed a few more videodev.h includes that should have been videodev2.h.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-26 13:18:11 -03:00
Mauro Carvalho Chehab 4db16db4f6 V4L/DVB (8394): ir-common: CodingStyle fix: move EXPORT_SYMBOL_GPL to their proper places
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20 07:28:59 -03:00
Hans Verkuil f87086e302 v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10
Also remove some blank lines that were used to split compat code at -devel
tree.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20 07:17:52 -03:00
Al Viro 84a9f33614 V4L/DVB (8136): xc2028 unaligned access fixes
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20 07:13:50 -03:00
Al Viro a36ef6b1e0 V4L/DVB (8128): saa7146: ->cpu_addr and friends are little-endian
Annotations + stop saa7146_i2c from playing fast and loose with
reuse of ->cpu_addr for host-endian.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20 07:13:14 -03:00
Michael Krufky 7dc1b8844e V4L/DVB (8098): xc5000: add module option to load firmware during driver attach
The xc5000 firmware download process can be slow on certain devices.

Add a module option, "init_fw" to perform the firmware download during
xc5000_attach(), which would get the firmware download over with well
before any tune request is made.

When this option is enabled, it will reduce the time it takes to get a
signal lock during the first tune after driver load, but will add a few
seconds to the driver initialization.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20 07:11:40 -03:00
Michael Krufky fb733bf523 V4L/DVB (8060): Kconfig: MEDIA_TUNER_CUSTOMIZE should be disabled by default
The build option, MEDIA_TUNER_CUSTOMIZE, allows us to disable tuner drivers
that would have otherwise been selected by default.  This is an advanced
customization option that should be disabled by default.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20 07:10:05 -03:00
Michael Krufky 26151c32d3 V4L/DVB (7984): tda18271: update filename in comments
This file was renamed but we forgot to change it in the comments.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20 07:08:05 -03:00
David Woodhouse c63e87e90a tuners: treat firmware data as const
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2008-07-10 14:26:36 +01:00
Steven Toth e470d8177e V4L/DVB (8097): xc5000: check device hardware state to determine if firmware download is needed
This patch ensures that the xc5000 will have firmware loaded as needed if the
part is powered down or reset via gpio from the host. An example of this, in
some cases, could be after the system resumes from standby or hibernate modes.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-26 15:58:58 -03:00
Tim Farrington 6e501a3f4a V4L/DVB (8048): saa7134: Fix entries for Avermedia A16d and Avermedia E506
Also, adds IR table for Avermedia A16d

Signed-off-by: Tim Farrington <timf@iinet.net.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-26 15:58:52 -03:00
Michael Krufky 7ae1ac4c1d V4L/DVB (8037): tda18271: ensure that the thermometer is off during channel configuration
Having the thermometer on during channel configuration
could cause tuning instability.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-26 15:58:50 -03:00
Michael Krufky 51858d1361 V4L/DVB (8036): tda18271: toggle rf agc speed mode on TDA18271HD/C2 only
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-26 15:58:49 -03:00
Michael Krufky 119a7c7e34 V4L/DVB (8035): tda18271: dont touch EB14 if rf_cal lookup is out of range
The TDA18271HD/C1 rf_cal map lookup is expected to go out of range outside
of the frequency window 41 MHz - 61.1 MHz.  In these cases, the internal
RF tracking filters calibration mechanism is used.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-26 15:58:49 -03:00
Michael Krufky 44e645c203 V4L/DVB (8034): tda18271: fix IF notch frequency handling
The IF notch bit gets unset when we update the Main Post Div register
value, before we have a chance to write the desired IF notch setting
to the tuner.  Move the IF notch configuration to after we update MPD.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-26 15:58:48 -03:00
Sigmund Augdal 67642a0a58 V4L/DVB (8000): tda827x: fix NULL pointer in tda827xa_lna_gain
Check that tda827x_config is defined before attempting to use it.

Signed-off-by: Sigmund Augdal <sigmund@snap.tv>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-05 10:26:19 -03:00
Michael Krufky fc60d6e272 V4L/DVB (7983): tda18271_calc_rf_cal must return the return value of tda18271_lookup_map
On the TDA18271HD/C1, we perform RF tracking filter correction for VHF low
band, only. If supplied a frequency out of range, the error must be returned
to the caller (tda18271c1_rf_tracking_filter_calibration) so that it can
decide whether or not to write to register EB14, RFC_CPROG[7:0]

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-05 06:35:54 -03:00
Ingo Molnar 6637dea60e V4L/DVB (7974): fix MEDIA_TUNER && FW_LOADER build error
-tip testing found the following build failure:

  LD      .tmp_vmlinux1
  drivers/built-in.o: In function `generic_set_freq':
  tuner-xc2028.c:(.text+0xbd896): undefined reference to `request_firmware'
  tuner-xc2028.c:(.text+0xbdd7a): undefined reference to `release_firmware'
  drivers/built-in.o: In function `xc_load_fw_and_init_tuner':
  xc5000.c:(.text+0xc68e6): undefined reference to `request_firmware'
  xc5000.c:(.text+0xc6abe): undefined reference to `release_firmware'

with this config:

  http://redhat.com/~mingo/misc/config-Tue_May_20_18_11_34_CEST_2008.bad

the reason is another kconfig tool bug that has to be worked around in
the driver's Kconfig file: if FW_LOADER is selected in a second
dependency, that is not properly propagated up the dependencies.

in this case, FW_LOADER is selected from MEDIA_TUNER_XC2028:

  config MEDIA_TUNER_XC2028
        tristate "XCeive xc2028/xc3028 tuners"
        depends on VIDEO_MEDIA && I2C
        depends on HOTPLUG
        select FW_LOADER

which got selected by MEDIA_TUNER:

  config MEDIA_TUNER
        tristate
        default VIDEO_MEDIA && I2C
        depends on VIDEO_MEDIA && I2C
        select FW_LOADER if !MEDIA_TUNER_CUSTOMIZE && HOTPLUG

but the kconfig tool did not pick up this second-order dependency and
allowed CONFIG_FW_LOADER=m to be selected - in which case the build
fails.

the workaround i found was to move the select of FW_LOADER one level up,
so that the buggy kconfig tool can notice it and can act appropriately.
This problem can probably be worked around in other ways as well, i went
for the minimal fix.

Obviously, the kconfig tool should be fixed, it is not reasonable to
expect driver authors to do manual dependency resolution (that kconfig
itself already does) and uglify the Kconfig files. The kconfig tool did
nothing to warn about this situation and did not prevent this faulty
.config from being constructed.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-05 06:35:53 -03:00
Michael Krufky c663d03590 V4L/DVB (7944): tuner-xc2028: use hybrid_tuner_request_state
Use a standard method to manage multiple instances of a hybrid tuner.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-05 06:35:46 -03:00
Michael Krufky 9adea1c00d V4L/DVB (7943): tuner: add macro, hybrid_tuner_report_instance_count
Create a macro to report the number of instances of the tuner driver
currently in use.  This will allow drivers to perform specific cleanups
before destroying the last instance of a tuner.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-05 06:35:46 -03:00
Andy Walls 3b4a9714f4 V4L/DVB (7922): tuner-simple: fix tuner_warn() induced kernel oops in simple_tuner_attach()
The tuner_warn() macro relies on the local variable "priv" to be a valid
pointer.  There was a case in simple_tuner_attach() where this cannot be the
case yet, so tuner_warn() would dereference a NULL "priv" pointer.  Changed
the tuner_warn() to a printk() with the originally intended output format.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-05 06:35:44 -03:00
Adrian Bunk 38db143e6f V4L/DVB (7906): tuners/mxl5005s.c: don't define variables for enums
It doesn't seem to be intended that "tuner_modu_type" and
"MXL5005_ControlName" were global variables.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-05 06:35:42 -03:00
Marcin Slusarz 4277106b4f V4L/DVB (7902): fix handling of tea5761_autodetection return value
tea5761_autodetection returns -EINVAL on error

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-05 06:35:40 -03:00
Mauro Carvalho Chehab 2ea336dc11 V4L/DVB (7899): Fixes a few remaining Kbuild issues at common/tuners
- MEDIA_ATTACH now applies also for V4L;

- select a FW_LOADER dependent driver should happen only if HOTPLUG;

- apply the common tuner dependency to all tuners. This helps to avoid latter
  issues.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:56:47 -03:00
Michael Krufky 48723543af V4L/DVB (7893): xc5000: bug-fix: allow multiple devices in a single system
The current code passes a context pointer in the xc5000_config struct.
This context pointer is used in the tuner_callback function, used to
reset the device after firmware download.

The xc5000_config struct is a static structure, whose .priv member was
being assigned before calling xc5000_attach().  If there are more than
one of the same device type installed on a single system, the last one
to assign xc5000_config.priv will "win", and all others will cease to
function properly.

This patch passes the context pointer in xc5000_attach() rather that
storing it within the static struct xc5000_config.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:56:46 -03:00
Steven Toth 9426954277 V4L/DVB(7878): mxl55005s: Makefile and Kconfig additions
Makefile and Kconfig additions

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:56:42 -03:00
Steven Toth 77ad55ec21 V4L/DVB(7877): mxl5005s: Ensure debug is off
Ensure debug is off

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:56:41 -03:00
Steven Toth 7fa2a1462f V4L/DVB(7876): mxl5005s: Remove incorrect copyright holders
I was informed by Jan Hoogenraad that two people needed to be removed
from the original copyright comments.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:56:41 -03:00
Steven Toth 90257e787f V4L/DVB(7875): mxl5005s: Remove redundant functions
Remove redundant functions

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:56:40 -03:00