History log of /drivers/media/dvb/frontends/af9013.c
Revision Date Author Comments
938ca36ef7914bd013acbff9f15e393fe79d71da 05-Jan-2012 Dan Carpenter <dan.carpenter@oracle.com> [media] af9013: change & to &&

This is just a cleanup, it doesn't change how the code works. These
are compound conditions and not bitwise operations so it should be &&
and not &.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
6a2329ad1cb80b158a75bbf1901b86dc2deb88ee 03-Jan-2012 Gianluca Gennari <gennarone@gmail.com> [media] af9013: Fix typo in get_frontend() function

This patch fixes an obvious typo in the get_frontend() function
of the af9013 driver, recently rewritten by Antti Palosaari.

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
7581e61d8d7a3ed89a3fdac2235231cd36548f78 01-Jan-2012 Mauro Carvalho Chehab <mchehab@redhat.com> [media] dvb: Remove ops->info.type from frontends

Now that this field is deprecated, and core generates it for
DVBv3 calls, remove it from the drivers.

It also adds .delsys on the few drivers where this were missed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
7c61d80a9bcfc3fdec8ffd75756cad6a64678229 30-Dec-2011 Mauro Carvalho Chehab <mchehab@redhat.com> [media] dvb: don't require a parameter for get_frontend

Just like set_frontend, use the dvb cache properties for get_frontend.
This is more consistent, as both functions are now symetric. Also,
at the places get_frontend is called, it makes sense to update the
cache.

Most of this patch were generated by this small perl script:

while (<>) { $file .= $_; }
if ($file =~ m/\.get_frontend\s*=\s*([\d\w_]+)/) {
my $get = $1;
$file =~ s/($get)(\s*\([^\,\)]+)\,\s*struct\s+dtv_frontend_properties\s*\*\s*([_\d\w]+)\)\s*\{/\1\2)\n{\n\tstruct dtv_frontend_properties *\3 = &fe->dtv_property_cache;/g;
}
print $file;

Of course, the changes at dvb_frontend.[ch] were made by hand,
as well as the changes on a few other places, where get_frontend()
is called internally inside the driver.

On some places, get_frontend() were just a void function. Those
occurrences were removed, as the DVB core handles such cases.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
59d3cc1975db3676da707ea7083dc7e15117409d 31-Dec-2011 Mauro Carvalho Chehab <mchehab@redhat.com> [media] af9013: convert get|set_fontend to use DVBv5 parameters

Instead of using dvb_frontend_parameters struct, that were
designed for a subset of the supported standards, use the DVBv5
cache information.

Also, fill the supported delivery systems at dvb_frontend_ops
struct.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
a689e3657d7e82c2271008553c709fc79fb2e038 22-Dec-2011 Mauro Carvalho Chehab <mchehab@redhat.com> [media] dvb-core: add support for a DVBv5 get_frontend() callback

Creates a DVBv5 get_frontend call, renaming the DVBv3 one to
get_frontend_legacy(), while not all frontends are converted.

After the conversion for all drivers, get_frontend_legacy()
will be removed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
bc9cd2736b34619b58961d506210fe0e6dfaa27d 20-Dec-2011 Mauro Carvalho Chehab <mchehab@redhat.com> [media] Rename set_frontend fops to set_frontend_legacy

Passing DVBv3 parameters to set_frontend is not fun, as the
core doesn't have any way to know if the driver is using the
v3 or v5 parameters. So, rename the callback and add a new
one to allow distinguish between a mixed v3/v5 paramenter call
from a pure v5 call.

After having all frontends to use the new way, the legacy
call can be removed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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>
f571e004c396c2ed8c2ba6bfc8a229b6bd5ab724 29-Nov-2011 Antti Palosaari <crope@iki.fi> [media] af9013: rewrite whole driver

Rewrite whole af9013 demod driver in order to decrease I2C I/O.

We need to decrease I2C load since AF9015 (I2C adapter / USB-bridge used)
seems to have some problems under heavy I2C traffic.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
6d42b218b43f300d0787df7984c8f789de24c6e7 13-Nov-2011 Antti Palosaari <crope@iki.fi> [media] af9013: use .get_if_frequency() when possible

Get IF frequency from tuner if tuner provides it.

Remove TDA18271 and TDA18218 IF frequency hacks since both tuners provides .get_if_frequency().

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
6ed9d56086acb3bb4ec003ff6d2f54313774d72b 19-Mar-2011 Antti Palosaari <crope@iki.fi> [media] af9013: reimplement firmware download

Split FW download packages smarter way and bug free. Implementation is
based of Andrea Merello's example he provided for tda18218 driver.
Count remaining FW bytes down in loop instead of division and modulo
combination used earlier.

Thanks to: Andrea Merello <andrea.merello@gmail.com>

Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
109a29900a36b2b1e7b7f83a561c6af7e343461f 19-Mar-2011 Antti Palosaari <crope@iki.fi> [media] af9013: download FW earlier in attach()

Quick test shows that FW must be running before other checks
so make it happen earlier.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
82f4b5b67e795fe03952b278873712e4562304d2 08-Jan-2011 Antti Palosaari <crope@iki.fi> [media] af9013: fix AF9013 TDA18271 IF config

IF freq for DVB-T 7 MHz and 8 MHz was set slightly wrong. Due to that it
didn't worked at all (?) for 7 MHz channels and most likely performance
was dropped for 8 MHz channels.

That bug was pointed by few people during last two months. Thank you.

Trivial fix. Compile tested only due to lack of proper HW and signal.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: Romolo Manfredini <romoloman@hotmail.com>
Cc: Alireza Moini <alireza.moini@silverbrookresearch.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
465a9e3a2f494b0887db63b7b10bb9370145d9bc 27-Dec-2010 Mauro Carvalho Chehab <mchehab@redhat.com> [media] af9013: Fix a compilation warning

drivers/media/dvb/frontends/af9013.c: In function ‘af9013_update_signal_strength.clone.0’:
drivers/media/dvb/frontends/af9013.c:967:6: warning: ‘ret’ may be used uninitialized in this function

Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9e35cd222bc913f34b8f69e2b41daa7aa041d79a 07-Oct-2010 Antti Palosaari <crope@iki.fi> [media] af9013: cache some reg values to reduce reg reads

Demod + tuner specific RF AGC and IF AGC limit values are read from demod
memory in every signal strength query. Cache those to reduce I2C traffic.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
edb709b61abd3ba475e59d1ad81aab21ad025db6 07-Oct-2010 Antti Palosaari <crope@iki.fi> [media] af9013: optimize code size

Precalculate coefficients register values. This reduces text size around 300 bytes.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9b22edd4b0f3520bc1279338d52dc63e76852bef 13-Sep-2010 Antti Palosaari <crope@iki.fi> V4L/DVB: af9013: optimize code size

Optimize af9013_set_coeff(). Move configuration values to own table.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
a4f31d0da5c6807a0f5dfc7d285d8d4bdaa1e36e 09-Sep-2010 Antti Palosaari <crope@iki.fi> V4L/DVB: af9013: add support for MaxLinear MxL5007T tuner

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2158e5090b5cc99ba05b43657a35d567cf077fe3 13-Aug-2010 Antti Palosaari <crope@iki.fi> V4L/DVB: af9013: add support for tda18218 silicon tuner

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
c89f66f629f0e94806e3ec6f8f77b61a8feed39f 18-Jun-2010 Antti Palosaari <crope@iki.fi> V4L/DVB: af9013: fix comments

Fix comments. It is demodulator driver not DVB USB -bridge.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
ce99efa53ee2e7989b5f44243518f086977760a6 18-Jun-2010 Antti Palosaari <crope@iki.fi> V4L/DVB: af9013: output fw version as four digit long

Firmware version is four digit long. Print all four digits instead of
three digits used earlier.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
8af5e3813b78e429c1774bfac67033c3948c9c8e 18-Jun-2010 Antti Palosaari <crope@iki.fi> V4L/DVB: af9013: af9013_read_status() refactoring

Function af9013_read_status() refactoring. Read lock bits in different
order to save count of register reads.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
737fabf051e1e438f5cb81db84e559cede94dafb 16-Jun-2010 Antti Palosaari <crope@iki.fi> V4L/DVB: af9013: program tuner before demodulator

Program tuner before demodulator in case of channel set. Earlier it was
programmed during demodulator programming. This seems to resolve weird
error where demodulator misses sometimes ability to gain lock.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
a2f5a8117cb185fc347f35e369a6320e6aa9d82d 11-Jul-2009 Antti Palosaari <crope@iki.fi> V4L/DVB (12269): af9013: auto-detect parameters in case of garbage given by app

Request demodulator auto-detect transmission parameters in case of
garbage parameters provided by application for compatibility.
That's needed at least for MPlayer compatibility currently.

Thanks to Jelle de Jong for reporting issue and providing SSH access to
Devin for debugging.

Thanks to Devin Heitmueller for hard debug work he did to find that bug.

Cc: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Jelle de Jong <jelledejong@powercraft.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
e9785250ef2eead8bd5e9166679c0be0595df387 26-Apr-2009 Jean Delvare <khali@linux-fr.org> 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>
4d543096ee743faa52d69506eef73d3cb6208f18 30-Dec-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (10116): af9013: Fix gcc false warnings

drivers/media/dvb/frontends/af9013.c: In function ‘af9013_set_coeff’:
drivers/media/dvb/frontends/af9013.c:231: warning: ‘ns_coeff2_8k’ may be used uninitialized in this function
drivers/media/dvb/frontends/af9013.c:230: warning: ‘ns_coeff2_2k’ may be used uninitialized in this function
drivers/media/dvb/frontends/af9013.c:229: warning: ‘ns_coeff1_8193nu’ may be used uninitialized in this function
drivers/media/dvb/frontends/af9013.c:228: warning: ‘ns_coeff1_8192nu’ may be used uninitialized in this function
drivers/media/dvb/frontends/af9013.c:227: warning: ‘ns_coeff1_8191nu’ may be used uninitialized in this function
drivers/media/dvb/frontends/af9013.c:226: warning: ‘ns_coeff1_2048nu’ may be used uninitialized in this function
drivers/media/dvb/frontends/af9013.c: In function ‘af9013_update_snr’:
drivers/media/dvb/frontends/af9013.c:1012: warning: ‘snr_table’ may be used uninitialized in this function

Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
891bd1331eb378f4a474d2377451a97bb306a451 04-Nov-2008 roel kluin <roel.kluin@gmail.com> V4L/DVB (9524): af9013: fix bug in status reading

- ! has a higher precedence than &

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
541dfa87f9285b2ff7e703a5eab81ad821de7f6e 06-Oct-2008 Antti Palosaari <crope@iki.fi> V4L/DVB (9146): af901x: fix some compiler errors and warnings

- cast firmware data to u8
- remove cpu_to_le16 from switch-case label

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
d4e80beae1eef31df5749516ecb36f0fb366daf1 26-Sep-2008 Antti Palosaari <crope@iki.fi> V4L/DVB (9145): af901x: clean-up

- remove unnecessary #undef's

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
28f947a95386861c54de2bf7753dda011c8e15c3 16-Sep-2008 Antti Palosaari <crope@iki.fi> V4L/DVB (8973): af9013: fix compile error coming from u64 div

- fix compile error coming from u64 div

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
825b96708054ca16d6e4d56a29326d3b2cdd697d 15-Sep-2008 Antti Palosaari <crope@iki.fi> V4L/DVB (8971): initial driver for af9013 demodulator

- initial driver for the Afatech AF9013 demodulator

Signed-off-by: Antti Palosaari <crope@iki.fi>
[mchehab.redhat.com: having a global var called 'debug' is not a good idea. rename it to af9013_debug]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>