Commit graph

32 commits

Author SHA1 Message Date
Hans Verkuil
fdf07b027b [media] v4l/dvb: fix compiler warnings
media_build/v4l/stb6100.c: In function 'stb6100_read_reg':
media_build/v4l/stb6100.c:161:6: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
media_build/v4l/cx24110.c: In function 'cx24110_read_ucblocks':
media_build/v4l/cx24110.c:515:6: warning: variable 'lastbyer' set but not used [-Wunused-but-set-variable]
media_build/v4l/dib9000.c: In function 'dib9000_mbx_process':
media_build/v4l/dib9000.c:711:6: warning: variable 'tmp' set but not used [-Wunused-but-set-variable]
media_build/v4l/zl10353.c: In function 'zl10353_init':
media_build/v4l/zl10353.c:562:6: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
media_build/v4l/stv0297.c: In function 'stv0297_set_frontend':
media_build/v4l/stv0297.c:417:16: warning: variable 'starttime' set but not used [-Wunused-but-set-variable]
media_build/v4l/lgs8gxx.c: In function 'lgs8gxx_set_mode_manual':
media_build/v4l/lgs8gxx.c:265:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
media_build/v4l/af9013.c: In function 'af9013_statistics_work':
media_build/v4l/af9013.c:517:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
media_build/v4l/stv090x.c: In function 'stv090x_optimize_track':
media_build/v4l/stv090x.c:2845:23: warning: variable 'rolloff' set but not used [-Wunused-but-set-variable]
media_build/v4l/stv090x.c: In function 'stv090x_algo':
media_build/v4l/stv090x.c:3177:28: warning: variable 'no_signal' set but not used [-Wunused-but-set-variable]
media_build/v4l/it913x-fe.c: In function 'it913x_fe_read_ber':
media_build/v4l/it913x-fe.c:636:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
media_build/v4l/it913x-fe.c: In function 'it913x_fe_get_frontend':
media_build/v4l/it913x-fe.c:661:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
media_build/v4l/it913x-fe.c: In function 'it913x_fe_set_frontend':
media_build/v4l/it913x-fe.c:694:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
media_build/v4l/m88rs2000.c: In function 'm88rs2000_set_fec':
media_build/v4l/m88rs2000.c:657:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
media_build/v4l/dst_ca.c: In function 'ca_send_message':
media_build/v4l/dst_ca.c:480:15: warning: variable 'ca_message_header_len' set but not used [-Wunused-but-set-variable]
media_build/v4l/smssdio.c: In function 'smssdio_interrupt':
media_build/v4l/smssdio.c:117:11: warning: variable 'isr' set but not used [-Wunused-but-set-variable]

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 14:50:10 -03:00
Dan Carpenter
938ca36ef7 [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>
2012-01-06 17:17:43 -02:00
Gianluca Gennari
6a2329ad1c [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>
2012-01-06 13:12:34 -02:00
Mauro Carvalho Chehab
7581e61d8d [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>
2012-01-04 17:30:34 -02:00
Mauro Carvalho Chehab
7c61d80a9b [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>
2011-12-31 10:28:23 -02:00
Mauro Carvalho Chehab
59d3cc1975 [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>
2011-12-31 09:58:19 -02:00
Mauro Carvalho Chehab
a689e3657d [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>
2011-12-31 09:10:49 -02:00
Mauro Carvalho Chehab
bc9cd2736b [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>
2011-12-31 09:09:43 -02:00
Mauro Carvalho Chehab
14d24d148c [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>
2011-12-31 08:57:29 -02:00
Antti Palosaari
f571e004c3 [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>
2011-12-30 15:31:33 -02:00
Antti Palosaari
6d42b218b4 [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>
2011-11-24 17:52:39 -02:00
Antti Palosaari
6ed9d56086 [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>
2011-03-22 04:55:02 -03:00
Antti Palosaari
109a29900a [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>
2011-03-22 04:55:01 -03:00
Antti Palosaari
82f4b5b67e [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>
2011-01-19 11:44:52 -02:00
Mauro Carvalho Chehab
465a9e3a2f [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>
2010-12-29 08:17:14 -02:00
Antti Palosaari
9e35cd222b [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>
2010-10-21 01:17:55 -02:00
Antti Palosaari
edb709b61a [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>
2010-10-21 01:17:54 -02:00
Antti Palosaari
9b22edd4b0 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>
2010-10-21 01:05:52 -02:00
Antti Palosaari
a4f31d0da5 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>
2010-10-21 01:05:51 -02:00
Antti Palosaari
2158e5090b 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>
2010-10-21 01:04:42 -02:00
Antti Palosaari
c89f66f629 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>
2010-08-02 16:43:14 -03:00
Antti Palosaari
ce99efa53e 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>
2010-08-02 16:43:13 -03:00
Antti Palosaari
8af5e3813b 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>
2010-08-02 16:43:12 -03:00
Antti Palosaari
737fabf051 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>
2010-08-02 16:43:11 -03:00
Antti Palosaari
a2f5a8117c 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>
2009-07-24 14:03:29 -03:00
Jean Delvare
e9785250ef 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>
2009-06-16 18:20:56 -03:00
Mauro Carvalho Chehab
4d543096ee 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>
2008-12-30 09:40:34 -02:00
roel kluin
891bd1331e 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>
2008-11-11 08:11:29 -02:00
Antti Palosaari
541dfa87f9 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>
2008-10-13 07:15:48 -02:00
Antti Palosaari
d4e80beae1 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>
2008-10-13 07:15:45 -02:00
Antti Palosaari
28f947a953 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>
2008-10-12 09:37:03 -02:00
Antti Palosaari
825b967080 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>
2008-10-12 09:37:02 -02:00