Commit a267c0a8 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb

* 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (126 commits)
  V4L/DVB (5847): Clean up schedule_timeout calls in cpia2 and ivtv code
  V4L/DVB (5846): Clean up setting state and scheduling timeouts
  V4L/DVB (5844): ivtv: add high volume debugging flag
  V4L/DVB (5843): ivtv: fix missing signal_pending check.
  V4L/DVB (5842): ivtv: Add locking to ensure stream setup is atomic.
  V4L/DVB (5841): tveeprom: add support for Philips FQ1216LME MK3 tuner.
  V4L/DVB (5840): fix dst and cx24123: tune() callback changed signess for delay
  V4L/DVB (5838): dvb-core: Fix signedness warnings (gcc 4.1.1, kernel 2.6.22)
  V4L/DVB (5837): stv0299: Fix signedness warning (gcc 4.1.1, kernel 2.6.22)
  V4L/DVB (5836): dvb-ttpci: re-initialize aspect ratio and pan scan after arm crash
  V4L/DVB (5835): saa7146/dvb-ttpci: Fix signedness warnings (gcc 4.1.1, kernel 2.6.22)
  V4L/DVB (5834): dvb-core: fix signedness warnings and const stripping
  V4L/DVB (5832): ir-common: optimize bit extract function
  V4L/DVB (5831): stradis: use ARRAY_SIZE
  V4L/DVB (5829): Firmware extract and loading for opera dvb-usb update
  V4L/DVB (5828): Kconfig: Added GemTek USB radio and removed experimental dependency.
  V4L/DVB (5826): Usbvision: video mux cleanup
  V4L/DVB (5825): Alter the tuner type for the WinTV USB UK PAL model.
  V4L/DVB (5824): Usbvision: Hauppauge WinTV USB SECAM_L fix
  V4L/DVB (5821): Saa7134: add remote control support for LifeView FlyDVB-S LR300
  ...
parents d756d10e 97989ada
...@@ -9,19 +9,29 @@ for accessing the i2c bus and the gpio pins of the bt8xx chipset. ...@@ -9,19 +9,29 @@ for accessing the i2c bus and the gpio pins of the bt8xx chipset.
Please see Documentation/dvb/cards.txt => o Cards based on the Conexant Bt8xx PCI bridge: Please see Documentation/dvb/cards.txt => o Cards based on the Conexant Bt8xx PCI bridge:
Compiling kernel please enable: Compiling kernel please enable:
a.)"Device drivers" => "Multimedia devices" => "Video For Linux" => "BT848 Video For Linux" a.)"Device drivers" => "Multimedia devices" => "Video For Linux" => "Enable Video for Linux API 1 (DEPRECATED)"
b.)"Device drivers" => "Multimedia devices" => "Digital Video Broadcasting Devices" b.)"Device drivers" => "Multimedia devices" => "Video For Linux" => "Video Capture Adapters" => "BT848 Video For Linux"
=> "DVB for Linux" "DVB Core Support" "Bt8xx based PCI Cards" c.)"Device drivers" => "Multimedia devices" => "Digital Video Broadcasting Devices" => "DVB for Linux" "DVB Core Support" "Bt8xx based PCI Cards"
2) Loading Modules Please use the following options with care as deselection of drivers which are in fact necessary
================== may result in DVB devices that cannot be tuned due to lack of driver support:
You can save RAM by deselecting every frontend module that your DVB card does not need.
First please remove the static dependency of DVB card drivers on all frontend modules for all possible card variants by enabling:
d.) "Device drivers" => "Multimedia devices" => "Digital Video Broadcasting Devices"
=> "DVB for Linux" "DVB Core Support" "Load and attach frontend modules as needed"
In default cases bttv is loaded automatically. If you know the frontend driver that your card needs please enable:
To load the backend either place dvb-bt8xx in etc/modules, or apply manually: e.)"Device drivers" => "Multimedia devices" => "Digital Video Broadcasting Devices"
=> "DVB for Linux" "DVB Core Support" "Customise DVB Frontends" => "Customise the frontend modules to build"
Then please select your card-specific frontend module.
$ modprobe dvb-bt8xx 2) Loading Modules
==================
All frontends will be loaded automatically. Regular case: If the bttv driver detects a bt8xx-based DVB card, all frontend and backend modules will be loaded automatically.
Exceptions are:
- Old TwinHan DST cards or clones with or without CA slot and not containing an Eeprom.
People running udev please see Documentation/dvb/udev.txt. People running udev please see Documentation/dvb/udev.txt.
In the following cases overriding the PCI type detection for dvb-bt8xx might be necessary: In the following cases overriding the PCI type detection for dvb-bt8xx might be necessary:
...@@ -30,7 +40,6 @@ In the following cases overriding the PCI type detection for dvb-bt8xx might be ...@@ -30,7 +40,6 @@ In the following cases overriding the PCI type detection for dvb-bt8xx might be
------------------------------ ------------------------------
$ modprobe bttv card=113 $ modprobe bttv card=113
$ modprobe dvb-bt8xx
$ modprobe dst $ modprobe dst
Useful parameters for verbosity level and debugging the dst module: Useful parameters for verbosity level and debugging the dst module:
...@@ -65,10 +74,9 @@ DViCO FusionHDTV 5 Lite: 135 ...@@ -65,10 +74,9 @@ DViCO FusionHDTV 5 Lite: 135
Notice: The order of the card ID should be uprising: Notice: The order of the card ID should be uprising:
Example: Example:
$ modprobe bttv card=113 card=135 $ modprobe bttv card=113 card=135
$ modprobe dvb-bt8xx
For a full list of card ID's please see Documentation/video4linux/CARDLIST.bttv. For a full list of card ID's please see Documentation/video4linux/CARDLIST.bttv.
In case of further problems send questions to the mailing list: www.linuxdvb.org. In case of further problems please subscribe and send questions to the mailing list: linux-dvb@linuxtv.org.
Authors: Richard Walker, Authors: Richard Walker,
Jamie Honan, Jamie Honan,
......
...@@ -24,7 +24,8 @@ use IO::Handle; ...@@ -24,7 +24,8 @@ use IO::Handle;
@components = ( "sp8870", "sp887x", "tda10045", "tda10046", @components = ( "sp8870", "sp887x", "tda10045", "tda10046",
"tda10046lifeview", "av7110", "dec2000t", "dec2540t", "tda10046lifeview", "av7110", "dec2000t", "dec2540t",
"dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004",
"or51211", "or51132_qam", "or51132_vsb", "bluebird"); "or51211", "or51132_qam", "or51132_vsb", "bluebird",
"opera1");
# Check args # Check args
syntax() if (scalar(@ARGV) != 1); syntax() if (scalar(@ARGV) != 1);
...@@ -56,7 +57,7 @@ syntax(); ...@@ -56,7 +57,7 @@ syntax();
sub sp8870 { sub sp8870 {
my $sourcefile = "tt_Premium_217g.zip"; my $sourcefile = "tt_Premium_217g.zip";
my $url = "http://www.technotrend.de/new/217g/$sourcefile"; my $url = "http://www.softwarepatch.pl/9999ccd06a4813cb827dbb0005071c71/$sourcefile";
my $hash = "53970ec17a538945a6d8cb608a7b3899"; my $hash = "53970ec17a538945a6d8cb608a7b3899";
my $outfile = "dvb-fe-sp8870.fw"; my $outfile = "dvb-fe-sp8870.fw";
my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1);
...@@ -210,6 +211,45 @@ sub dec3000s { ...@@ -210,6 +211,45 @@ sub dec3000s {
$outfile; $outfile;
} }
sub opera1{
my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 0);
checkstandard();
my $fwfile1="dvb-usb-opera1-fpga-01.fw";
my $fwfile2="dvb-usb-opera-01.fw";
extract("2830SCap2.sys", 0x62e8, 55024, "$tmpdir/opera1-fpga.fw");
extract("2830SLoad2.sys",0x3178,0x3685-0x3178,"$tmpdir/fw1part1");
extract("2830SLoad2.sys",0x0980,0x3150-0x0980,"$tmpdir/fw1part2");
delzero("$tmpdir/fw1part1","$tmpdir/fw1part1-1");
delzero("$tmpdir/fw1part2","$tmpdir/fw1part2-1");
verify("$tmpdir/fw1part1-1","5e0909858fdf0b5b09ad48b9fe622e70");
verify("$tmpdir/fw1part2-1","d6e146f321427e931df2c6fcadac37a1");
verify("$tmpdir/opera1-fpga.fw","0f8133f5e9051f5f3c1928f7e5a1b07d");
my $RES1="\x01\x92\x7f\x00\x01\x00";
my $RES0="\x01\x92\x7f\x00\x00\x00";
my $DAT1="\x01\x00\xe6\x00\x01\x00";
my $DAT0="\x01\x00\xe6\x00\x00\x00";
open FW,">$tmpdir/opera.fw";
print FW "$RES1";
print FW "$DAT1";
print FW "$RES1";
print FW "$DAT1";
appendfile(FW,"$tmpdir/fw1part1-1");
print FW "$RES0";
print FW "$DAT0";
print FW "$RES1";
print FW "$DAT1";
appendfile(FW,"$tmpdir/fw1part2-1");
print FW "$RES1";
print FW "$DAT1";
print FW "$RES0";
print FW "$DAT0";
copy ("$tmpdir/opera1-fpga.fw",$fwfile1);
copy ("$tmpdir/opera.fw",$fwfile2);
$fwfile1.",".$fwfile2;
}
sub vp7041 { sub vp7041 {
my $sourcefile = "2.422.zip"; my $sourcefile = "2.422.zip";
...@@ -440,6 +480,25 @@ sub appendfile { ...@@ -440,6 +480,25 @@ sub appendfile {
close(INFILE); close(INFILE);
} }
sub delzero{
my ($infile,$outfile) =@_;
open INFILE,"<$infile";
open OUTFILE,">$outfile";
while (1){
$rcount=sysread(INFILE,$buf,22);
$len=ord(substr($buf,0,1));
print OUTFILE substr($buf,0,1);
print OUTFILE substr($buf,2,$len+3);
last if ($rcount<1);
printf OUTFILE "%c",0;
#print $len." ".length($buf)."\n";
}
close(INFILE);
close(OUTFILE);
}
sub syntax() { sub syntax() {
print STDERR "syntax: get_dvb_firmware <component>\n"; print STDERR "syntax: get_dvb_firmware <component>\n";
print STDERR "Supported components:\n"; print STDERR "Supported components:\n";
......
To extract the firmware for the Opera DVB-S1 USB-Box
you need to copy the files:
2830SCap2.sys
2830SLoad2.sys
from the windriver disk into this directory.
Then run
./get_dvb_firware opera1
and after that you have 2 files:
dvb-usb-opera-01.fw
dvb-usb-opera1-fpga-01.fw
in here.
Copy them into /lib/firmware/ .
After that the driver can load the firmware
(if you have enabled firmware loading
in kernel config and have hotplug running).
Marco Gittler <g.marco@freenet.de>
\ No newline at end of file
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
65 -> Lifeview FlyVideo 2000S LR90 65 -> Lifeview FlyVideo 2000S LR90
66 -> Terratec TValueRadio [153b:1135,153b:ff3b] 66 -> Terratec TValueRadio [153b:1135,153b:ff3b]
67 -> IODATA GV-BCTV4/PCI [10fc:4050] 67 -> IODATA GV-BCTV4/PCI [10fc:4050]
68 -> 3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA) [121a:3000,10b4:2637] 68 -> 3Dfx VoodooTV FM (Euro) [10b4:2637]
69 -> Active Imaging AIMMS 69 -> Active Imaging AIMMS
70 -> Prolink Pixelview PV-BT878P+ (Rev.4C,8E) 70 -> Prolink Pixelview PV-BT878P+ (Rev.4C,8E)
71 -> Lifeview FlyVideo 98EZ (capture only) LR51 [1851:1851] 71 -> Lifeview FlyVideo 98EZ (capture only) LR51 [1851:1851]
...@@ -145,3 +145,5 @@ ...@@ -145,3 +145,5 @@
144 -> MagicTV 144 -> MagicTV
145 -> SSAI Security Video Interface [4149:5353] 145 -> SSAI Security Video Interface [4149:5353]
146 -> SSAI Ultrasound Video Interface [414a:5353] 146 -> SSAI Ultrasound Video Interface [414a:5353]
147 -> VoodooTV 200 (USA) [121a:3000]
148 -> DViCO FusionHDTV 2 [dbc0:d200]
...@@ -55,3 +55,4 @@ ...@@ -55,3 +55,4 @@
54 -> Norwood Micro TV Tuner 54 -> Norwood Micro TV Tuner
55 -> Shenzhen Tungsten Ages Tech TE-DTV-250 / Swann OEM [c180:c980] 55 -> Shenzhen Tungsten Ages Tech TE-DTV-250 / Swann OEM [c180:c980]
56 -> Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder [0070:9600,0070:9601,0070:9602] 56 -> Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder [0070:9600,0070:9601,0070:9602]
57 -> ADS Tech Instant Video PCI [1421:0390]
...@@ -114,3 +114,4 @@ ...@@ -114,3 +114,4 @@
113 -> Elitegroup ECS TVP3XP FM1246 Tuner Card (PAL,FM) [1019:4cb6] 113 -> Elitegroup ECS TVP3XP FM1246 Tuner Card (PAL,FM) [1019:4cb6]
114 -> KWorld DVB-T 210 [17de:7250] 114 -> KWorld DVB-T 210 [17de:7250]
115 -> Sabrent PCMCIA TV-PCB05 [0919:2003] 115 -> Sabrent PCMCIA TV-PCB05 [0919:2003]
116 -> 10MOONS TM300 TV Card [1131:2304]
...@@ -40,7 +40,7 @@ tuner=38 - Philips PAL/SECAM multi (FM1216ME MK3) ...@@ -40,7 +40,7 @@ tuner=38 - Philips PAL/SECAM multi (FM1216ME MK3)
tuner=39 - LG NTSC (newer TAPC series) tuner=39 - LG NTSC (newer TAPC series)
tuner=40 - HITACHI V7-J180AT tuner=40 - HITACHI V7-J180AT
tuner=41 - Philips PAL_MK (FI1216 MK) tuner=41 - Philips PAL_MK (FI1216 MK)
tuner=42 - Philips 1236D ATSC/NTSC dual in tuner=42 - Philips FCV1236D ATSC/NTSC dual in
tuner=43 - Philips NTSC MK3 (FM1236MK3 or FM1236/F) tuner=43 - Philips NTSC MK3 (FM1236MK3 or FM1236/F)
tuner=44 - Philips 4 in 1 (ATI TV Wonder Pro/Conexant) tuner=44 - Philips 4 in 1 (ATI TV Wonder Pro/Conexant)
tuner=45 - Microtune 4049 FM5 tuner=45 - Microtune 4049 FM5
...@@ -72,3 +72,4 @@ tuner=70 - Samsung TCPN 2121P30A ...@@ -72,3 +72,4 @@ tuner=70 - Samsung TCPN 2121P30A
tuner=71 - Xceive xc3028 tuner=71 - Xceive xc3028
tuner=72 - Thomson FE6600 tuner=72 - Thomson FE6600
tuner=73 - Samsung TCPG 6121P30A tuner=73 - Samsung TCPG 6121P30A
tuner=75 - Philips TEA5761 FM Radio
...@@ -436,7 +436,7 @@ HV7131D Hynix Semiconductor | Yes No No No ...@@ -436,7 +436,7 @@ HV7131D Hynix Semiconductor | Yes No No No
HV7131R Hynix Semiconductor | No Yes Yes Yes HV7131R Hynix Semiconductor | No Yes Yes Yes
MI-0343 Micron Technology | Yes No No No MI-0343 Micron Technology | Yes No No No
MI-0360 Micron Technology | No Yes Yes Yes MI-0360 Micron Technology | No Yes Yes Yes
OV7630 OmniVision Technologies | Yes Yes No No OV7630 OmniVision Technologies | Yes Yes Yes Yes
OV7660 OmniVision Technologies | No No Yes Yes OV7660 OmniVision Technologies | No No Yes Yes
PAS106B PixArt Imaging | Yes No No No PAS106B PixArt Imaging | Yes No No No
PAS202B PixArt Imaging | Yes Yes No No PAS202B PixArt Imaging | Yes Yes No No
...@@ -583,6 +583,7 @@ order): ...@@ -583,6 +583,7 @@ order):
- Bertrik Sikken, who reverse-engineered and documented the Huffman compression - Bertrik Sikken, who reverse-engineered and documented the Huffman compression
algorithm used in the SN9C101, SN9C102 and SN9C103 controllers and algorithm used in the SN9C101, SN9C102 and SN9C103 controllers and
implemented the first decoder; implemented the first decoder;
- Ronny Standke for the donation of a webcam;
- Mizuno Takafumi for the donation of a webcam; - Mizuno Takafumi for the donation of a webcam;
- an "anonymous" donator (who didn't want his name to be revealed) for the - an "anonymous" donator (who didn't want his name to be revealed) for the
donation of a webcam. donation of a webcam.
......
...@@ -62,4 +62,4 @@ Vendor Product Distributor Model ...@@ -62,4 +62,4 @@ Vendor Product Distributor Model
0x0784 0x0040 Traveler Slimline X5 0x0784 0x0040 Traveler Slimline X5
0x06d6 0x0034 Trust Powerc@m 750 0x06d6 0x0034 Trust Powerc@m 750
0x0a17 0x0062 Pentax Optio 50L 0x0a17 0x0062 Pentax Optio 50L
0x06d6 0x003b Trust Powerc@m 970Z
...@@ -80,8 +80,12 @@ config VIDEO_BUF_DVB ...@@ -80,8 +80,12 @@ config VIDEO_BUF_DVB
config VIDEO_BTCX config VIDEO_BTCX
tristate tristate
config VIDEO_IR_I2C
tristate
config VIDEO_IR config VIDEO_IR
tristate tristate
select VIDEO_IR_I2C if I2C
config VIDEO_TVEEPROM config VIDEO_TVEEPROM
tristate tristate
......
...@@ -107,21 +107,20 @@ void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, ...@@ -107,21 +107,20 @@ void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
} }
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* extract mask bits out of data and pack them into the result */
u32 ir_extract_bits(u32 data, u32 mask) u32 ir_extract_bits(u32 data, u32 mask)
{ {
int mbit, vbit; u32 vbit = 1, value = 0;
u32 value;
do {
if (mask&1) {
if (data&1)
value |= vbit;
vbit<<=1;
}
data>>=1;
} while (mask>>=1);
value = 0;
vbit = 0;
for (mbit = 0; mbit < 32; mbit++) {
if (!(mask & ((u32)1 << mbit)))
continue;
if (data & ((u32)1 << mbit))
value |= (1 << vbit);
vbit++;
}
return value; return value;
} }
......
...@@ -27,7 +27,7 @@ static int saa7146_num; ...@@ -27,7 +27,7 @@ static int saa7146_num;
unsigned int saa7146_debug; unsigned int saa7146_debug;
module_param(saa7146_debug, int, 0644); module_param(saa7146_debug, uint, 0644);
MODULE_PARM_DESC(saa7146_debug, "debug level (default: 0)"); MODULE_PARM_DESC(saa7146_debug, "debug level (default: 0)");
#if 0 #if 0
...@@ -130,10 +130,10 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages) ...@@ -130,10 +130,10 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages)
/********************************************************************************/ /********************************************************************************/
/* common page table functions */ /* common page table functions */
char *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa7146_pgtable *pt) void *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa7146_pgtable *pt)
{ {
int pages = (length+PAGE_SIZE-1)/PAGE_SIZE; int pages = (length+PAGE_SIZE-1)/PAGE_SIZE;
char *mem = vmalloc_32(length); void *mem = vmalloc_32(length);
int slen = 0; int slen = 0;
if (NULL == mem) if (NULL == mem)
...@@ -168,7 +168,7 @@ char *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa ...@@ -168,7 +168,7 @@ char *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa
return NULL; return NULL;
} }
void saa7146_vfree_destroy_pgtable(struct pci_dev *pci, char *mem, struct saa7146_pgtable *pt) void saa7146_vfree_destroy_pgtable(struct pci_dev *pci, void *mem, struct saa7146_pgtable *pt)
{ {
pci_unmap_sg(pci, pt->slist, pt->nents, PCI_DMA_FROMDEVICE); pci_unmap_sg(pci, pt->slist, pt->nents, PCI_DMA_FROMDEVICE);
saa7146_pgtable_free(pci, pt); saa7146_pgtable_free(pci, pt);
......
...@@ -889,9 +889,9 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int ...@@ -889,9 +889,9 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
DEB_EE(("VIDIOC_QUERYCAP\n")); DEB_EE(("VIDIOC_QUERYCAP\n"));
strcpy(cap->driver, "saa7146 v4l2"); strcpy((char *)cap->driver, "saa7146 v4l2");
strlcpy(cap->card, dev->ext->name, sizeof(cap->card)); strlcpy((char *)cap->card, dev->ext->name, sizeof(cap->card));
sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci)); sprintf((char *)cap->bus_info,"PCI:%s", pci_name(dev->pci));
cap->version = SAA7146_VERSION_CODE; cap->version = SAA7146_VERSION_CODE;
cap->capabilities = cap->capabilities =
V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_CAPTURE |
...@@ -968,7 +968,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int ...@@ -968,7 +968,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
} }
memset(f,0,sizeof(*f)); memset(f,0,sizeof(*f));
f->index = index; f->index = index;
strlcpy(f->description,formats[index].name,sizeof(f->description)); strlcpy((char *)f->description,formats[index].name,sizeof(f->description));
f->pixelformat = formats[index].pixelformat; f->pixelformat = formats[index].pixelformat;
break; break;
} }
......
config DVB_B2C2_FLEXCOP config DVB_B2C2_FLEXCOP
tristate "Technisat/B2C2 FlexCopII(b) and FlexCopIII adapters" tristate "Technisat/B2C2 FlexCopII(b) and FlexCopIII adapters"
depends on DVB_CORE && I2C depends on DVB_CORE && I2C
select DVB_PLL select DVB_PLL if !DVB_FE_CUSTOMISE
select DVB_STV0299 if !DVB_FE_CUSTOMISE select DVB_STV0299 if !DVB_FE_CUSTOMISE
select DVB_MT352 if !DVB_FE_CUSTOMISE select DVB_MT352 if !DVB_FE_CUSTOMISE
select DVB_MT312 if !DVB_FE_CUSTOMISE select DVB_MT312 if !DVB_FE_CUSTOMISE
......
...@@ -12,4 +12,4 @@ obj-$(CONFIG_DVB_B2C2_FLEXCOP_PCI) += b2c2-flexcop-pci.o ...@@ -12,4 +12,4 @@ obj-$(CONFIG_DVB_B2C2_FLEXCOP_PCI) += b2c2-flexcop-pci.o
b2c2-flexcop-usb-objs = flexcop-usb.o b2c2-flexcop-usb-objs = flexcop-usb.o
obj-$(CONFIG_DVB_B2C2_FLEXCOP_USB) += b2c2-flexcop-usb.o obj-$(CONFIG_DVB_B2C2_FLEXCOP_USB) += b2c2-flexcop-usb.o
EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
...@@ -500,13 +500,13 @@ int flexcop_frontend_init(struct flexcop_device *fc) ...@@ -500,13 +500,13 @@ int flexcop_frontend_init(struct flexcop_device *fc)
/* try the air atsc 2nd generation (nxt2002) */ /* try the air atsc 2nd generation (nxt2002) */
if ((fc->fe = dvb_attach(nxt200x_attach, &samsung_tbmv_config, &fc->i2c_adap)) != NULL) { if ((fc->fe = dvb_attach(nxt200x_attach, &samsung_tbmv_config, &fc->i2c_adap)) != NULL) {
fc->dev_type = FC_AIR_ATSC2; fc->dev_type = FC_AIR_ATSC2;
dvb_attach(dvb_pll_attach, fc->fe, 0x61, NULL, &dvb_pll_samsung_tbmv); dvb_attach(dvb_pll_attach, fc->fe, 0x61, NULL, DVB_PLL_SAMSUNG_TBMV);
info("found the nxt2002 at i2c address: 0x%02x",samsung_tbmv_config.demod_address); info("found the nxt2002 at i2c address: 0x%02x",samsung_tbmv_config.demod_address);
} else } else
/* try the air atsc 3nd generation (lgdt3303) */ /* try the air atsc 3nd generation (lgdt3303) */
if ((fc->fe = dvb_attach(lgdt330x_attach, &air2pc_atsc_hd5000_config, &fc->i2c_adap)) != NULL) { if ((fc->fe = dvb_attach(lgdt330x_attach, &air2pc_atsc_hd5000_config, &fc->i2c_adap)) != NULL) {
fc->dev_type = FC_AIR_ATSC3; fc->dev_type = FC_AIR_ATSC3;
dvb_attach(dvb_pll_attach, fc->fe, 0x61, &fc->i2c_adap, &dvb_pll_lg_tdvs_h06xf); dvb_attach(dvb_pll_attach, fc->fe, 0x61, &fc->i2c_adap, DVB_PLL_LG_TDVS_H06XF);
info("found the lgdt3303 at i2c address: 0x%02x",air2pc_atsc_hd5000_config.demod_address); info("found the lgdt3303 at i2c address: 0x%02x",air2pc_atsc_hd5000_config.demod_address);
} else } else
/* try the air atsc 1nd generation (bcm3510)/panasonic ct10s */ /* try the air atsc 1nd generation (bcm3510)/panasonic ct10s */
......
...@@ -7,7 +7,7 @@ config DVB_BT8XX ...@@ -7,7 +7,7 @@ config DVB_BT8XX
select DVB_CX24110 if !DVB_FE_CUSTOMISE select DVB_CX24110 if !DVB_FE_CUSTOMISE
select DVB_OR51211 if !DVB_FE_CUSTOMISE select DVB_OR51211 if !DVB_FE_CUSTOMISE
select DVB_LGDT330X if !DVB_FE_CUSTOMISE select DVB_LGDT330X if !DVB_FE_CUSTOMISE
select DVB_PLL select DVB_PLL if !DVB_FE_CUSTOMISE
select DVB_ZL10353 if !DVB_FE_CUSTOMISE select DVB_ZL10353 if !DVB_FE_CUSTOMISE
select FW_LOADER select FW_LOADER
help help
......
obj-$(CONFIG_DVB_BT8XX) += bt878.o dvb-bt8xx.o dst.o dst_ca.o obj-$(CONFIG_DVB_BT8XX) += bt878.o dvb-bt8xx.o dst.o dst_ca.o
EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/video/bt8xx -Idrivers/media/dvb/frontends EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/video/bt8xx -Idrivers/media/dvb/frontends
...@@ -1652,7 +1652,7 @@ static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet ...@@ -1652,7 +1652,7 @@ static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet
static int dst_tune_frontend(struct dvb_frontend* fe, static int dst_tune_frontend(struct dvb_frontend* fe,
struct dvb_frontend_parameters* p, struct dvb_frontend_parameters* p,
unsigned int mode_flags, unsigned int mode_flags,
int *delay, unsigned int *delay,
fe_status_t *status) fe_status_t *status)
{ {
struct dst_state *state = fe->demodulator_priv; struct dst_state *state = fe->demodulator_priv;
......
...@@ -611,7 +611,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) ...@@ -611,7 +611,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
card->fe = dvb_attach(lgdt330x_attach, &tdvs_tua6034_config, card->i2c_adapter); card->fe = dvb_attach(lgdt330x_attach, &tdvs_tua6034_config, card->i2c_adapter);
if (card->fe != NULL) { if (card->fe != NULL) {
dvb_attach(dvb_pll_attach, card->fe, 0x61, dvb_attach(dvb_pll_attach, card->fe, 0x61,
card->i2c_adapter, &dvb_pll_lg_tdvs_h06xf); card->i2c_adapter, DVB_PLL_LG_TDVS_H06XF);
dprintk ("dvb_bt8xx: lgdt330x detected\n"); dprintk ("dvb_bt8xx: lgdt330x detected\n");
} }
break; break;
...@@ -692,6 +692,9 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) ...@@ -692,6 +692,9 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
case BTTV_BOARD_PC_HDTV: case BTTV_BOARD_PC_HDTV:
card->fe = dvb_attach(or51211_attach, &or51211_config, card->i2c_adapter); card->fe = dvb_attach(or51211_attach, &or51211_config, card->i2c_adapter);
if (card->fe != NULL)
dvb_attach(dvb_pll_attach, card->fe, 0x61,
card->i2c_adapter, DVB_PLL_FCV1236D);
break; break;
} }
......
obj-$(CONFIG_DVB_CINERGYT2) += cinergyT2.o obj-$(CONFIG_DVB_CINERGYT2) += cinergyT2.o
EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/
...@@ -829,7 +829,7 @@ static int cinergyt2_register_rc(struct cinergyt2 *cinergyt2) ...@@ -829,7 +829,7 @@ static int cinergyt2_register_rc(struct cinergyt2 *cinergyt2)
input_dev->id.vendor = cinergyt2->udev->descriptor.idVendor; input_dev->id.vendor = cinergyt2->udev->descriptor.idVendor;
input_dev->id.product = cinergyt2->udev->descriptor.idProduct; input_dev->id.product = cinergyt2->udev->descriptor.idProduct;
input_dev->id.version = 1; input_dev->id.version = 1;
input_dev->cdev.dev = &cinergyt2->udev->dev; input_dev->dev.parent = &cinergyt2->udev->dev;
err = input_register_device(input_dev); err = input_register_device(input_dev);
if (err) { if (err) {
...@@ -1000,18 +1000,15 @@ static int cinergyt2_suspend (struct usb_interface *intf, pm_message_t state) ...@@ -1000,18 +1000,15 @@ static int cinergyt2_suspend (struct usb_interface *intf, pm_message_t state)
if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->wq_sem)) if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->wq_sem))
return -ERESTARTSYS; return -ERESTARTSYS;
if (1) { cinergyt2_suspend_rc(cinergyt2);
cinergyt2_suspend_rc(cinergyt2); cancel_rearming_delayed_work(&cinergyt2->query_work);
cancel_rearming_delayed_work(&cinergyt2->query_work);
mutex_lock(&cinergyt2->sem); mutex_lock(&cinergyt2->sem);
if (cinergyt2->streaming) if (cinergyt2->streaming)
cinergyt2_stop_stream_xfer(cinergyt2); cinergyt2_stop_stream_xfer(cinergyt2);
cinergyt2_sleep(cinergyt2, 1); cinergyt2_sleep(cinergyt2, 1);
mutex_unlock(&cinergyt2->sem); mutex_unlock(&cinergyt2->sem);
}
mutex_unlock(&cinergyt2->wq_sem);
return 0; return 0;
} }
......
...@@ -97,7 +97,7 @@ static ssize_t dvb_dmxdev_buffer_read(struct dvb_ringbuffer *src, ...@@ -97,7 +97,7 @@ static ssize_t dvb_dmxdev_buffer_read(struct dvb_ringbuffer *src,
if (avail > todo) if (avail > todo)
avail = todo; avail = todo;
ret = dvb_ringbuffer_read(src, buf, avail, 1); ret = dvb_ringbuffer_read(src, (u8 *)buf, avail, 1);
if (ret < 0) if (ret < 0)
break; break;
......
...@@ -175,7 +175,7 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * e ...@@ -175,7 +175,7 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * e
* @param nlen Number of bytes in needle. * @param nlen Number of bytes in needle.
* @return Pointer into haystack needle was found at, or NULL if not found. * @return Pointer into haystack needle was found at, or NULL if not found.
*/ */
static u8 *findstr(u8 * haystack, int hlen, u8 * needle, int nlen) static char *findstr(char * haystack, int hlen, char * needle, int nlen)
{ {
int i; int i;
...@@ -482,7 +482,7 @@ static int dvb_ca_en50221_parse_attributes(struct dvb_ca_private *ca, int slot) ...@@ -482,7 +482,7 @@ static int dvb_ca_en50221_parse_attributes(struct dvb_ca_private *ca, int slot)
} }
/* check it contains the correct DVB string */ /* check it contains the correct DVB string */
dvb_str = findstr(tuple, tupleLength, "DVB_CI_V", 8); dvb_str = findstr((char *)tuple, tupleLength, "DVB_CI_V", 8);
if (dvb_str == NULL) if (dvb_str == NULL)
return -EINVAL; return -EINVAL;
if (tupleLength < ((dvb_str - (char *) tuple) + 12)) if (tupleLength < ((dvb_str - (char *) tuple) + 12))
...@@ -513,8 +513,8 @@ static int dvb_ca_en50221_parse_attributes(struct dvb_ca_private *ca, int slot) ...@@ -513,8 +513,8 @@ static int dvb_ca_en50221_parse_attributes(struct dvb_ca_private *ca, int slot)
ca->slot_info[slot].config_option = tuple[0] & 0x3f; ca->slot_info[slot].config_option = tuple[0] & 0x3f;
/* OK, check it contains the correct strings */ /* OK, check it contains the correct strings */
if ((findstr(tuple, tupleLength, "DVB_HOST", 8) == NULL) || if ((findstr((char *)tuple, tupleLength, "DVB_HOST", 8) == NULL) ||
(findstr(tuple, tupleLength, "DVB_CI_MODULE", 13) == NULL)) (findstr((char *)tuple, tupleLength, "DVB_CI_MODULE", 13) == NULL))
break; break;
got_cftableentry = 1; got_cftableentry = 1;
...@@ -1300,7 +1300,7 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file, ...@@ -1300,7 +1300,7 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file,
struct dvb_ca_private *ca = dvbdev->priv; struct dvb_ca_private *ca = dvbdev->priv;
u8 slot, connection_id; u8 slot, connection_id;
int status; int status;
char fragbuf[HOST_LINK_BUF_SIZE]; u8 fragbuf[HOST_LINK_BUF_SIZE];
int fragpos = 0; int fragpos = 0;
int fraglen; int fraglen;
unsigned long timeout; unsigned long timeout;
...@@ -1486,7 +1486,7 @@ static ssize_t dvb_ca_en50221_io_read(struct file *file, char __user * buf, ...@@ -1486,7 +1486,7 @@ static ssize_t dvb_ca_en50221_io_read(struct file *file, char __user * buf,
} }
if ((status = dvb_ringbuffer_pkt_read(&ca->slot_info[slot].rx_buffer, idx, 2, if ((status = dvb_ringbuffer_pkt_read(&ca->slot_info[slot].rx_buffer, idx, 2,
buf + pktlen, fraglen, 1)) < 0) { (u8 *)buf + pktlen, fraglen, 1)) < 0) {
goto exit; goto exit;
} }
pktlen += fraglen; pktlen += fraglen;
......
...@@ -1068,7 +1068,7 @@ static int dvbdmx_write(struct dmx_demux *demux, const char *buf, size_t count) ...@@ -1068,7 +1068,7 @@ static int dvbdmx_write(struct dmx_demux *demux, const char *buf, size_t count)
if (mutex_lock_interruptible(&dvbdemux->mutex)) if (mutex_lock_interruptible(&dvbdemux->mutex))
return -ERESTARTSYS; return -ERESTARTSYS;
dvb_dmx_swfilter(dvbdemux, buf, count); dvb_dmx_swfilter(dvbdemux, (u8 *)buf, count);
mutex_unlock(&dvbdemux->mutex); mutex_unlock(&dvbdemux->mutex);
if (signal_pending(current)) if (signal_pending(current))
......
...@@ -103,7 +103,7 @@ struct dvb_frontend_ops { ...@@ -103,7 +103,7 @@ struct dvb_frontend_ops {
int (*tune)(struct dvb_frontend* fe, int (*tune)(struct dvb_frontend* fe,
struct dvb_frontend_parameters* params, struct dvb_frontend_parameters* params,
unsigned int mode_flags, unsigned int mode_flags,
int *delay, unsigned int *delay,
fe_status_t *status); fe_status_t *status);
/* get frontend tuning algorithm from the module */ /* get frontend tuning algorithm from the module */
int (*get_frontend_algo)(struct dvb_frontend *fe); int (*get_frontend_algo)(struct dvb_frontend *fe);
......
...@@ -347,7 +347,8 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) ...@@ -347,7 +347,8 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
{ {
struct dvb_net_priv *priv = dev->priv; struct dvb_net_priv *priv = dev->priv;
unsigned long skipped = 0L; unsigned long skipped = 0L;
u8 *ts, *ts_end, *from_where = NULL, ts_remain = 0, how_much = 0, new_ts = 1; const u8 *ts, *ts_end, *from_where = NULL;
u8 ts_remain = 0, how_much = 0, new_ts = 1;
struct ethhdr *ethh = NULL; struct ethhdr *ethh = NULL;
#ifdef ULE_DEBUG #ifdef ULE_DEBUG
...@@ -364,7 +365,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) ...@@ -364,7 +365,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
/* For all TS cells in current buffer. /* For all TS cells in current buffer.
* Appearently, we are called for every single TS cell. * Appearently, we are called for every single TS cell.
*/ */
for (ts = (char *)buf, ts_end = (char *)buf + buf_len; ts < ts_end; /* no default incr. */ ) { for (ts = buf, ts_end = buf + buf_len; ts < ts_end; /* no default incr. */ ) {
if (new_ts) { if (new_ts) {
/* We are about to process a new TS cell. */ /* We are about to process a new TS cell. */
......
...@@ -208,7 +208,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, ...@@ -208,7 +208,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
if ((id = dvbdev_get_free_id (adap, type)) < 0){ if ((id = dvbdev_get_free_id (adap, type)) < 0){
mutex_unlock(&dvbdev_register_lock); mutex_unlock(&dvbdev_register_lock);
*pdvbdev = NULL; *pdvbdev = NULL;
printk ("%s: could get find free device id...\n", __FUNCTION__); printk(KERN_ERR "%s: couldn't find free device id\n", __FUNCTION__);
return -ENFILE; return -ENFILE;
} }
...@@ -252,7 +252,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, ...@@ -252,7 +252,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
return PTR_ERR(clsdev); return PTR_ERR(clsdev);
} }
dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n", dprintk(KERN_DEBUG "DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n",
adap->num, dnames[type], id, nums2minor(adap->num, type, id), adap->num, dnames[type], id, nums2minor(adap->num, type, id),
nums2minor(adap->num, type, id)); nums2minor(adap->num, type, id));
...@@ -311,7 +311,7 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct modu ...@@ -311,7 +311,7 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct modu
memset (adap, 0, sizeof(struct dvb_adapter)); memset (adap, 0, sizeof(struct dvb_adapter));
INIT_LIST_HEAD (&adap->device_list); INIT_LIST_HEAD (&adap->device_list);
printk ("DVB: registering new adapter (%s).\n", name); printk(KERN_INFO "DVB: registering new adapter (%s)\n", name);
adap->num = num; adap->num = num;
adap->name = name; adap->name = name;
...@@ -407,13 +407,13 @@ static int __init init_dvbdev(void) ...@@ -407,13 +407,13 @@ static int __init init_dvbdev(void)
dev_t dev = MKDEV(DVB_MAJOR, 0); dev_t dev = MKDEV(DVB_MAJOR, 0);
if ((retval = register_chrdev_region(dev, MAX_DVB_MINORS, "DVB")) != 0) { if ((retval = register_chrdev_region(dev, MAX_DVB_MINORS, "DVB")) != 0) {
printk("dvb-core: unable to get major %d\n", DVB_MAJOR); printk(KERN_ERR "dvb-core: unable to get major %d\n", DVB_MAJOR);
return retval; return retval;
} }
cdev_init(&dvb_device_cdev, &dvb_device_fops); cdev_init(&dvb_device_cdev, &dvb_device_fops);
if ((retval = cdev_add(&dvb_device_cdev, dev, MAX_DVB_MINORS)) != 0) { if ((retval = cdev_add(&dvb_device_cdev, dev, MAX_DVB_MINORS)) != 0) {
printk("dvb-core: unable to get major %d\n", DVB_MAJOR); printk(KERN_ERR "dvb-core: unable register character device\n");
goto error; goto error;
} }
......
...@@ -2,7 +2,6 @@ config DVB_USB ...@@ -2,7 +2,6 @@ config DVB_USB
tristate "Support for various USB DVB devices" tristate "Support for various USB DVB devices"
depends on DVB_CORE && USB && I2C depends on DVB_CORE && USB && I2C
select FW_LOADER select FW_LOADER
select DVB_PLL
help help
By enabling this you will be able to choose the various supported By enabling this you will be able to choose the various supported
USB1.1 and USB2.0 DVB devices. USB1.1 and USB2.0 DVB devices.
...@@ -27,13 +26,14 @@ config DVB_USB_A800 ...@@ -27,13 +26,14 @@ config DVB_USB_A800
depends on DVB_USB depends on DVB_USB
select DVB_DIB3000MC select DVB_DIB3000MC
select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE
select DVB_PLL if !DVB_FE_CUSTOMISE
help help
Say Y here to support the AVerMedia AverTV DVB-T USB 2.0 (A800) receiver. Say Y here to support the AVerMedia AverTV DVB-T USB 2.0 (A800) receiver.
config DVB_USB_DIBUSB_MB config DVB_USB_DIBUSB_MB
tristate "DiBcom USB DVB-T devices (based on the DiB3000M-B) (see help for device list)" tristate "DiBcom USB DVB-T devices (based on the DiB3000M-B) (see help for device list)"
depends on DVB_USB depends on DVB_USB
select DVB_PLL select DVB_PLL if !DVB_FE_CUSTOMISE
select DVB_DIB3000MB select DVB_DIB3000MB
select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE
help help
...@@ -89,7 +89,7 @@ config DVB_USB_DIB0700 ...@@ -89,7 +89,7 @@ config DVB_USB_DIB0700
config DVB_USB_UMT_010 config DVB_USB_UMT_010
tristate "HanfTek UMT-010 DVB-T USB2.0 support" tristate "HanfTek UMT-010 DVB-T USB2.0 support"
depends on DVB_USB depends on DVB_USB
select DVB_PLL select DVB_PLL if !DVB_FE_CUSTOMISE
select DVB_DIB3000MC select DVB_DIB3000MC
select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE
help help
...@@ -98,7 +98,7 @@ config DVB_USB_UMT_010 ...@@ -98,7 +98,7 @@ config DVB_USB_UMT_010
config DVB_USB_CXUSB config DVB_USB_CXUSB
tristate "Conexant USB2.0 hybrid reference design support" tristate "Conexant USB2.0 hybrid reference design support"
depends on DVB_USB depends on DVB_USB
select DVB_PLL select DVB_PLL if !DVB_FE_CUSTOMISE
select DVB_CX22702 if !DVB_FE_CUSTOMISE select DVB_CX22702 if !DVB_FE_CUSTOMISE
select DVB_LGDT330X if !DVB_FE_CUSTOMISE select DVB_LGDT330X if !DVB_FE_CUSTOMISE
select DVB_MT352 if !DVB_FE_CUSTOMISE select DVB_MT352 if !DVB_FE_CUSTOMISE
...@@ -142,7 +142,7 @@ config DVB_USB_AU6610 ...@@ -142,7 +142,7 @@ config DVB_USB_AU6610
config DVB_USB_DIGITV config DVB_USB_DIGITV
tristate "Nebula Electronics uDigiTV DVB-T USB2.0 support" tristate "Nebula Electronics uDigiTV DVB-T USB2.0 support"
depends on DVB_USB depends on DVB_USB
select DVB_PLL select DVB_PLL if !DVB_FE_CUSTOMISE
select DVB_NXT6000 if !DVB_FE_CUSTOMISE select DVB_NXT6000 if !DVB_FE_CUSTOMISE
select DVB_MT352 if !DVB_FE_CUSTOMISE select DVB_MT352 if !DVB_FE_CUSTOMISE
help help
...@@ -188,6 +188,7 @@ config DVB_USB_NOVA_T_USB2 ...@@ -188,6 +188,7 @@ config DVB_USB_NOVA_T_USB2
depends on DVB_USB depends on DVB_USB
select DVB_DIB3000MC select DVB_DIB3000MC
select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE
select DVB_PLL if !DVB_FE_CUSTOMISE
help help
Say Y here to support the Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 receiver. Say Y here to support the Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 receiver.
...@@ -216,5 +217,23 @@ config DVB_USB_OPERA1 ...@@ -216,5 +217,23 @@ config DVB_USB_OPERA1
tristate "Opera1 DVB-S USB2.0 receiver" tristate "Opera1 DVB-S USB2.0 receiver"
depends on DVB_USB depends on DVB_USB
select DVB_STV0299 if !DVB_FE_CUSTOMISE select DVB_STV0299 if !DVB_FE_CUSTOMISE
select DVB_PLL if !DVB_FE_CUSTOMISE
help help
Say Y here to support the Opera DVB-S USB2.0 receiver. Say Y here to support the Opera DVB-S USB2.0 receiver.
config DVB_USB_AF9005
tristate "Afatech AF9005 DVB-T USB1.1 support"
depends on DVB_USB && EXPERIMENTAL
select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE
select DVB_TUNER_QT1010 if !DVB_FE_CUSTOMISE
help
Say Y here to support the Afatech AF9005 based DVB-T USB1.1 receiver
and the TerraTec Cinergy T USB XE (Rev.1)
config DVB_USB_AF9005_REMOTE
tristate "Afatech AF9005 default remote control support"
depends on DVB_USB_AF9005
help
Say Y here to support the default remote control decoding for the
Afatech AF9005 based receiver.
...@@ -55,4 +55,10 @@ dvb-usb-opera-objs = opera1.o ...@@ -55,4 +55,10 @@ dvb-usb-opera-objs = opera1.o
obj-$(CONFIG_DVB_USB_OPERA1) += dvb-usb-opera.o obj-$(CONFIG_DVB_USB_OPERA1) += dvb-usb-opera.o
EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ dvb-usb-af9005-objs = af9005.o af9005-fe.o
obj-$(CONFIG_DVB_USB_AF9005) += dvb-usb-af9005.o
dvb-usb-af9005-remote-objs = af9005-remote.o
obj-$(CONFIG_DVB_USB_AF9005_REMOTE) += dvb-usb-af9005-remote.o
EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
This diff is collapsed.
/* DVB USB compliant Linux driver for the Afatech 9005
* USB1.1 DVB-T receiver.
*
* Standard remote decode function
*
* Copyright (C) 2007 Luca Olivetti (luca@ventoso.org)
*
* Thanks to Afatech who kindly provided information.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* see Documentation/dvb/REDME.dvb-usb for more information
*/
#include "af9005.h"
/* debug */
int dvb_usb_af9005_remote_debug;
module_param_named(debug, dvb_usb_af9005_remote_debug, int, 0644);
MODULE_PARM_DESC(debug,
"enable (1) or disable (0) debug messages."
DVB_USB_DEBUG_STATUS);
#define deb_decode(args...) dprintk(dvb_usb_af9005_remote_debug,0x01,args)
struct dvb_usb_rc_key af9005_rc_keys[] = {
{0x01, 0xb7, KEY_POWER},
{0x01, 0xa7, KEY_VOLUMEUP},
{0x01, 0x87, KEY_CHANNELUP},
{0x01, 0x7f, KEY_MUTE},
{0x01, 0xbf, KEY_VOLUMEDOWN},
{0x01, 0x3f, KEY_CHANNELDOWN},
{0x01, 0xdf, KEY_1},
{0x01, 0x5f, KEY_2},
{0x01, 0x9f, KEY_3},
{0x01, 0x1f, KEY_4},
{0x01, 0xef, KEY_5},
{0x01, 0x6f, KEY_6},
{0x01, 0xaf, KEY_7},
{0x01, 0x27, KEY_8},
{0x01, 0x07, KEY_9},
{0x01, 0xcf, KEY_ZOOM},
{0x01, 0x4f, KEY_0},
{0x01, 0x8f, KEY_GOTO}, /* marked jump on the remote */
{0x00, 0xbd, KEY_POWER},
{0x00, 0x7d, KEY_VOLUMEUP},
{0x00, 0xfd, KEY_CHANNELUP},
{0x00, 0x9d, KEY_MUTE},
{0x00, 0x5d, KEY_VOLUMEDOWN},
{0x00, 0xdd, KEY_CHANNELDOWN},
{0x00, 0xad, KEY_1},
{0x00, 0x6d, KEY_2},
{0x00, 0xed, KEY_3},
{0x00, 0x8d, KEY_4},
{0x00, 0x4d, KEY_5},
{0x00, 0xcd, KEY_6},
{0x00, 0xb5, KEY_7},
{0x00, 0x75, KEY_8},
{0x00, 0xf5, KEY_9},
{0x00, 0x95, KEY_ZOOM},
{0x00, 0x55, KEY_0},
{0x00, 0xd5, KEY_GOTO}, /* marked jump on the remote */
};
int af9005_rc_keys_size = ARRAY_SIZE(af9005_rc_keys);
static int repeatable_keys[] = {
KEY_VOLUMEUP,
KEY_VOLUMEDOWN,
KEY_CHANNELUP,
KEY_CHANNELDOWN
};
int af9005_rc_decode(struct dvb_usb_device *d, u8 * data, int len, u32 * event,
int *state)
{
u16 mark, space;
u32 result;
u8 cust, dat, invdat;
int i;
if (len >= 6) {
mark = (u16) (data[0] << 8) + data[1];
space = (u16) (data[2] << 8) + data[3];
if (space * 3 < mark) {
for (i = 0; i < ARRAY_SIZE(repeatable_keys); i++) {
if (d->last_event == repeatable_keys[i]) {
*state = REMOTE_KEY_REPEAT;
*event = d->last_event;
deb_decode("repeat key, event %x\n",
*event);
return 0;
}
}
deb_decode("repeated key ignored (non repeatable)\n");
return 0;
} else if (len >= 33 * 4) { /*32 bits + start code */
result = 0;
for (i = 4; i < 4 + 32 * 4; i += 4) {
result <<= 1;
mark = (u16) (data[i] << 8) + data[i + 1];
mark >>= 1;
space = (u16) (data[i + 2] << 8) + data[i + 3];
space >>= 1;
if (mark * 2 > space)
result += 1;
}
deb_decode("key pressed, raw value %x\n", result);
if ((result & 0xff000000) != 0xfe000000) {
deb_decode
("doesn't start with 0xfe, ignored\n");
return 0;
}
cust = (result >> 16) & 0xff;
dat = (result >> 8) & 0xff;
invdat = (~result) & 0xff;
if (dat != invdat) {
deb_decode("code != inverted code\n");
return 0;
}
for (i = 0; i < af9005_rc_keys_size; i++) {
if (af9005_rc_keys[i].custom == cust
&& af9005_rc_keys[i].data == dat) {
*event = af9005_rc_keys[i].event;
*state = REMOTE_KEY_PRESSED;
deb_decode
("key pressed, event %x\n", *event);
return 0;
}
}
deb_decode("not found in table\n");
}
}
return 0;
}
EXPORT_SYMBOL(af9005_rc_keys);
EXPORT_SYMBOL(af9005_rc_keys_size);
EXPORT_SYMBOL(af9005_rc_decode);
MODULE_AUTHOR("Luca Olivetti <luca@ventoso.org>");
MODULE_DESCRIPTION
("Standard remote control decoder for Afatech 9005 DVB-T USB1.1 stick");
MODULE_VERSION("1.0");
MODULE_LICENSE("GPL");
/*
File automatically generated by createinit.py using data
extracted from AF05BDA.sys (windows driver):
dd if=AF05BDA.sys of=initsequence bs=1 skip=88316 count=1110
python createinit.py > af9005-script.h
*/
typedef struct {
u16 reg;
u8 pos;
u8 len;
u8 val;
} RegDesc;
RegDesc script[] = {
{0xa180, 0x0, 0x8, 0xa},
{0xa181, 0x0, 0x8, 0xd7},
{0xa182, 0x0, 0x8, 0xa3},
{0xa0a0, 0x0, 0x8, 0x0},
{0xa0a1, 0x0, 0x5, 0x0},
{0xa0a1, 0x5, 0x1, 0x1},
{0xa0c0, 0x0, 0x4, 0x1},
{0xa20e, 0x4, 0x4, 0xa},
{0xa20f, 0x0, 0x8, 0x40},
{0xa210, 0x0, 0x8, 0x8},
{0xa32a, 0x0, 0x4, 0xa},
{0xa32c, 0x0, 0x8, 0x20},
{0xa32b, 0x0, 0x8, 0x15},
{0xa1a0, 0x1, 0x1, 0x1},
{0xa000, 0x0, 0x1, 0x1},
{0xa000, 0x1, 0x1, 0x0},
{0xa001, 0x1, 0x1, 0x1},
{0xa001, 0x0, 0x1, 0x0},
{0xa001, 0x5, 0x1, 0x0},
{0xa00e, 0x0, 0x5, 0x10},
{0xa00f, 0x0, 0x3, 0x4},
{0xa00f, 0x3, 0x3, 0x5},
{0xa010, 0x0, 0x3, 0x4},
{0xa010, 0x3, 0x3, 0x5},
{0xa016, 0x4, 0x4, 0x3},
{0xa01f, 0x0, 0x6, 0xa},
{0xa020, 0x0, 0x6, 0xa},
{0xa2bc, 0x0, 0x1, 0x1},
{0xa2bc, 0x5, 0x1, 0x1},
{0xa015, 0x0, 0x8, 0x50},
{0xa016, 0x0, 0x1, 0x0},
{0xa02a, 0x0, 0x8, 0x50},
{0xa029, 0x0, 0x8, 0x4b},
{0xa614, 0x0, 0x8, 0x46},
{0xa002, 0x0, 0x5, 0x19},
{0xa003, 0x0, 0x5, 0x1a},
{0xa004, 0x0, 0x5, 0x19},
{0xa005, 0x0, 0x5, 0x1a},
{0xa008, 0x0, 0x8, 0x69},
{0xa009, 0x0, 0x2, 0x2},
{0xae1b, 0x0, 0x8, 0x69},
{0xae1c, 0x0, 0x8, 0x2},
{0xae1d, 0x0, 0x8, 0x2a},
{0xa022, 0x0, 0x8, 0xaa},
{0xa006, 0x0, 0x8, 0xc8},
{0xa007, 0x0, 0x2, 0x0},
{0xa00c, 0x0, 0x8, 0xba},
{0xa00d, 0x0, 0x2, 0x2},
{0xa608, 0x0, 0x8, 0xba},
{0xa60e, 0x0, 0x2, 0x2},
{0xa609, 0x0, 0x8, 0x80},
{0xa60e, 0x2, 0x2, 0x3},
{0xa00a, 0x0, 0x8, 0xb6},
{0xa00b, 0x0, 0x2, 0x0},
{0xa011, 0x0, 0x8, 0xb9},
{0xa012, 0x0, 0x2, 0x0},
{0xa013, 0x0, 0x8, 0xbd},
{0xa014, 0x0, 0x2, 0x2},
{0xa366, 0x0, 0x1, 0x1},
{0xa2bc, 0x3, 0x1, 0x0},
{0xa2bd, 0x0, 0x8, 0xa},
{0xa2be, 0x0, 0x8, 0x14},
{0xa2bf, 0x0, 0x8, 0x8},
{0xa60a, 0x0, 0x8, 0xbd},
{0xa60e, 0x4, 0x2, 0x2},
{0xa60b, 0x0, 0x8, 0x86},
{0xa60e, 0x6, 0x2, 0x3},
{0xa001, 0x2, 0x2, 0x1},
{0xa1c7, 0x0, 0x8, 0xf5},
{0xa03d, 0x0, 0x8, 0xb1},
{0xa616, 0x0, 0x8, 0xff},
{0xa617, 0x0, 0x8, 0xad},
{0xa618, 0x0, 0x8, 0xad},
{0xa61e, 0x3, 0x1, 0x1},
{0xae1a, 0x0, 0x8, 0x0},
{0xae19, 0x0, 0x8, 0xc8},
{0xae18, 0x0, 0x8, 0x61},
{0xa140, 0x0, 0x8, 0x0},
{0xa141, 0x0, 0x8, 0xc8},
{0xa142, 0x0, 0x7, 0x61},
{0xa023, 0x0, 0x8, 0xff},
{0xa021, 0x0, 0x8, 0xad},
{0xa026, 0x0, 0x1, 0x0},
{0xa024, 0x0, 0x8, 0xff},
{0xa025, 0x0, 0x8, 0xff},
{0xa1c8, 0x0, 0x8, 0xf},
{0xa2bc, 0x1, 0x1, 0x0},
{0xa60c, 0x0, 0x4, 0x5},
{0xa60c, 0x4, 0x4, 0x6},
{0xa60d, 0x0, 0x8, 0xa},
{0xa371, 0x0, 0x1, 0x1},
{0xa366, 0x1, 0x3, 0x7},
{0xa338, 0x0, 0x8, 0x10},
{0xa339, 0x0, 0x6, 0x7},
{0xa33a, 0x0, 0x6, 0x1f},
{0xa33b, 0x0, 0x8, 0xf6},
{0xa33c, 0x3, 0x5, 0x4},
{0xa33d, 0x4, 0x4, 0x0},
{0xa33d, 0x1, 0x1, 0x1},
{0xa33d, 0x2, 0x1, 0x1},
{0xa33d, 0x3, 0x1, 0x1},
{0xa16d, 0x0, 0x4, 0xf},
{0xa161, 0x0, 0x5, 0x5},
{0xa162, 0x0, 0x4, 0x5},
{0xa165, 0x0, 0x8, 0xff},
{0xa166, 0x0, 0x8, 0x9c},
{0xa2c3, 0x0, 0x4, 0x5},
{0xa61a, 0x0, 0x6, 0xf},
{0xb200, 0x0, 0x8, 0xa1},
{0xb201, 0x0, 0x8, 0x7},
{0xa093, 0x0, 0x1, 0x0},
{0xa093, 0x1, 0x5, 0xf},
{0xa094, 0x0, 0x8, 0xff},
{0xa095, 0x0, 0x8, 0xf},
{0xa080, 0x2, 0x5, 0x3},
{0xa081, 0x0, 0x4, 0x0},
{0xa081, 0x4, 0x4, 0x9},
{0xa082, 0x0, 0x5, 0x1f},
{0xa08d, 0x0, 0x8, 0x1},
{0xa083, 0x0, 0x8, 0x32},
{0xa084, 0x0, 0x1, 0x0},
{0xa08e, 0x0, 0x8, 0x3},
{0xa085, 0x0, 0x8, 0x32},
{0xa086, 0x0, 0x3, 0x0},
{0xa087, 0x0, 0x8, 0x6e},
{0xa088, 0x0, 0x5, 0x15},
{0xa089, 0x0, 0x8, 0x0},
{0xa08a, 0x0, 0x5, 0x19},
{0xa08b, 0x0, 0x8, 0x92},
{0xa08c, 0x0, 0x5, 0x1c},
{0xa120, 0x0, 0x8, 0x0},
{0xa121, 0x0, 0x5, 0x10},
{0xa122, 0x0, 0x8, 0x0},
{0xa123, 0x0, 0x7, 0x40},
{0xa123, 0x7, 0x1, 0x0},
{0xa124, 0x0, 0x8, 0x13},
{0xa125, 0x0, 0x7, 0x10},
{0xa1c0, 0x0, 0x8, 0x0},
{0xa1c1, 0x0, 0x5, 0x4},
{0xa1c2, 0x0, 0x8, 0x0},
{0xa1c3, 0x0, 0x5, 0x10},
{0xa1c3, 0x5, 0x3, 0x0},
{0xa1c4, 0x0, 0x6, 0x0},
{0xa1c5, 0x0, 0x7, 0x10},
{0xa100, 0x0, 0x8, 0x0},
{0xa101, 0x0, 0x5, 0x10},
{0xa102, 0x0, 0x8, 0x0},
{0xa103, 0x0, 0x7, 0x40},
{0xa103, 0x7, 0x1, 0x0},
{0xa104, 0x0, 0x8, 0x18},
{0xa105, 0x0, 0x7, 0xa},
{0xa106, 0x0, 0x8, 0x20},
{0xa107, 0x0, 0x8, 0x40},
{0xa108, 0x0, 0x4, 0x0},
{0xa38c, 0x0, 0x8, 0xfc},
{0xa38d, 0x0, 0x8, 0x0},
{0xa38e, 0x0, 0x8, 0x7e},
{0xa38f, 0x0, 0x8, 0x0},
{0xa390, 0x0, 0x8, 0x2f},
{0xa60f, 0x5, 0x1, 0x1},
{0xa170, 0x0, 0x8, 0xdc},
{0xa171, 0x0, 0x2, 0x0},
{0xa2ae, 0x0, 0x1, 0x1},
{0xa2ae, 0x1, 0x1, 0x1},
{0xa392, 0x0, 0x1, 0x1},
{0xa391, 0x2, 0x1, 0x0},
{0xabc1, 0x0, 0x8, 0xff},
{0xabc2, 0x0, 0x8, 0x0},
{0xabc8, 0x0, 0x8, 0x8},
{0xabca, 0x0, 0x8, 0x10},
{0xabcb, 0x0, 0x1, 0x0},
{0xabc3, 0x5, 0x3, 0x7},
{0xabc0, 0x6, 0x1, 0x0},
{0xabc0, 0x4, 0x2, 0x0},
{0xa344, 0x4, 0x4, 0x1},
{0xabc0, 0x7, 0x1, 0x1},
{0xabc0, 0x2, 0x1, 0x1},
{0xa345, 0x0, 0x8, 0x66},
{0xa346, 0x0, 0x8, 0x66},
{0xa347, 0x0, 0x4, 0x0},
{0xa343, 0x0, 0x4, 0xa},
{0xa347, 0x4, 0x4, 0x2},
{0xa348, 0x0, 0x4, 0xc},
{0xa348, 0x4, 0x4, 0x7},
{0xa349, 0x0, 0x6, 0x2},
};
This diff is collapsed.
This diff is collapsed.
...@@ -354,41 +354,35 @@ static struct mt352_config cxusb_mt352_config = { ...@@ -354,41 +354,35 @@ static struct mt352_config cxusb_mt352_config = {
/* Callbacks for DVB USB */ /* Callbacks for DVB USB */
static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap) static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
{ {
u8 bpll[4] = { 0x0b, 0xdc, 0x9c, 0xa0 }; dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap,
adap->pll_addr = 0x61; DVB_PLL_FMD1216ME);
memcpy(adap->pll_init, bpll, 4);
adap->pll_desc = &dvb_pll_fmd1216me;
adap->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c;
adap->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;
return 0; return 0;
} }
static int cxusb_dee1601_tuner_attach(struct dvb_usb_adapter *adap) static int cxusb_dee1601_tuner_attach(struct dvb_usb_adapter *adap)
{ {
dvb_attach(dvb_pll_attach, adap->fe, 0x61, dvb_attach(dvb_pll_attach, adap->fe, 0x61,
NULL, &dvb_pll_thomson_dtt7579); NULL, DVB_PLL_THOMSON_DTT7579);
return 0; return 0;
} }
static int cxusb_lgz201_tuner_attach(struct dvb_usb_adapter *adap) static int cxusb_lgz201_tuner_attach(struct dvb_usb_adapter *adap)
{ {
dvb_attach(dvb_pll_attach, adap->fe, 0x61, NULL, &dvb_pll_lg_z201); dvb_attach(dvb_pll_attach, adap->fe, 0x61, NULL, DVB_PLL_LG_Z201);
return 0; return 0;
} }
static int cxusb_dtt7579_tuner_attach(struct dvb_usb_adapter *adap) static int cxusb_dtt7579_tuner_attach(struct dvb_usb_adapter *adap)
{ {
dvb_attach(dvb_pll_attach, adap->fe, 0x60, dvb_attach(dvb_pll_attach, adap->fe, 0x60,
NULL, &dvb_pll_thomson_dtt7579); NULL, DVB_PLL_THOMSON_DTT7579);
return 0; return 0;
} }
static int cxusb_lgh064f_tuner_attach(struct dvb_usb_adapter *adap) static int cxusb_lgh064f_tuner_attach(struct dvb_usb_adapter *adap)
{ {
dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap, dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap,
&dvb_pll_lg_tdvs_h06xf); DVB_PLL_LG_TDVS_H06XF);
return 0; return 0;
} }
......
...@@ -295,7 +295,7 @@ int dibusb_dib3000mc_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -295,7 +295,7 @@ int dibusb_dib3000mc_tuner_attach(struct dvb_usb_adapter *adap)
tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1); tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1);
if (dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk3000p_mt2060_config, if1) == NULL) { if (dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk3000p_mt2060_config, if1) == NULL) {
/* not found - use panasonic pll parameters */ /* not found - use panasonic pll parameters */
if (dvb_attach(dvb_pll_attach, adap->fe, 0x60, tun_i2c, &dvb_pll_env57h1xd5) == NULL) if (dvb_attach(dvb_pll_attach, adap->fe, 0x60, tun_i2c, DVB_PLL_ENV57H1XD5) == NULL)
return -ENOMEM; return -ENOMEM;
} else { } else {
st->mt2060_present = 1; st->mt2060_present = 1;
......
...@@ -14,6 +14,14 @@ ...@@ -14,6 +14,14 @@
*/ */
#include "dibusb.h" #include "dibusb.h"
static int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
{
struct dvb_usb_adapter *adap = fe->dvb->priv;
struct dibusb_state *st = adap->priv;
return st->ops.tuner_pass_ctrl(fe, enable, st->tuner_addr);
}
static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap) static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap)
{ {
struct dib3000_config demod_cfg; struct dib3000_config demod_cfg;
...@@ -21,21 +29,34 @@ static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -21,21 +29,34 @@ static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap)
demod_cfg.demod_address = 0x8; demod_cfg.demod_address = 0x8;
if ((adap->fe = dib3000mb_attach(&demod_cfg,&adap->dev->i2c_adap,&st->ops)) == NULL) if ((adap->fe = dvb_attach(dib3000mb_attach, &demod_cfg,
&adap->dev->i2c_adap, &st->ops)) == NULL)
return -ENODEV; return -ENODEV;
adap->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c; adap->fe->ops.i2c_gate_ctrl = dib3000mb_i2c_gate_ctrl;
adap->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;
adap->tuner_pass_ctrl = st->ops.tuner_pass_ctrl;
return 0; return 0;
} }
static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap) static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap)
{ {
adap->pll_addr = 0x61; struct dibusb_state *st = adap->priv;
adap->pll_desc = &dvb_pll_tua6010xs;
st->tuner_addr = 0x61;
dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap,
DVB_PLL_TUA6010XS);
return 0;
}
static int dibusb_panasonic_tuner_attach(struct dvb_usb_adapter *adap)
{
struct dibusb_state *st = adap->priv;
st->tuner_addr = 0x60;
dvb_attach(dvb_pll_attach, adap->fe, 0x60, &adap->dev->i2c_adap,
DVB_PLL_TDA665X);
return 0; return 0;
} }
...@@ -50,30 +71,28 @@ static int dibusb_tuner_probe_and_attach(struct dvb_usb_adapter *adap) ...@@ -50,30 +71,28 @@ static int dibusb_tuner_probe_and_attach(struct dvb_usb_adapter *adap)
{ .flags = 0, .buf = b, .len = 2 }, { .flags = 0, .buf = b, .len = 2 },
{ .flags = I2C_M_RD, .buf = b2, .len = 1 }, { .flags = I2C_M_RD, .buf = b2, .len = 1 },
}; };
struct dibusb_state *st = adap->priv;
/* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */ /* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */
msg[0].addr = msg[1].addr = 0x60; msg[0].addr = msg[1].addr = st->tuner_addr = 0x60;
if (adap->tuner_pass_ctrl) if (adap->fe->ops.i2c_gate_ctrl)
adap->tuner_pass_ctrl(adap->fe,1,msg[0].addr); adap->fe->ops.i2c_gate_ctrl(adap->fe,1);
if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) { if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) {
err("tuner i2c write failed."); err("tuner i2c write failed.");
ret = -EREMOTEIO; ret = -EREMOTEIO;
} }
if (adap->tuner_pass_ctrl) if (adap->fe->ops.i2c_gate_ctrl)
adap->tuner_pass_ctrl(adap->fe,0,msg[0].addr); adap->fe->ops.i2c_gate_ctrl(adap->fe,0);
if (b2[0] == 0xfe) { if (b2[0] == 0xfe) {
info("This device has the Thomson Cable onboard. Which is default."); info("This device has the Thomson Cable onboard. Which is default.");
dibusb_thomson_tuner_attach(adap); ret = dibusb_thomson_tuner_attach(adap);
} else { } else {
u8 bpll[4] = { 0x0b, 0xf5, 0x85, 0xab };
info("This device has the Panasonic ENV77H11D5 onboard."); info("This device has the Panasonic ENV77H11D5 onboard.");
adap->pll_addr = 0x60; ret = dibusb_panasonic_tuner_attach(adap);
memcpy(adap->pll_init,bpll,4);
adap->pll_desc = &dvb_pll_tda665x;
} }
return ret; return ret;
......
...@@ -99,6 +99,7 @@ ...@@ -99,6 +99,7 @@
struct dibusb_state { struct dibusb_state {
struct dib_fe_xfer_ops ops; struct dib_fe_xfer_ops ops;
int mt2060_present; int mt2060_present;
u8 tuner_addr;
}; };
struct dibusb_device_state { struct dibusb_device_state {
......
...@@ -118,7 +118,8 @@ static int digitv_nxt6000_tuner_set_params(struct dvb_frontend *fe, struct dvb_f ...@@ -118,7 +118,8 @@ static int digitv_nxt6000_tuner_set_params(struct dvb_frontend *fe, struct dvb_f
{ {
struct dvb_usb_adapter *adap = fe->dvb->priv; struct dvb_usb_adapter *adap = fe->dvb->priv;
u8 b[5]; u8 b[5];
dvb_usb_tuner_calc_regs(fe,fep,b, 5);
fe->ops.tuner_ops.calc_regs(fe, fep, b, sizeof(b));
if (fe->ops.i2c_gate_ctrl) if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1); fe->ops.i2c_gate_ctrl(fe, 1);
return digitv_ctrl_msg(adap->dev, USB_WRITE_TUNER, 0, &b[1], 4, NULL, 0); return digitv_ctrl_msg(adap->dev, USB_WRITE_TUNER, 0, &b[1], 4, NULL, 0);
...@@ -130,12 +131,14 @@ static struct nxt6000_config digitv_nxt6000_config = { ...@@ -130,12 +131,14 @@ static struct nxt6000_config digitv_nxt6000_config = {
static int digitv_frontend_attach(struct dvb_usb_adapter *adap) static int digitv_frontend_attach(struct dvb_usb_adapter *adap)
{ {
struct digitv_state *st = adap->dev->priv;
if ((adap->fe = dvb_attach(mt352_attach, &digitv_mt352_config, &adap->dev->i2c_adap)) != NULL) { if ((adap->fe = dvb_attach(mt352_attach, &digitv_mt352_config, &adap->dev->i2c_adap)) != NULL) {
adap->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; st->is_nxt6000 = 0;
return 0; return 0;
} }
if ((adap->fe = dvb_attach(nxt6000_attach, &digitv_nxt6000_config, &adap->dev->i2c_adap)) != NULL) { if ((adap->fe = dvb_attach(nxt6000_attach, &digitv_nxt6000_config, &adap->dev->i2c_adap)) != NULL) {
adap->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params; st->is_nxt6000 = 1;
return 0; return 0;
} }
return -EIO; return -EIO;
...@@ -143,8 +146,14 @@ static int digitv_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -143,8 +146,14 @@ static int digitv_frontend_attach(struct dvb_usb_adapter *adap)
static int digitv_tuner_attach(struct dvb_usb_adapter *adap) static int digitv_tuner_attach(struct dvb_usb_adapter *adap)
{ {
adap->pll_addr = 0x60; struct digitv_state *st = adap->dev->priv;
adap->pll_desc = &dvb_pll_tded4;
if (!dvb_attach(dvb_pll_attach, adap->fe, 0x60, NULL, DVB_PLL_TDED4))
return -ENODEV;
if (st->is_nxt6000)
adap->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params;
return 0; return 0;
} }
...@@ -273,6 +282,8 @@ static struct dvb_usb_device_properties digitv_properties = { ...@@ -273,6 +282,8 @@ static struct dvb_usb_device_properties digitv_properties = {
.usb_ctrl = CYPRESS_FX2, .usb_ctrl = CYPRESS_FX2,
.firmware = "dvb-usb-digitv-02.fw", .firmware = "dvb-usb-digitv-02.fw",
.size_of_priv = sizeof(struct digitv_state),
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
......
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
#define DVB_USB_LOG_PREFIX "digitv" #define DVB_USB_LOG_PREFIX "digitv"
#include "dvb-usb.h" #include "dvb-usb.h"
struct digitv_state {
int is_nxt6000;
};
extern int dvb_usb_digitv_debug; extern int dvb_usb_digitv_debug;
#define deb_rc(args...) dprintk(dvb_usb_digitv_debug,0x01,args) #define deb_rc(args...) dprintk(dvb_usb_digitv_debug,0x01,args)
......
...@@ -46,82 +46,3 @@ int dvb_usb_i2c_exit(struct dvb_usb_device *d) ...@@ -46,82 +46,3 @@ int dvb_usb_i2c_exit(struct dvb_usb_device *d)
d->state &= ~DVB_USB_STATE_I2C; d->state &= ~DVB_USB_STATE_I2C;
return 0; return 0;
} }
int dvb_usb_tuner_init_i2c(struct dvb_frontend *fe)
{
struct dvb_usb_adapter *adap = fe->dvb->priv;
struct i2c_msg msg = { .addr = adap->pll_addr, .flags = 0, .buf = adap->pll_init, .len = 4 };
int ret = 0;
/* if pll_desc is not used */
if (adap->pll_desc == NULL)
return 0;
if (adap->tuner_pass_ctrl)
adap->tuner_pass_ctrl(fe, 1, adap->pll_addr);
deb_pll("pll init: %x\n",adap->pll_addr);
deb_pll("pll-buf: %x %x %x %x\n",adap->pll_init[0], adap->pll_init[1],
adap->pll_init[2], adap->pll_init[3]);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
if (i2c_transfer (&adap->dev->i2c_adap, &msg, 1) != 1) {
err("tuner i2c write failed for pll_init.");
ret = -EREMOTEIO;
}
msleep(1);
if (adap->tuner_pass_ctrl)
adap->tuner_pass_ctrl(fe,0,adap->pll_addr);
return ret;
}
EXPORT_SYMBOL(dvb_usb_tuner_init_i2c);
int dvb_usb_tuner_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep, u8 *b, int buf_len)
{
struct dvb_usb_adapter *adap = fe->dvb->priv;
if (buf_len != 5)
return -EINVAL;
if (adap->pll_desc == NULL)
return 0;
deb_pll("pll addr: %x, freq: %d %p\n",adap->pll_addr, fep->frequency, adap->pll_desc);
b[0] = adap->pll_addr;
dvb_pll_configure(adap->pll_desc, &b[1], fep->frequency, fep->u.ofdm.bandwidth);
deb_pll("pll-buf: %x %x %x %x %x\n",b[0],b[1],b[2],b[3],b[4]);
return 5;
}
EXPORT_SYMBOL(dvb_usb_tuner_calc_regs);
int dvb_usb_tuner_set_params_i2c(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
{
struct dvb_usb_adapter *adap = fe->dvb->priv;
int ret = 0;
u8 b[5];
struct i2c_msg msg = { .addr = adap->pll_addr, .flags = 0, .buf = &b[1], .len = 4 };
dvb_usb_tuner_calc_regs(fe,fep,b,5);
if (adap->tuner_pass_ctrl)
adap->tuner_pass_ctrl(fe, 1, adap->pll_addr);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
if (i2c_transfer(&adap->dev->i2c_adap, &msg, 1) != 1) {
err("tuner i2c write failed for pll_set.");
ret = -EREMOTEIO;
}
msleep(1);
if (adap->tuner_pass_ctrl)
adap->tuner_pass_ctrl(fe, 0, adap->pll_addr);
return ret;
}
EXPORT_SYMBOL(dvb_usb_tuner_set_params_i2c);
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
/* Vendor IDs */ /* Vendor IDs */
#define USB_VID_ADSTECH 0x06e1 #define USB_VID_ADSTECH 0x06e1
#define USB_VID_AFATECH 0x15a4
#define USB_VID_ALCOR_MICRO 0x058f #define USB_VID_ALCOR_MICRO 0x058f
#define USB_VID_ALINK 0x05e3
#define USB_VID_ANCHOR 0x0547 #define USB_VID_ANCHOR 0x0547
#define USB_VID_ANUBIS_ELECTRONIC 0x10fd #define USB_VID_ANUBIS_ELECTRONIC 0x10fd
#define USB_VID_AVERMEDIA 0x07ca #define USB_VID_AVERMEDIA 0x07ca
...@@ -35,6 +37,7 @@ ...@@ -35,6 +37,7 @@
#define USB_VID_MSI 0x0db0 #define USB_VID_MSI 0x0db0
#define USB_VID_OPERA1 0x695c #define USB_VID_OPERA1 0x695c
#define USB_VID_PINNACLE 0x2304 #define USB_VID_PINNACLE 0x2304
#define USB_VID_TERRATEC 0x0ccd
#define USB_VID_VISIONPLUS 0x13d3 #define USB_VID_VISIONPLUS 0x13d3
#define USB_VID_TWINHAN 0x1822 #define USB_VID_TWINHAN 0x1822
#define USB_VID_ULTIMA_ELECTRONIC 0x05d8 #define USB_VID_ULTIMA_ELECTRONIC 0x05d8
...@@ -44,6 +47,8 @@ ...@@ -44,6 +47,8 @@
/* Product IDs */ /* Product IDs */
#define USB_PID_ADSTECH_USB2_COLD 0xa333 #define USB_PID_ADSTECH_USB2_COLD 0xa333
#define USB_PID_ADSTECH_USB2_WARM 0xa334 #define USB_PID_ADSTECH_USB2_WARM 0xa334
#define USB_PID_AFATECH_AF9005 0x9020
#define USB_VID_ALINK_DTU 0xf170
#define USB_PID_AVERMEDIA_DVBT_USB_COLD 0x0001 #define USB_PID_AVERMEDIA_DVBT_USB_COLD 0x0001
#define USB_PID_AVERMEDIA_DVBT_USB_WARM 0x0002 #define USB_PID_AVERMEDIA_DVBT_USB_WARM 0x0002
#define USB_PID_AVERMEDIA_DVBT_USB2_COLD 0xa800 #define USB_PID_AVERMEDIA_DVBT_USB2_COLD 0xa800
...@@ -69,6 +74,7 @@ ...@@ -69,6 +74,7 @@
#define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1 #define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1
#define USB_PID_KWORLD_VSTREAM_COLD 0x17de #define USB_PID_KWORLD_VSTREAM_COLD 0x17de
#define USB_PID_KWORLD_VSTREAM_WARM 0x17df #define USB_PID_KWORLD_VSTREAM_WARM 0x17df
#define USB_PID_TERRATEC_CINERGY_T_USB_XE 0x0055
#define USB_PID_TWINHAN_VP7041_COLD 0x3201 #define USB_PID_TWINHAN_VP7041_COLD 0x3201
#define USB_PID_TWINHAN_VP7041_WARM 0x3202 #define USB_PID_TWINHAN_VP7041_WARM 0x3202
#define USB_PID_TWINHAN_VP7020_COLD 0x3203 #define USB_PID_TWINHAN_VP7020_COLD 0x3203
......
...@@ -110,7 +110,7 @@ int dvb_usb_remote_init(struct dvb_usb_device *d) ...@@ -110,7 +110,7 @@ int dvb_usb_remote_init(struct dvb_usb_device *d)
input_dev->name = "IR-receiver inside an USB DVB receiver"; input_dev->name = "IR-receiver inside an USB DVB receiver";
input_dev->phys = d->rc_phys; input_dev->phys = d->rc_phys;
usb_to_input_id(d->udev, &input_dev->id); usb_to_input_id(d->udev, &input_dev->id);
input_dev->cdev.dev = &d->udev->dev; input_dev->dev.parent = &d->udev->dev;
/* set the bits for the keys */ /* set the bits for the keys */
deb_rc("key map size: %d\n", d->props.rc_key_map_size); deb_rc("key map size: %d\n", d->props.rc_key_map_size);
......
...@@ -297,12 +297,6 @@ struct dvb_usb_adapter { ...@@ -297,12 +297,6 @@ struct dvb_usb_adapter {
int feedcount; int feedcount;
int pid_filtering; int pid_filtering;
/* tuner programming information */
u8 pll_addr;
u8 pll_init[4];
struct dvb_pll_desc *pll_desc;
int (*tuner_pass_ctrl) (struct dvb_frontend *, int, u8);
/* dvb */ /* dvb */
struct dvb_adapter dvb_adap; struct dvb_adapter dvb_adap;
struct dmxdev dmxdev; struct dmxdev dmxdev;
...@@ -388,11 +382,6 @@ extern int dvb_usb_generic_write(struct dvb_usb_device *, u8 *, u16); ...@@ -388,11 +382,6 @@ extern int dvb_usb_generic_write(struct dvb_usb_device *, u8 *, u16);
/* commonly used remote control parsing */ /* commonly used remote control parsing */
extern int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *, u8[], u32 *, int *); extern int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *, u8[], u32 *, int *);
/* commonly used pll init and set functions */
extern int dvb_usb_tuner_init_i2c(struct dvb_frontend *);
extern int dvb_usb_tuner_calc_regs(struct dvb_frontend *, struct dvb_frontend_parameters *, u8 *buf, int buf_len);
extern int dvb_usb_tuner_set_params_i2c(struct dvb_frontend *, struct dvb_frontend_parameters *);
/* commonly used firmware download types and function */ /* commonly used firmware download types and function */
struct hexline { struct hexline {
u8 len; u8 len;
......
...@@ -157,6 +157,7 @@ static int gl861_probe(struct usb_interface *intf, ...@@ -157,6 +157,7 @@ static int gl861_probe(struct usb_interface *intf,
static struct usb_device_id gl861_table [] = { static struct usb_device_id gl861_table [] = {
{ USB_DEVICE(USB_VID_MSI, USB_PID_MSI_MEGASKY580_55801) }, { USB_DEVICE(USB_VID_MSI, USB_PID_MSI_MEGASKY580_55801) },
{ USB_DEVICE(USB_VID_ALINK, USB_VID_ALINK_DTU) },
{ } /* Terminating entry */ { } /* Terminating entry */
}; };
MODULE_DEVICE_TABLE (usb, gl861_table); MODULE_DEVICE_TABLE (usb, gl861_table);
...@@ -187,12 +188,16 @@ static struct dvb_usb_device_properties gl861_properties = { ...@@ -187,12 +188,16 @@ static struct dvb_usb_device_properties gl861_properties = {
}}, }},
.i2c_algo = &gl861_i2c_algo, .i2c_algo = &gl861_i2c_algo,
.num_device_descs = 1, .num_device_descs = 2,
.devices = { .devices = {
{ "MSI Mega Sky 55801 DVB-T USB2.0", { "MSI Mega Sky 55801 DVB-T USB2.0",
{ &gl861_table[0], NULL }, { &gl861_table[0], NULL },
{ NULL }, { NULL },
}, },
{ "A-LINK DTU DVB-T USB2.0",
{ &gl861_table[1], NULL },
{ NULL },
},
} }
}; };
......
...@@ -22,6 +22,8 @@ static int dvb_usb_m920x_debug; ...@@ -22,6 +22,8 @@ static int dvb_usb_m920x_debug;
module_param_named(debug,dvb_usb_m920x_debug, int, 0644); module_param_named(debug,dvb_usb_m920x_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS); MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
static int m920x_set_filter(struct dvb_usb_device *d, int type, int idx, int pid);
static inline int m920x_read(struct usb_device *udev, u8 request, u16 value, static inline int m920x_read(struct usb_device *udev, u8 request, u16 value,
u16 index, void *data, int size) u16 index, void *data, int size)
{ {
...@@ -57,7 +59,8 @@ static inline int m920x_write(struct usb_device *udev, u8 request, ...@@ -57,7 +59,8 @@ static inline int m920x_write(struct usb_device *udev, u8 request,
static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq) static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
{ {
int ret = 0; int ret = 0, i, epi, flags = 0;
int adap_enabled[M9206_MAX_ADAPTERS] = { 0 };
/* Remote controller init. */ /* Remote controller init. */
if (d->props.rc_query) { if (d->props.rc_query) {
...@@ -76,9 +79,51 @@ static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq) ...@@ -76,9 +79,51 @@ static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
deb("Initialising remote control success\n"); deb("Initialising remote control success\n");
} }
for (i = 0; i < d->props.num_adapters; i++)
flags |= d->adapter[i].props.caps;
/* Some devices(Dposh) might crash if we attempt touch at all. */
if (flags & DVB_USB_ADAP_HAS_PID_FILTER) {
for (i = 0; i < d->props.num_adapters; i++) {
epi = d->adapter[i].props.stream.endpoint - 0x81;
if (epi < 0 || epi >= M9206_MAX_ADAPTERS) {
printk(KERN_INFO "m920x: Unexpected adapter endpoint!\n");
return -EINVAL;
}
adap_enabled[epi] = 1;
}
for (i = 0; i < M9206_MAX_ADAPTERS; i++) {
if (adap_enabled[i])
continue;
if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x0)) != 0)
return ret;
if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x02f5)) != 0)
return ret;
}
}
return ret; return ret;
} }
static int m920x_init_ep(struct usb_interface *intf)
{
struct usb_device *udev = interface_to_usbdev(intf);
struct usb_host_interface *alt;
if ((alt = usb_altnum_to_altsetting(intf, 1)) == NULL) {
deb("No alt found!\n");
return -ENODEV;
}
return usb_set_interface(udev, alt->desc.bInterfaceNumber,
alt->desc.bAlternateSetting);
}
static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state) static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
{ {
struct m920x_state *m = d->priv; struct m920x_state *m = d->priv;
...@@ -211,8 +256,7 @@ static struct i2c_algorithm m920x_i2c_algo = { ...@@ -211,8 +256,7 @@ static struct i2c_algorithm m920x_i2c_algo = {
}; };
/* pid filter */ /* pid filter */
static int m920x_set_filter(struct dvb_usb_adapter *adap, static int m920x_set_filter(struct dvb_usb_device *d, int type, int idx, int pid)
int type, int idx, int pid)
{ {
int ret = 0; int ret = 0;
...@@ -221,10 +265,10 @@ static int m920x_set_filter(struct dvb_usb_adapter *adap, ...@@ -221,10 +265,10 @@ static int m920x_set_filter(struct dvb_usb_adapter *adap,
pid |= 0x8000; pid |= 0x8000;
if ((ret = m920x_write(adap->dev->udev, M9206_FILTER, pid, (type << 8) | (idx * 4) )) != 0) if ((ret = m920x_write(d->udev, M9206_FILTER, pid, (type << 8) | (idx * 4) )) != 0)
return ret; return ret;
if ((ret = m920x_write(adap->dev->udev, M9206_FILTER, 0, (type << 8) | (idx * 4) )) != 0) if ((ret = m920x_write(d->udev, M9206_FILTER, 0, (type << 8) | (idx * 4) )) != 0)
return ret; return ret;
return ret; return ret;
...@@ -233,40 +277,35 @@ static int m920x_set_filter(struct dvb_usb_adapter *adap, ...@@ -233,40 +277,35 @@ static int m920x_set_filter(struct dvb_usb_adapter *adap,
static int m920x_update_filters(struct dvb_usb_adapter *adap) static int m920x_update_filters(struct dvb_usb_adapter *adap)
{ {
struct m920x_state *m = adap->dev->priv; struct m920x_state *m = adap->dev->priv;
int enabled = m->filtering_enabled; int enabled = m->filtering_enabled[adap->id];
int i, ret = 0, filter = 0; int i, ret = 0, filter = 0;
int ep = adap->props.stream.endpoint;
for (i = 0; i < M9206_MAX_FILTERS; i++) for (i = 0; i < M9206_MAX_FILTERS; i++)
if (m->filters[i] == 8192) if (m->filters[adap->id][i] == 8192)
enabled = 0; enabled = 0;
/* Disable all filters */ /* Disable all filters */
if ((ret = m920x_set_filter(adap, 0x81, 1, enabled)) != 0) if ((ret = m920x_set_filter(adap->dev, ep, 1, enabled)) != 0)
return ret; return ret;
for (i = 0; i < M9206_MAX_FILTERS; i++) for (i = 0; i < M9206_MAX_FILTERS; i++)
if ((ret = m920x_set_filter(adap, 0x81, i + 2, 0)) != 0) if ((ret = m920x_set_filter(adap->dev, ep, i + 2, 0)) != 0)
return ret; return ret;
if ((ret = m920x_set_filter(adap, 0x82, 0, 0x0)) != 0)
return ret;
/* Set */ /* Set */
if (enabled) { if (enabled) {
for (i = 0; i < M9206_MAX_FILTERS; i++) { for (i = 0; i < M9206_MAX_FILTERS; i++) {
if (m->filters[i] == 0) if (m->filters[adap->id][i] == 0)
continue; continue;
if ((ret = m920x_set_filter(adap, 0x81, filter + 2, m->filters[i])) != 0) if ((ret = m920x_set_filter(adap->dev, ep, filter + 2, m->filters[adap->id][i])) != 0)
return ret; return ret;
filter++; filter++;
} }
} }
if ((ret = m920x_set_filter(adap, 0x82, 0, 0x02f5)) != 0)
return ret;
return ret; return ret;
} }
...@@ -274,7 +313,7 @@ static int m920x_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) ...@@ -274,7 +313,7 @@ static int m920x_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff)
{ {
struct m920x_state *m = adap->dev->priv; struct m920x_state *m = adap->dev->priv;
m->filtering_enabled = onoff ? 1 : 0; m->filtering_enabled[adap->id] = onoff ? 1 : 0;
return m920x_update_filters(adap); return m920x_update_filters(adap);
} }
...@@ -283,7 +322,7 @@ static int m920x_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, in ...@@ -283,7 +322,7 @@ static int m920x_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, in
{ {
struct m920x_state *m = adap->dev->priv; struct m920x_state *m = adap->dev->priv;
m->filters[index] = onoff ? pid : 0; m->filters[adap->id][index] = onoff ? pid : 0;
return m920x_update_filters(adap); return m920x_update_filters(adap);
} }
...@@ -368,6 +407,7 @@ static int m920x_identify_state(struct usb_device *udev, ...@@ -368,6 +407,7 @@ static int m920x_identify_state(struct usb_device *udev,
/* demod configurations */ /* demod configurations */
static int m920x_mt352_demod_init(struct dvb_frontend *fe) static int m920x_mt352_demod_init(struct dvb_frontend *fe)
{ {
int ret;
u8 config[] = { CONFIG, 0x3d }; u8 config[] = { CONFIG, 0x3d };
u8 clock[] = { CLOCK_CTL, 0x30 }; u8 clock[] = { CLOCK_CTL, 0x30 };
u8 reset[] = { RESET, 0x80 }; u8 reset[] = { RESET, 0x80 };
...@@ -377,17 +417,25 @@ static int m920x_mt352_demod_init(struct dvb_frontend *fe) ...@@ -377,17 +417,25 @@ static int m920x_mt352_demod_init(struct dvb_frontend *fe)
u8 unk1[] = { 0x93, 0x1a }; u8 unk1[] = { 0x93, 0x1a };
u8 unk2[] = { 0xb5, 0x7a }; u8 unk2[] = { 0xb5, 0x7a };
mt352_write(fe, config, ARRAY_SIZE(config));
mt352_write(fe, clock, ARRAY_SIZE(clock));
mt352_write(fe, reset, ARRAY_SIZE(reset));
mt352_write(fe, adc_ctl, ARRAY_SIZE(adc_ctl));
mt352_write(fe, agc, ARRAY_SIZE(agc));
mt352_write(fe, sec_agc, ARRAY_SIZE(sec_agc));
mt352_write(fe, unk1, ARRAY_SIZE(unk1));
mt352_write(fe, unk2, ARRAY_SIZE(unk2));
deb("Demod init!\n"); deb("Demod init!\n");
if ((ret = mt352_write(fe, config, ARRAY_SIZE(config))) != 0)
return ret;
if ((ret = mt352_write(fe, clock, ARRAY_SIZE(clock))) != 0)
return ret;
if ((ret = mt352_write(fe, reset, ARRAY_SIZE(reset))) != 0)
return ret;
if ((ret = mt352_write(fe, adc_ctl, ARRAY_SIZE(adc_ctl))) != 0)
return ret;
if ((ret = mt352_write(fe, agc, ARRAY_SIZE(agc))) != 0)
return ret;
if ((ret = mt352_write(fe, sec_agc, ARRAY_SIZE(sec_agc))) != 0)
return ret;
if ((ret = mt352_write(fe, unk1, ARRAY_SIZE(unk1))) != 0)
return ret;
if ((ret = mt352_write(fe, unk2, ARRAY_SIZE(unk2))) != 0)
return ret;
return 0; return 0;
} }
...@@ -558,8 +606,7 @@ static struct dvb_usb_device_properties dposh_properties; ...@@ -558,8 +606,7 @@ static struct dvb_usb_device_properties dposh_properties;
static int m920x_probe(struct usb_interface *intf, static int m920x_probe(struct usb_interface *intf,
const struct usb_device_id *id) const struct usb_device_id *id)
{ {
struct dvb_usb_device *d; struct dvb_usb_device *d = NULL;
struct usb_host_interface *alt;
int ret; int ret;
struct m920x_inits *rc_init_seq = NULL; struct m920x_inits *rc_init_seq = NULL;
int bInterfaceNumber = intf->cur_altsetting->desc.bInterfaceNumber; int bInterfaceNumber = intf->cur_altsetting->desc.bInterfaceNumber;
...@@ -604,23 +651,13 @@ static int m920x_probe(struct usb_interface *intf, ...@@ -604,23 +651,13 @@ static int m920x_probe(struct usb_interface *intf,
* tvwalkertwin_properties already configured both * tvwalkertwin_properties already configured both
* tuners, so there is nothing for us to do here * tuners, so there is nothing for us to do here
*/ */
return -ENODEV;
} }
found: found:
alt = usb_altnum_to_altsetting(intf, 1); if ((ret = m920x_init_ep(intf)) < 0)
if (alt == NULL) {
deb("No alt found!\n");
return -ENODEV;
}
ret = usb_set_interface(d->udev, alt->desc.bInterfaceNumber,
alt->desc.bAlternateSetting);
if (ret < 0)
return ret; return ret;
if ((ret = m920x_init(d, rc_init_seq)) != 0) if (d && (ret = m920x_init(d, rc_init_seq)) != 0)
return ret; return ret;
return ret; return ret;
...@@ -737,9 +774,9 @@ static struct dvb_usb_device_properties digivox_mini_ii_properties = { ...@@ -737,9 +774,9 @@ static struct dvb_usb_device_properties digivox_mini_ii_properties = {
* *
* LifeView TV Walker Twin has 1 x M9206, 2 x TDA10046, 2 x TDA8275A * LifeView TV Walker Twin has 1 x M9206, 2 x TDA10046, 2 x TDA8275A
* TDA10046 #0 is located at i2c address 0x08 * TDA10046 #0 is located at i2c address 0x08
* TDA10046 #1 is located at i2c address 0x0b (presently disabled - not yet working) * TDA10046 #1 is located at i2c address 0x0b
* TDA8275A #0 is located at i2c address 0x60 * TDA8275A #0 is located at i2c address 0x60
* TDA8275A #1 is located at i2c address 0x61 (presently disabled - not yet working) * TDA8275A #1 is located at i2c address 0x61
*/ */
static struct dvb_usb_device_properties tvwalkertwin_properties = { static struct dvb_usb_device_properties tvwalkertwin_properties = {
.caps = DVB_USB_IS_AN_I2C_ADAPTER, .caps = DVB_USB_IS_AN_I2C_ADAPTER,
...@@ -756,7 +793,7 @@ static struct dvb_usb_device_properties tvwalkertwin_properties = { ...@@ -756,7 +793,7 @@ static struct dvb_usb_device_properties tvwalkertwin_properties = {
.size_of_priv = sizeof(struct m920x_state), .size_of_priv = sizeof(struct m920x_state),
.identify_state = m920x_identify_state, .identify_state = m920x_identify_state,
.num_adapters = 1, .num_adapters = 2,
.adapter = {{ .adapter = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | .caps = DVB_USB_ADAP_HAS_PID_FILTER |
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#define M9206_FW 0x30 #define M9206_FW 0x30
#define M9206_MAX_FILTERS 8 #define M9206_MAX_FILTERS 8
#define M9206_MAX_ADAPTERS 2
/* /*
sequences found in logs: sequences found in logs:
...@@ -60,8 +61,8 @@ response to a write, is unknown. ...@@ -60,8 +61,8 @@ response to a write, is unknown.
*/ */
struct m920x_state { struct m920x_state {
u16 filters[M9206_MAX_FILTERS]; u16 filters[M9206_MAX_ADAPTERS][M9206_MAX_FILTERS];
int filtering_enabled; int filtering_enabled[M9206_MAX_ADAPTERS];
int rep_count; int rep_count;
}; };
......
...@@ -263,7 +263,7 @@ static int opera1_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -263,7 +263,7 @@ static int opera1_tuner_attach(struct dvb_usb_adapter *adap)
{ {
dvb_attach( dvb_attach(
dvb_pll_attach, adap->fe, 0xc0>>1, dvb_pll_attach, adap->fe, 0xc0>>1,
&adap->dev->i2c_adap, &dvb_pll_opera1 &adap->dev->i2c_adap, DVB_PLL_OPERA1
); );
return 0; return 0;
} }
...@@ -435,9 +435,9 @@ static int opera1_xilinx_load_firmware(struct usb_device *dev, ...@@ -435,9 +435,9 @@ static int opera1_xilinx_load_firmware(struct usb_device *dev,
{ {
const struct firmware *fw = NULL; const struct firmware *fw = NULL;
u8 *b, *p; u8 *b, *p;
int ret = 0, i; int ret = 0, i,fpgasize=40;
u8 testval; u8 testval;
info("start downloading fpga firmware"); info("start downloading fpga firmware %s",filename);
if ((ret = request_firmware(&fw, filename, &dev->dev)) != 0) { if ((ret = request_firmware(&fw, filename, &dev->dev)) != 0) {
err("did not find the firmware file. (%s) " err("did not find the firmware file. (%s) "
...@@ -454,17 +454,20 @@ static int opera1_xilinx_load_firmware(struct usb_device *dev, ...@@ -454,17 +454,20 @@ static int opera1_xilinx_load_firmware(struct usb_device *dev,
/* clear fpga ? */ /* clear fpga ? */
opera1_xilinx_rw(dev, 0xbc, 0xaa, &fpga_command, 1, opera1_xilinx_rw(dev, 0xbc, 0xaa, &fpga_command, 1,
OPERA_WRITE_MSG); OPERA_WRITE_MSG);
for (i = 0; p[i] != 0 && i < fw->size;) { for (i = 0; i < fw->size;) {
if ( (fw->size - i) <fpgasize){
fpgasize=fw->size-i;
}
b = (u8 *) p + i; b = (u8 *) p + i;
if (opera1_xilinx_rw if (opera1_xilinx_rw
(dev, OPERA_WRITE_FX2, 0x0, b + 1, b[0], (dev, OPERA_WRITE_FX2, 0x0, b , fpgasize,
OPERA_WRITE_MSG) != b[0] OPERA_WRITE_MSG) != fpgasize
) { ) {
err("error while transferring firmware"); err("error while transferring firmware");
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
i = i + 1 + b[0]; i = i + fpgasize;
} }
/* restart the CPU */ /* restart the CPU */
if (ret || opera1_xilinx_rw if (ret || opera1_xilinx_rw
...@@ -534,18 +537,16 @@ static struct dvb_usb_device_properties opera1_properties = { ...@@ -534,18 +537,16 @@ static struct dvb_usb_device_properties opera1_properties = {
static int opera1_probe(struct usb_interface *intf, static int opera1_probe(struct usb_interface *intf,
const struct usb_device_id *id) const struct usb_device_id *id)
{ {
struct dvb_usb_device *d;
struct usb_device *udev = interface_to_usbdev(intf); struct usb_device *udev = interface_to_usbdev(intf);
if (udev->descriptor.idProduct == USB_PID_OPERA1_WARM && if (udev->descriptor.idProduct == USB_PID_OPERA1_WARM &&
udev->descriptor.idVendor == USB_VID_OPERA1 && udev->descriptor.idVendor == USB_VID_OPERA1 &&
(d == NULL opera1_xilinx_load_firmware(udev, "dvb-usb-opera1-fpga-01.fw") != 0
|| opera1_xilinx_load_firmware(udev, "dvb-usb-opera1-fpga.fw") != 0) ) {
) {
return -EINVAL; return -EINVAL;
} }
if (dvb_usb_device_init(intf, &opera1_properties, THIS_MODULE, &d) != 0) if (dvb_usb_device_init(intf, &opera1_properties, THIS_MODULE, NULL) != 0)
return -EINVAL; return -EINVAL;
return 0; return 0;
} }
......
...@@ -65,9 +65,7 @@ static int umt_mt352_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -65,9 +65,7 @@ static int umt_mt352_frontend_attach(struct dvb_usb_adapter *adap)
static int umt_tuner_attach (struct dvb_usb_adapter *adap) static int umt_tuner_attach (struct dvb_usb_adapter *adap)
{ {
adap->pll_addr = 0x61; dvb_attach(dvb_pll_attach, adap->fe, 0x61, NULL, DVB_PLL_TUA6034);
adap->pll_desc = &dvb_pll_tua6034;
adap->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs;
return 0; return 0;
} }
...@@ -84,8 +82,8 @@ static int umt_probe(struct usb_interface *intf, ...@@ -84,8 +82,8 @@ static int umt_probe(struct usb_interface *intf,
/* do not change the order of the ID table */ /* do not change the order of the ID table */
static struct usb_device_id umt_table [] = { static struct usb_device_id umt_table [] = {
/* 00 */ { USB_DEVICE(USB_VID_HANFTEK, USB_PID_HANFTEK_UMT_010_COLD) }, /* 00 */ { USB_DEVICE(USB_VID_HANFTEK, USB_PID_HANFTEK_UMT_010_COLD) },
/* 01 */ { USB_DEVICE(USB_VID_HANFTEK, USB_PID_HANFTEK_UMT_010_WARM) }, /* 01 */ { USB_DEVICE(USB_VID_HANFTEK, USB_PID_HANFTEK_UMT_010_WARM) },
{ } /* Terminating entry */ { } /* Terminating entry */
}; };
MODULE_DEVICE_TABLE (usb, umt_table); MODULE_DEVICE_TABLE (usb, umt_table);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the kernel DVB frontend device drivers. # Makefile for the kernel DVB frontend device drivers.
# #
EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/
obj-$(CONFIG_DVB_PLL) += dvb-pll.o obj-$(CONFIG_DVB_PLL) += dvb-pll.o
obj-$(CONFIG_DVB_STV0299) += stv0299.o obj-$(CONFIG_DVB_STV0299) += stv0299.o
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/delay.h> #include <linux/delay.h>
#include "dvb_frontend.h" #include "dvb_frontend.h"
#include "dvb-pll.h"
#include "cx22702.h" #include "cx22702.h"
......
...@@ -917,7 +917,7 @@ static int cx24123_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) ...@@ -917,7 +917,7 @@ static int cx24123_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone)
static int cx24123_tune(struct dvb_frontend* fe, static int cx24123_tune(struct dvb_frontend* fe,
struct dvb_frontend_parameters* params, struct dvb_frontend_parameters* params,
unsigned int mode_flags, unsigned int mode_flags,
int *delay, unsigned int *delay,
fe_status_t *status) fe_status_t *status)
{ {
int retval = 0; int retval = 0;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -38,9 +38,6 @@ struct nxt200x_config ...@@ -38,9 +38,6 @@ struct nxt200x_config
/* the demodulator's i2c address */ /* the demodulator's i2c address */
u8 demod_address; u8 demod_address;
/* used to set pll input */
int (*set_pll_input)(u8* buf, int input);
/* need to set device param for start_dma */ /* need to set device param for start_dma */
int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured); int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
}; };
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include "dvb_math.h" #include "dvb_math.h"
#include "dvb_frontend.h" #include "dvb_frontend.h"
#include "dvb-pll.h"
#include "or51132.h" #include "or51132.h"
static int debug; static int debug;
......
This diff is collapsed.
...@@ -249,7 +249,7 @@ static int stv0299_get_symbolrate (struct stv0299_state* state) ...@@ -249,7 +249,7 @@ static int stv0299_get_symbolrate (struct stv0299_state* state)
dprintk ("%s\n", __FUNCTION__); dprintk ("%s\n", __FUNCTION__);
stv0299_readregs (state, 0x1f, sfr, 3); stv0299_readregs (state, 0x1f, sfr, 3);
stv0299_readregs (state, 0x1a, &rtf, 1); stv0299_readregs (state, 0x1a, (u8 *)&rtf, 1);
srate = (sfr[0] << 8) | sfr[1]; srate = (sfr[0] << 8) | sfr[1];
srate *= Mclk; srate *= Mclk;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment