1
0
Fork 0
Commit Graph

376 Commits (28f27dcbd255b44a30bf75bb438fdb3415fda4c7)

Author SHA1 Message Date
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
Steven Toth c6c34b1ffd V4L/DVB(7874): mxl5005s: Fix function statics
Fix function statics

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
Steven Toth 66321ba94f V4L/DVB(7873): mxl5005s: Fix header includes.
Ensure we have the correct .h dependencies included.

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
Steven Toth d211017b95 V4L/DVB(7872): mxl5005s: checkpatch.pl compliance
4 exceptions where the code would read very ugly otherwise.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:56:39 -03:00
Steven Toth 48937295a6 V4L/DVB(7871): mxl5005s: Re-org code and update copyrights
Re-org code and update copyrights

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:56:39 -03:00
Steven Toth 5c1b20514f V4L/DVB (7870): mxl5005s: Basic digital support.
ATSC and QAM should be working but basic testing is required.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:56:39 -03:00
Steven Toth 7f5c3affef V4L/DVB(7869): mxl5005s: Cleanup #6
Cleanup #6

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:56:38 -03:00
Steven Toth 8c66a19d45 V4L/DVB (7868): mxl5005s: Cleanup #5
Cleanup #5

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:56:38 -03:00
Steven Toth 85d220d03b V4L/DVB (7867): mxl5005s: Cleanup #4
Cleanup #4

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:56:38 -03:00
Steven Toth 3935c25484 V4L/DVB (7866): mxl5005s: Cleanup #3
Cleanup #3

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