History log of /drivers/media/common/tuners/xc4000.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8a538a8855aa95e5a12ae232a140e6b30c56d0c5 21-Dec-2011 Miroslav Slugen <thunder.mmm@gmail.com> [media] xc4000: add support for signal strength measures

In xc4000 chipsets real signal and noise level is stored in register
0x0A and 0x0B,so we can use those registers to monitor signal strength.

I tested this patch on 2 different cards Leadtek DVR3200 and DTV2000H
Plus, both with same results, I used special antenna hubs (toner 4x, 6x,
8x and 12x) with mesured signal lost, both registers are in dB value,
first represent signal with limit value -113.5dB (should be -114dB) and
exactly match with test results. Second represents noise level also in
dB and there is no maximum value, but from tests we can drop everything
above 32dB which tuner realy can't use, signal was usable till 20dB
noise level.

In digital mode we can take signal strength but sadly noise level is not
relevant and real value is stored in demodulator for now just zl10353,
also digital mode is just for testing, because it needs changing other
parts of code which reads data only from demodulator.

In analog mode I was able to test only FM radio, signal level is not
important, it says something about cable and hub losts, but nothing
about real quality of reception, so even if we have signal level at
minimum 113dB we can still here radio, because of that it is displaied
only in debug mode, but for real signal level is used noise register
which is again very accurate, radio noise level was betwen 6-20dB for
good signal, 20-25dB for medium signal, and above 25dB signal is
unusable.

For now real benefit of this patch is only for FM radio mode.

Signed-off-by: Miroslav Slugen <thunder.mmm@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
c6f56e7d794cba022353d464dfa3383d1b3e0125 27-Dec-2011 Mauro Carvalho Chehab <mchehab@redhat.com> [media] dvb: don't use DVBv3 bandwidth macros

Every frontend now uses DVBv5 way. So, let's not use the DVBv3
macros internally anymore.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
14d24d148c7521b2b88b396652e36f55d061e195 24-Dec-2011 Mauro Carvalho Chehab <mchehab@redhat.com> [media] tuners: remove dvb_frontend_parameters from set_params()

This is a big patch, yet trivial: now that all tuners use the DVBv5
way to pass parameters (e. g. via fe->dtv_property_cache), the
extra parameter can be removed from set_params() call.

After this change, very few DVBv3 specific stuff are left at the
tuners.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
40d6f2b83788cfc125867c8c7a7a0b32c72d9e54 21-Dec-2011 Mauro Carvalho Chehab <mchehab@redhat.com> [media] xc4000: use DVBv5 parameters on set_params()

Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
1b7acf0ccd61b814032668d1d21740cfae3304e3 29-Nov-2011 Thomas Meyer <thomas@m3y3r.de> [media] xc4000: Use kcalloc instead of kzalloc to allocate array

The advantage of kcalloc is, that will prevent integer overflows which could
result from the multiplication of number of elements and size and it is also
a bit nicer to read.

The semantic patch that makes this change is available
in https://lkml.org/lkml/2011/11/25/107

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
941830c9278a72e31389eb04cdfc397f66866de0 06-Jun-2011 Mauro Carvalho Chehab <mchehab@redhat.com> [media] xc4000: make checkpatch.pl happy

Solve the ./scripts/checkpatch.pl compliants for the patches
that added xc4000 support, including a few changes at dib0700.

While here, remove a few printk noise by converting some msgs
into debug ones.

Cc: Istvan Varga <istvan_v@mailbox.hu>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
8edeb6eb1ae113b8f25a79e5076c1a1ec93538d0 06-Jun-2011 istvan_v@mailbox.hu <istvan_v@mailbox.hu> [media] xc4000: removed card_type

Removed the use of 'card_type' from the tuner configuration structure, and
replaced it with separate parameters to set board-specific configuration.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
09f4634293f2d48a9619f51b104bef8e6cc6d559 06-Jun-2011 istvan_v@mailbox.hu <istvan_v@mailbox.hu> [media] xc4000: check firmware version

Enabled code to check if the version of the firmware reported by the hardware
is correct after uploading it.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
341747bef5dd2e2f56647ba30ea2180752905fa0 06-Jun-2011 istvan_v@mailbox.hu <istvan_v@mailbox.hu> [media] xc4000: code cleanup

Various coding style changes:
- removed unused / commented out code
- changed C++ style comments to C format
- renamed functions and variables that included upper case letters in the name
- removed tabs from module parameter descriptions
- replaced the use of XC_RESULT_* with standard error codes

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
7db98fe66be035494912b6b2c4e9c1e3abfedfe5 04-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: detect also xc4100

Added code to detect the XC4100 chip, which is presumably an analog-only
"value" version of the XC4000. It is not sure, however, if any devices
using this have actually been produced and sold, so the patch may be
unneeded.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
8f76afe8d737b9ecadc0097941c9ef1ece61af9e 04-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: removed redundant tuner reset

This patch causes the tuner reset command to be ignored in the firmware
code, since this only happens when the BASE/INIT1 firmware is loaded by
check_firmware(), and in that case check_firmware() already calls the
reset callback before starting to load the firmware.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
e75873c1f80380f190d0270fec566410f59c4829 04-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: xc_tune_channel() cleanup

Minor coding changes related to the xc_tune_channel() function.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
818a1776a45c230c4f230c8e4e2d0c7bdf5f8fa3 04-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: implemented analog TV and radio

The following patch implements support for analog TV and FM radio.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
923137a4037d1b9f19d175708eeced209dff9320 04-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: added audio_std module parameter

The 'audio_std' module parameter makes it possible to fine tune
some audio related aspects of the driver, like setting the exact
audio standard (NICAM, A2, etc.) to be used for some video standards.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
30f544ec56eefc628e73e23324dc18105ad13012 04-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: setting registers

This patch implements setting the registers in xc4000_set_params()
and xc4000_set_analog_params(). A new register is defined which enables
filtering of the composite video output (this is needed to avoid bad
picture quality with some boards).

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
f4312e2fd4ca44e1defad1637d054bbe11a4ade6 04-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: debug message improvements

The following patch makes a few minor changes to the printing
of debug messages, and reporting the tuner status. The 'debug'
module parameter can now be set from 0 to 2 to control the
verbosity of debug messages.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
027fd361860e40736c0ad093a8f4194d727afb63 04-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: firmware initialization

This patch fixes/cleans up the loading of the firmware file when the
driver is loaded and initialized.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
5272f6b1f423d4ce636dc90f190e245897bdb045 04-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: implemented power management

The following patch implements the xc4000_sleep() function.
The 'no_powerdown' module parameter is now interpreted differently:
- 0 uses a device-specific default
- 1 disables power management like before
- 2 enables power management

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
0b4021321c0536a3368746497686ce56e5bcf3e5 03-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: added card_type

This patch adds support for selecting a card type in struct
xc4000_config, to allow for implementing some card specific code
in the driver.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
595a83f49a7536f43a68cab78098d5ad11d1c51f 04-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: check_firmware() cleanup

This patch makes the following fixes in check_firmware():
- there is only one BASE and INIT1 firmware for XC4000
- loading SCODE is needed also for FM radio

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
ffce6266c8be9076947462c688ad3a3099c83eeb 04-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: simplified load_scode

Removed unused code from load_scode() (all SCODE firmwares are
assumed to have the HAS_IF bit set).

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
3db9570482f368cd2f62c258802da21667ec6198 04-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: simplified seek_firmware()

This patch simplifies the code in seek_firmware().

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
fa285bc1bf5a2ebe3252523454def096d86a064b 04-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: added firmware_name parameter

The firmware_name module parameter makes it possible to set the firmware
file name. It defaults to "xc4000.fw" if not specified.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
1368ceb266990af58a72cdb0e121eb4ff22bde6f 03-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: fixed frequency error

The xc_get_frequency_error() function reported the frequency error
incorrectly. The data read from the hardware is a signed integer, in
15625 Hz units. The attached patch fixes the bug.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
5614942bb06f5620d0d6eb67bc0268c76c5dd921 03-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: added mutex

This patch adds a mutex to xc4000_priv, to protect the driver
from being accessed by multiple processes at the same time.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
f0ef7c88ca919912011593d2392a59c2fde04748 03-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: added support for 7 MHz DVB-T

The following patch implements support for DVB-T with 7 MHz bandwidth.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
4911085fa3342d2ccb04f84c2987305b86785ebf 03-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: updated standards table

This patch makes the following changes to the standards table:
- added 'u16 int_freq' to struct XC_TV_STANDARD (needed for analog TV
and radio, 0 for DVB-T)
- added new standard for SECAM-D/K video with PAL-D/K audio
- the 'int_freq' values are now specified in the table
- changed VideoMode for NTSC and PAL-B/G standards

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
fbe4a29f2f6523b8b839debb19baa49461a302be 03-Jun-2011 Istvan Varga <istvan_v@mailbox.hu> [media] xc4000: code cleanup

This is the first of a set of patches that update the original xc4000
sources to my modified version. It removes some unused code, and makes
a few minor formatting changes.

[mchehab@redhat.com: re-add XC_TUNE_ANALOG/XC_TUNE_DIGITAL constants, to avoid compilation breakage]
Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
e3bb7c607f5ca87030692ad4dab653b4a8d1571a 02-Jun-2011 Mauro Carvalho Chehab <mchehab@redhat.com> [media] xc4000: Fix a few bad whitespaces on it

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
b6cdb5bea31c86645782950d84745bb2f95ec9ca 27-Dec-2009 Devin Heitmueller <dheitmueller@kernellabs.com> [media] xc4000: cleanup dmesg logging

Remove some printk() calls added during driver development, and demote some
other messages to debug only (to reduce dmesg chatter).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
980029eb35a6faa076f4b480a72625cd75172f44 27-Dec-2009 Devin Heitmueller <dheitmueller@kernellabs.com> [media] xc4000: rename firmware image filename

Give the xc4000 firmware filename a filename that makes more sense for public
release.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
4922cec59a1b37d49b3e01577ab2f779a13b3ae6 27-Dec-2009 Devin Heitmueller <dheitmueller@kernellabs.com> [media] xc4000: turn off debug logging by default

Don't dump debug into to dmesg by default (something I had enabled during
bringup of the xc4000 driver).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
ed23db32271997e03ea59d31839a40470a1c434b 05-Oct-2009 Devin Heitmueller <dheitmueller@kernellabs.com> [media] xc4000: get rid of hard-coded 8MHz firmware config

Remove a hack I had put in to force the firmware to be 8MHz, now setting
the firmware properly based on the target standard.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
799ed11afe7694858584d1ed4e9ae2f9e48142ec 05-Oct-2009 Devin Heitmueller <dheitmueller@kernellabs.com> [media] xc4000: handle dib0700 broken i2c stretching

It was confirmed by DibCom that i2c stretching is broken in the i2c master
on the dib7700. So we need to put a hack into the xc4000 driver to not
complain in certain very specific cases where we know i2c stretching occurs.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
fe8303647640e1183640a9b85cd60c4a981c7b4b 28-Jul-2009 Devin Heitmueller <dheitmueller@kernellabs.com> [media] xc4000: use if_khz provided in xc4000_config

Remove hard-coded references to 5400, using the value passed in when the
xc4000 is attached.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
ee4c3cd67b90cb42143e230485d3aad60768c551 28-Jul-2009 Devin Heitmueller <dheitmueller@kernellabs.com> [media] xc4000: continued cleanup of the firmware loading routine

Properly setup the standard firmware loading and scode loading, as well as
getting rid of a ton of dead code. Note that I am getting a single i2c
error when the standard firmware sets the video standard, but everything else
seems to be loading properly now.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
d0962382cf6ca55e5a33413b39a10fe2f56bae78 25-Jul-2009 Devin Heitmueller <dheitmueller@kernellabs.com> [media] xc4000: add code to do standard and scode firmware loading

Add code to handle firmware blobs for the standard and scode. Note there
appears to be some issue with loading the DTV8 standard firmware, probably
related to direct/indirect mode.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
e7490d5962ad7959c0597cd55c97ff7eae3acf82 23-Jul-2009 Devin Heitmueller <dheitmueller@kernellabs.com> [media] xc4000: remove xc5000 firmware loading routine

Since we use the xc3028 version of the firmware file parsing routine (which
includes support for scodes and separate blobs), we can drop the xc5000
version of the code.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
02dec509825dd5cb9f4bfa0526c75c0a7c20348a 23-Jul-2009 Devin Heitmueller <dheitmueller@kernellabs.com> [media] xc4000: remove XREG_BUSY code only supported in xc5000

The xc4000 driver is based on the original xc5000 driver, and while the
xc5000 supports the XREG_BUSY register, the xc4000 does not. So remove the
code in question.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
6bf60d56b36d7d4d0bdfb2996d56b064923ea541 23-Jul-2009 Devin Heitmueller <dheitmueller@kernellabs.com> [media] xc4000: properly set type for init1 firmware

We need to set the firmware type properly in order to locate the init1
firmware.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
31f880e2b99a780a4ee5fb6199e489b62e0a76ec 20-Jul-2009 Devin Heitmueller <dheitmueller@kernellabs.com> [media] xc4000: cut over to using xc5000 version for loading i2c sequences

The xc3028 version does i2c splitting in a different manner than xc4000 and
xc5000, so reuse the xc5000 version of the routine (the key here being that
xc4000 expects the first *two* bytes to be the same for splitting transactions.

Doing it the xc3028 way was resulting in i2c errors partially through the
firmware load. With this change, it would appear that the entire base firmware
is being loaded successfully (product id now properly shows 0x0FA0).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
11091a31fbf7496294795ca72d69db0233857d94 20-Jul-2009 Devin Heitmueller <dheitmueller@kernellabs.com> [media] xc4000: pull in firmware management code from xc3028

Switch over to using the firmware management routines from the tuner-xc2028,
since that has support for scodes, etc.

This code still requires signficant cleanup, and at this point the base
firmware does not load properly (i2c write errors about 300 bytes in).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c
8d009a0c41475a482aca17d2a9fc8e6965f2fdf9 24-Jun-2009 Davide Ferri <davidef1986@gmail.com> [media] dib0700: add initial code for PCTV 340e by Davide Ferri

This is initial code written by Davide Ferri for the PCTV 340e, including
a new xc4000 driver. I am checking in all the code unmodified, and making
no assertions about its quality (other than confirming it compiles).

[mchehab@redhat.com: rebased on the top of the current tree]
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Davide Ferri <davidef1986@gmail.com>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/common/tuners/xc4000.c