diff options
author | Andy Walls <awalls@radix.net> | 2009-07-03 10:33:17 -0400 |
---|---|---|
committer | Andy Walls <awalls@radix.net> | 2009-07-03 10:33:17 -0400 |
commit | efe7db2b0581d63a0f8a06890e613794431d4a41 (patch) | |
tree | 944f67a1433d30b7be84fc8d8e18458cb078d2bc /linux/Documentation/dvb | |
parent | 9f2cb39e1fc931d1c94ebc93e064b9dc24b6df38 (diff) | |
download | mediapointer-dvb-s2-efe7db2b0581d63a0f8a06890e613794431d4a41.tar.gz mediapointer-dvb-s2-efe7db2b0581d63a0f8a06890e613794431d4a41.tar.bz2 |
get_dvb_firmware: Add Yuan MPC718 MT352 DVB-T "firmware" extraction
From: Andy Walls <awalls@radix.net>
Add routine to support extracting the MT352 DVB-T demodulator initialization
sequence for Yuan MPC718 cards for use by the cx18 driver.
This routine uses a hueristic for extracting a good sequence. It should work
on all different versions of the "yuanrap.sys" file, given the way the MT352
tuning sequences are stored in all versions of that file I have seen so far.
However, the current patch simply looks for one specific archive URL.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
Diffstat (limited to 'linux/Documentation/dvb')
-rwxr-xr-x | linux/Documentation/dvb/get_dvb_firmware | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/linux/Documentation/dvb/get_dvb_firmware b/linux/Documentation/dvb/get_dvb_firmware index a52adfc9a..64174d625 100755 --- a/linux/Documentation/dvb/get_dvb_firmware +++ b/linux/Documentation/dvb/get_dvb_firmware @@ -25,7 +25,7 @@ use IO::Handle; "tda10046lifeview", "av7110", "dec2000t", "dec2540t", "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", "or51211", "or51132_qam", "or51132_vsb", "bluebird", - "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2" ); + "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718" ); # Check args syntax() if (scalar(@ARGV) != 1); @@ -381,6 +381,56 @@ sub cx18 { $allfiles; } +sub mpc718 { + my $archive = 'Yuan MPC718 TV Tuner Card 2.13.10.1016.zip'; + my $url = "ftp://ftp.work.acer-euro.com/desktop/aspire_idea510/vista/Drivers/$archive"; + my $fwfile = "dvb-cx18-mpc718-mt352.fw"; + my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); + + checkstandard(); + wgetfile($archive, $url); + unzip($archive, $tmpdir); + + my $sourcefile = "$tmpdir/Yuan MPC718 TV Tuner Card 2.13.10.1016/mpc718_32bit/yuanrap.sys"; + my $found = 0; + + open IN, '<', $sourcefile or die "Couldn't open $sourcefile to extract $fwfile data\n"; + binmode IN; + open OUT, '>', $fwfile; + binmode OUT; + { + # Block scope because we change the line terminator variable $/ + my $prevlen = 0; + my $currlen; + + # Buried in the data segment are 3 runs of almost identical + # register-value pairs that end in 0x5d 0x01 which is a "TUNER GO" + # command for the MT352. + # Pull out the middle run (because it's easy) of register-value + # pairs to make the "firmware" file. + + local $/ = "\x5d\x01"; # MT352 "TUNER GO" + + while (<IN>) { + $currlen = length($_); + if ($prevlen == $currlen || $currlen <= 64) { + chop; chop; # Get rid of "TUNER GO" + s/^\0\0//; # get rid of leading 00 00 if it's there + printf OUT "$_"; + $found = 1; + last; + } + } + } + close OUT; + close IN; + if (!$found) { + unlink $fwfile; + die "Couldn't find valid register-value sequence in $sourcefile for $fwfile\n"; + } + $fwfile; +} + sub cx23885 { my $url = "http://linuxtv.org/downloads/firmware/"; |