History log of /linux-master/drivers/media/tuners/r820t.c
Revision Date Author Comments
# 3da3ee3f 19-Nov-2021 Daniel Kamil Kozar <dkk089@gmail.com>

media: Print chip type explicitly when loading the Rafael Micro r820t module

The module currently prints only "Rafael Micro r820t successfully
identified" when successfully loaded, which might be misleading as the
module actually supports various chip types.

Link: https://lore.kernel.org/linux-media/20211119234401.271193-1-dkk089@gmail.com

Cc: linux-kernel@vger.kernel.org, Daniel Kamil Kozar <dkk089@gmail.com>
Signed-off-by: Daniel Kamil Kozar <dkk089@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# dda1bb4e 18-Feb-2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

media: tuners: fix several typos

Use codespell to fix lots of typos over frontends.

Manually verified to avoid false-positives.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# a3f90c75 05-Jul-2018 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

media: dvb: convert tuner_info frequencies to Hz

Right now, satellite tuner drivers specify frequencies in kHz,
while terrestrial/cable ones specify in Hz. That's confusing
for developers.

However, the main problem is that universal tuners capable
of handling both satellite and non-satelite delivery systems
are appearing. We end by needing to hack the drivers in
order to support such hybrid tuners.

So, convert everything to specify tuner frequencies in Hz.

Plese notice that a similar patch is also needed for frontends.

Tested-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Acked-by: Michael Büsch <m@bues.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 2e81ae39 26-Mar-2018 Mauro Carvalho Chehab <mchehab@kernel.org>

media: r820t: don't crash if attach fails

As pointed by smatch:
drivers/media/tuners/r820t.c:2374 r820t_attach() error: potential null dereference 'priv'. (kzalloc returns null)

The current function with prints error assumes that the attach
succeeds. So, don't use it in case of failures.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 16c3ada8 30-Nov-2017 Arnd Bergmann <arnd@arndb.de>

media: r820t: fix r820t_write_reg for KASAN

With CONFIG_KASAN, we get an overly long stack frame due to inlining
the register access functions:

drivers/media/tuners/r820t.c: In function 'generic_set_freq.isra.7':
drivers/media/tuners/r820t.c:1334:1: error: the frame size of 2880 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]

This is caused by a gcc bug that has now been fixed in gcc-8.
To work around the problem, we can pass the register data
through a local variable that older gcc versions can optimize
out as well.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 0c20e8ca 01-Dec-2017 Mauro Carvalho Chehab <mchehab@kernel.org>

media: tuners: add SPDX identifiers to the code I wrote

As we're now using SPDX identifiers, on the several
media drivers I wrote, add the proper SPDX, identifying
the license I meant.

As we're now using the short license, it doesn't make sense to
keep the original license text.

Also, fix MODULE_LICENSE to properly identify GPL v2.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 194ced7a 09-Aug-2016 Max Kellermann <max.kellermann@gmail.com>

[media] dvb_frontend: tuner_ops.release returns void

It is not clear what this return value means. All implemenations
return 0, and the one caller ignores the value. Let's remove this
useless return value completely.

Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 29025f69 23-Jun-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

r820t: comment out two ancillary tables

As Gcc6.1 warned, those tables are currently unused:
drivers/media/tuners/r820t.c:349:18: warning: 'r820t_mixer_gain_steps' defined but not used [-Wunused-const-variable=]
static const int r820t_mixer_gain_steps[] = {
^~~~~~~~~~~~~~~~~~~~~~
drivers/media/tuners/r820t.c:345:18: warning: 'r820t_lna_gain_steps' defined but not used [-Wunused-const-variable=]
static const int r820t_lna_gain_steps[] = {
^~~~~~~~~~~~~~~~~~~~

They're actually used only by a routine that it is currently
commented out. So, move those tables to be together with such
code and comment them out.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 61f8e1a7 28-Dec-2015 Markus Elfring <elfring@users.sourceforge.net>

[media] r820t: Delete an unnecessary variable initialisation in generic_set_freq()

The variable "rc" will be set to an appropriate value from a call of
the r820t_set_tv_standard() function.
Thus let us omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 2be20f74 29-Apr-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: fix identing

drivers/media/tuners/r820t.c:945 r820t_sysfreq_sel() warn: inconsistent indenting

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 275350a0 12-Jan-2015 Benjamin Larsson <benjamin@southpole.se>

[media] r820t: enable flt_ext_wide for SYS_DVBC_ANNEX_A standard

Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# d03b5509 12-Jan-2015 Benjamin Larsson <benjamin@southpole.se>

[media] r820t: add settings for SYS_DVBC_ANNEX_C standard

Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# b91bfcda 15-Mar-2015 Benjamin Larsson <benjamin@southpole.se>

[media] r820t: change read_gain() code to match register layout

Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 7b7ef4b4 15-Mar-2015 Benjamin Larsson <benjamin@southpole.se>

[media] r820t: add DVBC profile in sysfreq_sel

This will make the Astrometa DVB-T/T2/C usb stick be able to pick up
muxes around 290-314 MHz.

Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# b936d166 28-Nov-2013 Antti Palosaari <crope@iki.fi>

[media] r820t: add DVB-C config

Add config values for SYS_DVBC_ANNEX_A.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# d616bec6 08-Jul-2014 Fabian Frederick <fabf@skynet.be>

[media] r820t: remove unnecessary break after goto

Cc: Antti Palosaari <crope@iki.fi>
Cc: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 690130fe 20-Jan-2014 Alan <gnomes@lxorguk.ukuu.org.uk>

[media] dvb-frontends: Add static

Add static to tda m_* variables in the header. They don't need to be global.
With some cleanup they could probably even be marked const.

Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=68191

Reported-by: Christian Schneider <christian@ch-sc.de>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 534c9214 16-Mar-2014 Benjamin Larsson <benjamin@southpole.se>

[media] r820t: fix size and init values

Correct the initialization values at the start of the function
and use proper variable sizes to prevent overflow.

Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 37e59f87 07-Feb-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media, edac] Change my email address

There are several left overs with my old email address.
Remove their occurrences and add myself at CREDITS, to
allow people to be able to reach me on my new addresses.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 7315b933 29-Oct-2013 Antti Palosaari <crope@iki.fi>

[media] r820t: add support for R828D

Small changes in order to support tuner version R828D @ 16 MHz clock.
There was 'vco_fine_tune' check, which seems to adjust synthesizer
output divider (mixer dix / LO div / Rout) by one. R828D seems to
return vco_fine_tune=1 every time and that condition causes tuning
fail as output divider was increased by one.
Resolve problem by skipping whole condition in case of R828D tuner.
Just to mention, other tuner, R820T, seems to return 2 here.
Synthesizer maximum frequency check was hard coded to check synthesizer N
and thus worked correctly only for clock frequencies around 30 MHz.
As whole test is quite useless in any case, I removed it totally.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# bbf94616 17-Jun-2013 Gianluca Gennari <gennarone@gmail.com>

[media] r820t: fix imr calibration

The r820t_imr() calibration function of the Rafael Micro R820T tuner
generates this error at every tune attempt:
r820t 0-001a: No valid PLL values for 2252021 kHz!
The function was inspired by the original Realtek driver for rtl2832 devices
with the r820t tuner; anyway, in the original code the XTAL frequency of
the tuner was expressed in KHz, while in the kernel driver it is expressed
in Hz; so the calibration failed because of an out-of-range initial value.
The final result of the computation is then passed to the r820t_set_mux()
and r820t_set_pll() functions, but the conversion from KHz to Hz is already
correctly implemented.

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 757d7ace 02-Jun-2013 Gianluca Gennari <gennarone@gmail.com>

[media] r820t: avoid potential memcpy buffer overflow in shadow_store()

The memcpy in shadow_store() could exceed buffer limits when r > 0.

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# e2e324d7 02-Jun-2013 Gianluca Gennari <gennarone@gmail.com>

[media] r820t: remove redundant initializations in r820t_attach()

fe->tuner_priv and fe->ops.tuner_ops are initialized twice in r820t_attach().
Remove the redundant initializations and also move fe->ops.tuner_ops
initialization outside of the mutex lock (as in the xc4000 tuner code for example).

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 4aab0398 02-Jun-2013 Gianluca Gennari <gennarone@gmail.com>

[media] r820t: do not double-free fe->tuner_priv in r820t_release()

fe->tuner_priv is already freed by hybrid_tuner_release_state().

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 7063c145 25-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: Remove a warning for an unused value

Currently, the driver complains about the pre_detect var:

drivers/media/tuners/r820t.c: In function 'r820t_sysfreq_sel':
drivers/media/tuners/r820t.c:722:31: warning: variable 'pre_dect' set but not used [-Wunused-but-set-variable]

While rtl8232 code comments it, perhaps some other driver may use.
So, the better is to keep the code there, allowing to enable it
via r820t config data.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 619ab8f6 20-Apr-2013 Fengguang Wu <fengguang.wu@intel.com>

[media] r820t: quiet gcc warning on n_ring

drivers/media/tuners/r820t.c: In function 'r820t_imr':
drivers/media/tuners/r820t.c:1871:8: warning: 'n_ring' may be used uninitialized in this function [-Wmaybe-uninitialized]
Mauro: This is a FALSE POSITIVE: the loop will always return a value
for n_ring, as the last test will fill it with 15, if the loop fails.

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# ef0c8700 18-Apr-2013 Dan Carpenter <dan.carpenter@oracle.com>

[media] r820t: memory leak in release()

I've moved the kfree(fe->tuner_priv) one line earlier, otherwise it is
a no-op.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# f7a12fdf 18-Apr-2013 Dan Carpenter <dan.carpenter@oracle.com>

[media] r820t: precendence bug in r820t_xtal_check()

The test as written is always false. It looks like the intent was to
test that the bit was not set.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 396f3659 11-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: Don't divide the IF by two

The original Win driver doesn't do; rtl-sdr also disabled that
piece of the code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# dfdeac81 11-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: disable auto gain/VGA setting

On field tests, the auto gain routine is not working, nor it is
used by the original driver. Let's comment it for now.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# b5e2b97b 11-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: put it into automatic gain mode

Currently, it is putting it on manual mode.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# f2658894 11-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: Fix hp_cor filter mask

The bit mask was inverted here.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# c0c6ed8d 11-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: fix PLL calculus

There are a few errors at the PLL calculus, causing the device
to use wrong values.
While here, change the calculus to use 32 bits, as there's no
need for 64 bits there.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 064fd169 11-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: Don't put it in standby if not initialized yet

r820t_standby() can be called before r820t_init().
If that happens, just do nothing.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 4176e7ea 11-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: avoid rewrite all regs when not needed

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 52775fd5 11-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: Allow disabling IMR callibration

The rtl-sdr library disabled IMR callibration. While I'm not sure
yet why, it could be a good idea to add a modprobe parameter here,
to allow to also disable it. There are two rationale behind it:
- It helps to compare USB dumps between rtl-sdr and the Kernel module;
- If rtl-sdr disabled it, perhaps there's a good reason (e. g. it
might not be actually working, or it might be causing some trouble).
For both cases, it seems useful to add a modprobe parameter to allow
testing the device with both configurations.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 6596e880 10-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: add a commented code for GPIO

Add the code to set the GPIO for this tuner. This code is
currently unused, so it is kept there only for completeness.
With this patch there are just two things that got left from
the original driver:
- At standby, there's another mode, not used by rtl2832u.
Not sure if it might be needed in the future, but I suspect
it is not used at all;
- There is a "fast tune" mode. As nor DVB or V4L API supports
it, it seems an overkill to implement it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 25cf4d46 10-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: add IMR calibrate code

This code seems to calibrate I/Q phase and gain during the
device initialization.
This is done only once, and it doesn't seem to be needed to
happen after resuming.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# d75d5388 10-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: proper initialize the PLL register

The rtl-sdr library, from where this driver was initially
based, doesn't use half PLL clock, but this is used on
the Realtek Kernel driver. So, also do the same here.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 9cc2570a 10-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: use usleep_range()

Instead of using msleep(), use sleep_range(), as it provides
a closer sleep time.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 226471a1 10-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: fix prefix of the r820t_read() function

Just cosmetic changes: all other functions are prefixed
by r820t. Do the same for r820t_read().

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 8678b034 10-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: split the function that read cached regs

As we'll need to retrieve cached registers, make this
function explicit.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 75c1819e 10-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: better report signal strength

If signal is zero, shows it as a zero, not as 0xff.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 84ddc33c 10-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: add support for diplexer

This is part of the original driver, and adding it doesn't hurt,
so add it, to better sync the code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 6b8c2308 10-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: Show the read data in the bit-reversed order

As the driver's logic uses the bit-reversed order for read,
use it as well when displaying the debug messages.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 6189f80d 10-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: use the second table for 7MHz

The Realtek Kernel driver uses the second DVB-T 7MHz table instead
of the first one. Use it as well.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 103fe2fb 10-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: Invert bits for read ops

On read, the bit order is inverted.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# a7dd065f 09-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: use the right IF for the selected TV standard

IF is set at r820t_set_tv_standard(). So, we can't calculate
LO frequency before calling it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# f60f5bcb 09-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: Fix IF scale

Scale used at get_if_freq and LO freq calculus is Hz.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# da31934f 07-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] rtl820t: Add a debug msg when PLL gets locked

[ 2255.342797] r820t 3-001a: generic_set_freq: PLL locked on frequency 725476191 Hz, gain=45

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 7a5ef30d 07-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: proper lock and set the I2C gate

As this tuner can be used by analog and digital parts of the
driver, be sure that all ops that access the hardware will
be be properly locked.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# 50786ddf 07-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: Set gain mode to auto

This tuner works with 2 modes: automatic gain mode and manual
gain mode. Put it into automatic mode, as we currently don't
have any API for manual gain adjustment.
The logic to allow setting the manual mode is there, as it is
just a few extra code. This way, if/when we latter add support
for setting the gain mode, the code is already there.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# f8fde0e0 07-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: Give a better estimation of the signal strength

Instead of a binary signal strength measure, use the tuner gain
to obtain a better estimation of the signal strength.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>


# a80abc58 05-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] r820t: Add a tuner driver for Rafael Micro R820T silicon tuner

This driver was written from scratch, based on an existing driver
that it is part of rtl-sdr git tree, released under GPLv2:
https://groups.google.com/forum/#!topic/ultra-cheap-sdr/Y3rBEOFtHug
https://github.com/n1gp/gr-baz
http://cgit.osmocom.org/rtl-sdr/plain/src/tuner_r820t.c
(there are also other variants of it out there)
>From what I understood from the threads, the original driver was converted
to userspace from a Realtek tree. I couldn't find the original tree.
However, the original driver look awkward on my eyes. So, I decided to
write a new version from it from the scratch, while trying to reproduce
everything found there.
TODO:
- After locking, the original driver seems to have some routines to
improve reception. This was not implemented here yet.
- RF Gain set/get is not implemented.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>