Commit Graph

53 Commits

Author SHA1 Message Date
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
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
Steven Toth a8214d48e6 V4L/DVB (7865): mxl5005s: Cleanup #2
Cleanup #2

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
Steven Toth 2637d5b498 V4L/DVB (7864): mxl5005s: Cleanup #1
Cleanup #1

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
Steven Toth 52c99bda04 V4L/DVB (7862): Add mxl5505s driver for MaxiLinear 5505 chipsets
Initial check-in of the original driver to establish history.

Signed-off-by: Chia-Ling Lu Developer <chialing@realtek.com.tw>
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:56:33 -03:00
Mauro Carvalho Chehab 755a18baad V4L/DVB (7851): Fix FW_LOADER depencency at v4l/dvb
Since:
1) FW_LOADER is defined as:

config FW_LOADER
        tristate "Userspace firmware loading support"
        depends on HOTPLUG

2) several V4L/DVB driver just selects it;

3) select is not smart enough to auto-select HOTPLUG, if select FW_LOADER.

So, All drivers that select FW_LOADER should also depend on HOTPLUG.

An easier solution (for the end-user perspective) would be to "select HOTPLUG".
However, live is not simple. This would cause recursive dependency issues like
this one:

drivers/usb/Kconfig:62:error: found recursive dependency: USB -> USB_OHCI_HCD
-> I2C -> MEDIA_TUNER -> MEDIA_TUNER_XC2028 -> HOTPLUG -> PCCARD -> PCMCIA ->
USB_ARCH_HAS_HCD -> MOUSE_APPLETOUCH -> USB

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:08 -03:00
Mauro Carvalho Chehab eabcaf3204 V4L/DVB (7848): Fix dependencies for tuner-xc2028 and em28xx-dvb
em28xx-dvb doesn't need FW_LOADER. Instead, tuner-xc2028 needs to select
FW_LOADER.

Also, this can happen only if HOTPLUG is selected, since FW_LOADER
is dependent on HOTPLUG.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:07 -03:00
Mauro Carvalho Chehab 3929c0f9ac V4L/DVB (7847): Simplifies Kconfig rules
Since all tuners are dependent of I2C, move I2C dependency to MEDIA_TUNER.
Also, simplifies the dependencies for the other Kconfig items.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:07 -03:00
Michael Krufky 4bd5d1071d V4L/DVB (7844): tda18271: add tda_fail macro to log error cases
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:06 -03:00
Michael Krufky 10ed0bf4af V4L/DVB (7843): tda18271: fix error handling in tda18271c1_rf_tracking_filter_calibration
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:06 -03:00
Michael Krufky 20f4206379 V4L/DVB (7842): tda18271: fix error handling in tda18271c2_rf_tracking_filters_correction
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:05 -03:00
Michael Krufky 31940e3966 V4L/DVB (7841): tda18271: fix error handling in tda18271_channel_configuration
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:05 -03:00
Michael Krufky 9c41d456e2 V4L/DVB (7840): tda18271: make tda18271_set_standby_mode less verbose for basic debug
Only show debug from tda18271_set_standby_mode if DBG_ADV is set.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:05 -03:00
Michael Krufky c151c32fd7 V4L/DVB (7839): tda18271: abort rf band calibration loop on errors
Abort rf band calibration loop for the TDA18271HD/C2 if an error is detected.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:04 -03:00
Michael Krufky 24124f784b V4L/DVB (7838): tda18271: fix error handling in tda18271c2_rf_cal_init path
fix error handling in tda18271c2_rf_cal_init immediate path

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:04 -03:00
Michael Krufky d35fccaffd V4L/DVB (7837): tda18271: fix error handling in init and sleep paths
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:04 -03:00
Michael Krufky f686d8c3b5 V4L/DVB (7832): xc5000: MEDIA_TUNER_XC5000 must select FW_LOADER
Fix the following build error:

drivers/built-in.o: In function `xc_load_fw_and_init_tuner':
xc5000.c:(.text+0x2dacd): undefined reference to `request_firmware'
xc5000.c:(.text+0x2daf0): undefined reference to `release_firmware'
xc5000.c:(.text+0x2db85): undefined reference to `release_firmware'
make[1]: *** [.tmp_vmlinux1] Error 1

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:02 -03:00
Mauro Carvalho Chehab b538d28c2e V4L/DVB (7804): tea5767: Fix error logic
As pointed by Andrew Morton, the error testing were wrong. After reviewing
tea5767, it were returning a positive value for errors.

So, the double errors were cancelling each other.

This patch fix it properly. It also considers any positive value as ok, on
tuner-core.


Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:53:58 -03:00
Mauro Carvalho Chehab ba7cc365f5 V4L/DVB (7798): tuners/Kconfig: Change config name and help to reflect dynamic load for tuners
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-30 00:22:18 -03:00
Michael Krufky a07c8779fd V4L/DVB (7789): tuner: remove static dependencies on analog tuner sub-modules
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-29 18:41:42 -03:00