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>
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>
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>
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>
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>
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>
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>
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>
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>
-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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>