aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/video4linux/CARDLIST.cx882
-rw-r--r--Documentation/video4linux/CARDLIST.saa71346
-rw-r--r--MAINTAINERS11
-rw-r--r--drivers/media/dvb/b2c2/Kconfig2
-rw-r--r--drivers/media/dvb/b2c2/flexcop-common.h2
-rw-r--r--drivers/media/dvb/b2c2/flexcop-dma.c35
-rw-r--r--drivers/media/dvb/b2c2/flexcop-fe-tuner.c9
-rw-r--r--drivers/media/dvb/b2c2/flexcop-misc.c6
-rw-r--r--drivers/media/dvb/b2c2/flexcop-pci.c6
-rw-r--r--drivers/media/dvb/b2c2/flexcop-reg.h4
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c8
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-firmware.c8
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb.h1
-rw-r--r--drivers/media/dvb/dvb-usb/vp702x.c6
-rw-r--r--drivers/media/dvb/dvb-usb/vp702x.h2
-rw-r--r--drivers/media/dvb/frontends/Kconfig12
-rw-r--r--drivers/media/dvb/frontends/Makefile1
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.c8
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.h2
-rw-r--r--drivers/media/dvb/frontends/nxt2002.c706
-rw-r--r--drivers/media/dvb/frontends/nxt2002.h23
-rw-r--r--drivers/media/dvb/frontends/nxt200x.c58
-rw-r--r--drivers/media/dvb/ttpci/av7110.h2
-rw-r--r--drivers/media/dvb/ttpci/av7110_ir.c26
-rw-r--r--drivers/media/video/cx88/Kconfig12
-rw-r--r--drivers/media/video/cx88/Makefile5
-rw-r--r--drivers/media/video/cx88/cx88-cards.c6
-rw-r--r--drivers/media/video/em28xx/em28xx-core.c2
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c3
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c47
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c2
-rw-r--r--drivers/media/video/saa7134/saa7134.h2
-rw-r--r--drivers/media/video/stradis.c15
-rw-r--r--drivers/media/video/tda9887.c2
-rw-r--r--drivers/media/video/tuner-core.c3
-rw-r--r--drivers/media/video/tvaudio.c9
-rw-r--r--drivers/media/video/tvp5150.c21
37 files changed, 184 insertions, 891 deletions
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88
index 56e194f1a0b..8bea3fbd054 100644
--- a/Documentation/video4linux/CARDLIST.cx88
+++ b/Documentation/video4linux/CARDLIST.cx88
@@ -42,4 +42,4 @@
42 41 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile) [0070:9800,0070:9802] 42 41 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile) [0070:9800,0070:9802]
43 42 -> digitalnow DNTV Live! DVB-T Pro [1822:0025] 43 42 -> digitalnow DNTV Live! DVB-T Pro [1822:0025]
44 43 -> KWorld/VStream XPert DVB-T with cx22702 [17de:08a1] 44 43 -> KWorld/VStream XPert DVB-T with cx22702 [17de:08a1]
45 44 -> DViCO FusionHDTV DVB-T Dual Digital [18ac:db50] 45 44 -> DViCO FusionHDTV DVB-T Dual Digital [18ac:db50,18ac:db54]
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
index cb3a59bbeb1..8a352597830 100644
--- a/Documentation/video4linux/CARDLIST.saa7134
+++ b/Documentation/video4linux/CARDLIST.saa7134
@@ -1,7 +1,7 @@
1 0 -> UNKNOWN/GENERIC 1 0 -> UNKNOWN/GENERIC
2 1 -> Proteus Pro [philips reference design] [1131:2001,1131:2001] 2 1 -> Proteus Pro [philips reference design] [1131:2001,1131:2001]
3 2 -> LifeView FlyVIDEO3000 [5168:0138,4e42:0138] 3 2 -> LifeView FlyVIDEO3000 [5168:0138,4e42:0138]
4 3 -> LifeView FlyVIDEO2000 [5168:0138] 4 3 -> LifeView/Typhoon FlyVIDEO2000 [5168:0138,4e42:0138]
5 4 -> EMPRESS [1131:6752] 5 4 -> EMPRESS [1131:6752]
6 5 -> SKNet Monster TV [1131:4e85] 6 5 -> SKNet Monster TV [1131:4e85]
7 6 -> Tevion MD 9717 7 6 -> Tevion MD 9717
@@ -53,12 +53,12 @@
53 52 -> AverMedia AverTV/305 [1461:2108] 53 52 -> AverMedia AverTV/305 [1461:2108]
54 53 -> ASUS TV-FM 7135 [1043:4845] 54 53 -> ASUS TV-FM 7135 [1043:4845]
55 54 -> LifeView FlyTV Platinum FM [5168:0214,1489:0214] 55 54 -> LifeView FlyTV Platinum FM [5168:0214,1489:0214]
56 55 -> LifeView FlyDVB-T DUO [5168:0502,5168:0306] 56 55 -> LifeView FlyDVB-T DUO [5168:0306]
57 56 -> Avermedia AVerTV 307 [1461:a70a] 57 56 -> Avermedia AVerTV 307 [1461:a70a]
58 57 -> Avermedia AVerTV GO 007 FM [1461:f31f] 58 57 -> Avermedia AVerTV GO 007 FM [1461:f31f]
59 58 -> ADS Tech Instant TV (saa7135) [1421:0350,1421:0351,1421:0370,1421:1370] 59 58 -> ADS Tech Instant TV (saa7135) [1421:0350,1421:0351,1421:0370,1421:1370]
60 59 -> Kworld/Tevion V-Stream Xpert TV PVR7134 60 59 -> Kworld/Tevion V-Stream Xpert TV PVR7134
61 60 -> Typhoon DVB-T Duo Digital/Analog Cardbus [4e42:0502] 61 60 -> LifeView/Typhoon FlyDVB-T Duo Cardbus [5168:0502,4e42:0502]
62 61 -> Philips TOUGH DVB-T reference design [1131:2004] 62 61 -> Philips TOUGH DVB-T reference design [1131:2004]
63 62 -> Compro VideoMate TV Gold+II 63 62 -> Compro VideoMate TV Gold+II
64 63 -> Kworld Xpert TV PVR7134 64 63 -> Kworld Xpert TV PVR7134
diff --git a/MAINTAINERS b/MAINTAINERS
index 11d44daa602..a05aefdea60 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -540,7 +540,8 @@ S: Supported
540 540
541BTTV VIDEO4LINUX DRIVER 541BTTV VIDEO4LINUX DRIVER
542P: Mauro Carvalho Chehab 542P: Mauro Carvalho Chehab
543M: mchehab@brturbo.com.br 543M: mchehab@infradead.org
544M: v4l-dvb-maintainer@linuxtv.org
544L: video4linux-list@redhat.com 545L: video4linux-list@redhat.com
545W: http://linuxtv.org 546W: http://linuxtv.org
546T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git 547T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
@@ -837,11 +838,12 @@ S: Maintained
837 838
838DVB SUBSYSTEM AND DRIVERS 839DVB SUBSYSTEM AND DRIVERS
839P: LinuxTV.org Project 840P: LinuxTV.org Project
840M: linux-dvb-maintainer@linuxtv.org 841M: mchehab@infradead.org
842M: v4l-dvb-maintainer@linuxtv.org
841L: linux-dvb@linuxtv.org (subscription required) 843L: linux-dvb@linuxtv.org (subscription required)
842W: http://linuxtv.org/ 844W: http://linuxtv.org/
843T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git 845T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
844S: Supported 846S: Maintained
845 847
846EATA-DMA SCSI DRIVER 848EATA-DMA SCSI DRIVER
847P: Michael Neuffer 849P: Michael Neuffer
@@ -2956,7 +2958,8 @@ S: Maintained
2956 2958
2957VIDEO FOR LINUX 2959VIDEO FOR LINUX
2958P: Mauro Carvalho Chehab 2960P: Mauro Carvalho Chehab
2959M: mchehab@brturbo.com.br 2961M: mchehab@infradead.org
2962M: v4l-dvb-maintainer@linuxtv.org
2960L: video4linux-list@redhat.com 2963L: video4linux-list@redhat.com
2961W: http://linuxtv.org 2964W: http://linuxtv.org
2962T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git 2965T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
diff --git a/drivers/media/dvb/b2c2/Kconfig b/drivers/media/dvb/b2c2/Kconfig
index 2583a865a58..2963605c0ec 100644
--- a/drivers/media/dvb/b2c2/Kconfig
+++ b/drivers/media/dvb/b2c2/Kconfig
@@ -4,7 +4,7 @@ config DVB_B2C2_FLEXCOP
4 select DVB_STV0299 4 select DVB_STV0299
5 select DVB_MT352 5 select DVB_MT352
6 select DVB_MT312 6 select DVB_MT312
7 select DVB_NXT2002 7 select DVB_NXT200X
8 select DVB_STV0297 8 select DVB_STV0297
9 select DVB_BCM3510 9 select DVB_BCM3510
10 select DVB_LGDT330X 10 select DVB_LGDT330X
diff --git a/drivers/media/dvb/b2c2/flexcop-common.h b/drivers/media/dvb/b2c2/flexcop-common.h
index 344a3c89846..7d7e1613c5a 100644
--- a/drivers/media/dvb/b2c2/flexcop-common.h
+++ b/drivers/media/dvb/b2c2/flexcop-common.h
@@ -116,11 +116,9 @@ void flexcop_dma_free(struct flexcop_dma *dma);
116 116
117int flexcop_dma_control_timer_irq(struct flexcop_device *fc, flexcop_dma_index_t no, int onoff); 117int flexcop_dma_control_timer_irq(struct flexcop_device *fc, flexcop_dma_index_t no, int onoff);
118int flexcop_dma_control_size_irq(struct flexcop_device *fc, flexcop_dma_index_t no, int onoff); 118int flexcop_dma_control_size_irq(struct flexcop_device *fc, flexcop_dma_index_t no, int onoff);
119int flexcop_dma_control_packet_irq(struct flexcop_device *fc, flexcop_dma_index_t no, int onoff);
120int flexcop_dma_config(struct flexcop_device *fc, struct flexcop_dma *dma, flexcop_dma_index_t dma_idx); 119int flexcop_dma_config(struct flexcop_device *fc, struct flexcop_dma *dma, flexcop_dma_index_t dma_idx);
121int flexcop_dma_xfer_control(struct flexcop_device *fc, flexcop_dma_index_t dma_idx, flexcop_dma_addr_index_t index, int onoff); 120int flexcop_dma_xfer_control(struct flexcop_device *fc, flexcop_dma_index_t dma_idx, flexcop_dma_addr_index_t index, int onoff);
122int flexcop_dma_config_timer(struct flexcop_device *fc, flexcop_dma_index_t dma_idx, u8 cycles); 121int flexcop_dma_config_timer(struct flexcop_device *fc, flexcop_dma_index_t dma_idx, u8 cycles);
123int flexcop_dma_config_packet_count(struct flexcop_device *fc, flexcop_dma_index_t dma_idx, u8 packets);
124 122
125/* from flexcop-eeprom.c */ 123/* from flexcop-eeprom.c */
126/* the PCI part uses this call to get the MAC address, the USB part has its own */ 124/* the PCI part uses this call to get the MAC address, the USB part has its own */
diff --git a/drivers/media/dvb/b2c2/flexcop-dma.c b/drivers/media/dvb/b2c2/flexcop-dma.c
index cf4ed1df608..6f592bc32d2 100644
--- a/drivers/media/dvb/b2c2/flexcop-dma.c
+++ b/drivers/media/dvb/b2c2/flexcop-dma.c
@@ -169,38 +169,3 @@ int flexcop_dma_config_timer(struct flexcop_device *fc,
169} 169}
170EXPORT_SYMBOL(flexcop_dma_config_timer); 170EXPORT_SYMBOL(flexcop_dma_config_timer);
171 171
172/* packet IRQ does not exist in FCII or FCIIb - according to data book and tests */
173int flexcop_dma_control_packet_irq(struct flexcop_device *fc,
174 flexcop_dma_index_t no,
175 int onoff)
176{
177 flexcop_ibi_value v = fc->read_ibi_reg(fc,ctrl_208);
178
179 deb_rdump("reg: %03x: %x\n",ctrl_208,v.raw);
180 if (no & FC_DMA_1)
181 v.ctrl_208.DMA1_Size_IRQ_Enable_sig = onoff;
182
183 if (no & FC_DMA_2)
184 v.ctrl_208.DMA2_Size_IRQ_Enable_sig = onoff;
185
186 fc->write_ibi_reg(fc,ctrl_208,v);
187 deb_rdump("reg: %03x: %x\n",ctrl_208,v.raw);
188
189 return 0;
190}
191EXPORT_SYMBOL(flexcop_dma_control_packet_irq);
192
193int flexcop_dma_config_packet_count(struct flexcop_device *fc,
194 flexcop_dma_index_t dma_idx,
195 u8 packets)
196{
197 flexcop_ibi_register r = (dma_idx & FC_DMA_1) ? dma1_004 : dma2_014;
198 flexcop_ibi_value v = fc->read_ibi_reg(fc,r);
199
200 flexcop_dma_remap(fc,dma_idx,1);
201
202 v.dma_0x4_remap.DMA_maxpackets = packets;
203 fc->write_ibi_reg(fc,r,v);
204 return 0;
205}
206EXPORT_SYMBOL(flexcop_dma_config_packet_count);
diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
index 0b940e152b7..390cc3a99ce 100644
--- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
@@ -9,7 +9,7 @@
9 9
10#include "stv0299.h" 10#include "stv0299.h"
11#include "mt352.h" 11#include "mt352.h"
12#include "nxt2002.h" 12#include "nxt200x.h"
13#include "bcm3510.h" 13#include "bcm3510.h"
14#include "stv0297.h" 14#include "stv0297.h"
15#include "mt312.h" 15#include "mt312.h"
@@ -343,9 +343,10 @@ static struct lgdt330x_config air2pc_atsc_hd5000_config = {
343 .clock_polarity_flip = 1, 343 .clock_polarity_flip = 1,
344}; 344};
345 345
346static struct nxt2002_config samsung_tbmv_config = { 346static struct nxt200x_config samsung_tbmv_config = {
347 .demod_address = 0x0a, 347 .demod_address = 0x0a,
348 .request_firmware = flexcop_fe_request_firmware, 348 .pll_address = 0xc2,
349 .pll_desc = &dvb_pll_samsung_tbmv,
349}; 350};
350 351
351static struct bcm3510_config air2pc_atsc_first_gen_config = { 352static struct bcm3510_config air2pc_atsc_first_gen_config = {
@@ -505,7 +506,7 @@ int flexcop_frontend_init(struct flexcop_device *fc)
505 info("found the mt352 at i2c address: 0x%02x",samsung_tdtc9251dh0_config.demod_address); 506 info("found the mt352 at i2c address: 0x%02x",samsung_tdtc9251dh0_config.demod_address);
506 } else 507 } else
507 /* try the air atsc 2nd generation (nxt2002) */ 508 /* try the air atsc 2nd generation (nxt2002) */
508 if ((fc->fe = nxt2002_attach(&samsung_tbmv_config, &fc->i2c_adap)) != NULL) { 509 if ((fc->fe = nxt200x_attach(&samsung_tbmv_config, &fc->i2c_adap)) != NULL) {
509 fc->dev_type = FC_AIR_ATSC2; 510 fc->dev_type = FC_AIR_ATSC2;
510 info("found the nxt2002 at i2c address: 0x%02x",samsung_tbmv_config.demod_address); 511 info("found the nxt2002 at i2c address: 0x%02x",samsung_tbmv_config.demod_address);
511 } else 512 } else
diff --git a/drivers/media/dvb/b2c2/flexcop-misc.c b/drivers/media/dvb/b2c2/flexcop-misc.c
index 62282d8dbfa..167583bf062 100644
--- a/drivers/media/dvb/b2c2/flexcop-misc.c
+++ b/drivers/media/dvb/b2c2/flexcop-misc.c
@@ -36,14 +36,14 @@ void flexcop_determine_revision(struct flexcop_device *fc)
36 /* bus parts have to decide if hw pid filtering is used or not. */ 36 /* bus parts have to decide if hw pid filtering is used or not. */
37} 37}
38 38
39const char *flexcop_revision_names[] = { 39static const char *flexcop_revision_names[] = {
40 "Unkown chip", 40 "Unkown chip",
41 "FlexCopII", 41 "FlexCopII",
42 "FlexCopIIb", 42 "FlexCopIIb",
43 "FlexCopIII", 43 "FlexCopIII",
44}; 44};
45 45
46const char *flexcop_device_names[] = { 46static const char *flexcop_device_names[] = {
47 "Unkown device", 47 "Unkown device",
48 "Air2PC/AirStar 2 DVB-T", 48 "Air2PC/AirStar 2 DVB-T",
49 "Air2PC/AirStar 2 ATSC 1st generation", 49 "Air2PC/AirStar 2 ATSC 1st generation",
@@ -54,7 +54,7 @@ const char *flexcop_device_names[] = {
54 "Air2PC/AirStar 2 ATSC 3rd generation (HD5000)", 54 "Air2PC/AirStar 2 ATSC 3rd generation (HD5000)",
55}; 55};
56 56
57const char *flexcop_bus_names[] = { 57static const char *flexcop_bus_names[] = {
58 "USB", 58 "USB",
59 "PCI", 59 "PCI",
60}; 60};
diff --git a/drivers/media/dvb/b2c2/flexcop-pci.c b/drivers/media/dvb/b2c2/flexcop-pci.c
index 2f76eb3fea4..9bc40bdcc28 100644
--- a/drivers/media/dvb/b2c2/flexcop-pci.c
+++ b/drivers/media/dvb/b2c2/flexcop-pci.c
@@ -161,8 +161,10 @@ static irqreturn_t flexcop_pci_isr(int irq, void *dev_id, struct pt_regs *regs)
161 fc->read_ibi_reg(fc,dma1_008).dma_0x8.dma_cur_addr << 2; 161 fc->read_ibi_reg(fc,dma1_008).dma_0x8.dma_cur_addr << 2;
162 u32 cur_pos = cur_addr - fc_pci->dma[0].dma_addr0; 162 u32 cur_pos = cur_addr - fc_pci->dma[0].dma_addr0;
163 163
164 deb_irq("%u irq: %08x cur_addr: %08x: cur_pos: %08x, last_cur_pos: %08x ", 164 deb_irq("%u irq: %08x cur_addr: %llx: cur_pos: %08x, last_cur_pos: %08x ",
165 jiffies_to_usecs(jiffies - fc_pci->last_irq),v.raw,cur_addr,cur_pos,fc_pci->last_dma1_cur_pos); 165 jiffies_to_usecs(jiffies - fc_pci->last_irq),
166 v.raw, (unsigned long long)cur_addr, cur_pos,
167 fc_pci->last_dma1_cur_pos);
166 fc_pci->last_irq = jiffies; 168 fc_pci->last_irq = jiffies;
167 169
168 /* buffer end was reached, restarted from the beginning 170 /* buffer end was reached, restarted from the beginning
diff --git a/drivers/media/dvb/b2c2/flexcop-reg.h b/drivers/media/dvb/b2c2/flexcop-reg.h
index 3153f9513c6..491f9bd6e19 100644
--- a/drivers/media/dvb/b2c2/flexcop-reg.h
+++ b/drivers/media/dvb/b2c2/flexcop-reg.h
@@ -16,8 +16,6 @@ typedef enum {
16 FLEXCOP_III, 16 FLEXCOP_III,
17} flexcop_revision_t; 17} flexcop_revision_t;
18 18
19extern const char *flexcop_revision_names[];
20
21typedef enum { 19typedef enum {
22 FC_UNK = 0, 20 FC_UNK = 0,
23 FC_AIR_DVB, 21 FC_AIR_DVB,
@@ -34,8 +32,6 @@ typedef enum {
34 FC_PCI, 32 FC_PCI,
35} flexcop_bus_t; 33} flexcop_bus_t;
36 34
37extern const char *flexcop_device_names[];
38
39/* FlexCop IBI Registers */ 35/* FlexCop IBI Registers */
40#if defined(__LITTLE_ENDIAN) 36#if defined(__LITTLE_ENDIAN)
41 #include "flexcop_ibi_value_le.h" 37 #include "flexcop_ibi_value_le.h"
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index a7fb06f4cd3..f14003736af 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -184,7 +184,7 @@ static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
184 return 0; 184 return 0;
185} 185}
186 186
187struct dvb_usb_rc_key dvico_mce_rc_keys[] = { 187static struct dvb_usb_rc_key dvico_mce_rc_keys[] = {
188 { 0xfe, 0x02, KEY_TV }, 188 { 0xfe, 0x02, KEY_TV },
189 { 0xfe, 0x0e, KEY_MP3 }, 189 { 0xfe, 0x0e, KEY_MP3 },
190 { 0xfe, 0x1a, KEY_DVD }, 190 { 0xfe, 0x1a, KEY_DVD },
@@ -273,7 +273,7 @@ static int cxusb_mt352_demod_init(struct dvb_frontend* fe)
273 return 0; 273 return 0;
274} 274}
275 275
276struct cx22702_config cxusb_cx22702_config = { 276static struct cx22702_config cxusb_cx22702_config = {
277 .demod_address = 0x63, 277 .demod_address = 0x63,
278 278
279 .output_mode = CX22702_PARALLEL_OUTPUT, 279 .output_mode = CX22702_PARALLEL_OUTPUT,
@@ -282,13 +282,13 @@ struct cx22702_config cxusb_cx22702_config = {
282 .pll_set = dvb_usb_pll_set_i2c, 282 .pll_set = dvb_usb_pll_set_i2c,
283}; 283};
284 284
285struct lgdt330x_config cxusb_lgdt330x_config = { 285static struct lgdt330x_config cxusb_lgdt330x_config = {
286 .demod_address = 0x0e, 286 .demod_address = 0x0e,
287 .demod_chip = LGDT3303, 287 .demod_chip = LGDT3303,
288 .pll_set = dvb_usb_pll_set_i2c, 288 .pll_set = dvb_usb_pll_set_i2c,
289}; 289};
290 290
291struct mt352_config cxusb_dee1601_config = { 291static struct mt352_config cxusb_dee1601_config = {
292 .demod_address = 0x0f, 292 .demod_address = 0x0f,
293 .demod_init = cxusb_dee1601_demod_init, 293 .demod_init = cxusb_dee1601_demod_init,
294 .pll_set = dvb_usb_pll_set, 294 .pll_set = dvb_usb_pll_set,
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c b/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
index 8535895819f..9222b0a81f7 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
@@ -24,6 +24,9 @@ static struct usb_cypress_controller cypress[] = {
24 { .id = CYPRESS_FX2, .name = "Cypress FX2", .cpu_cs_register = 0xe600 }, 24 { .id = CYPRESS_FX2, .name = "Cypress FX2", .cpu_cs_register = 0xe600 },
25}; 25};
26 26
27static int dvb_usb_get_hexline(const struct firmware *fw, struct hexline *hx,
28 int *pos);
29
27/* 30/*
28 * load a firmware packet to the device 31 * load a firmware packet to the device
29 */ 32 */
@@ -112,7 +115,8 @@ int dvb_usb_download_firmware(struct usb_device *udev, struct dvb_usb_properties
112 return ret; 115 return ret;
113} 116}
114 117
115int dvb_usb_get_hexline(const struct firmware *fw, struct hexline *hx, int *pos) 118static int dvb_usb_get_hexline(const struct firmware *fw, struct hexline *hx,
119 int *pos)
116{ 120{
117 u8 *b = (u8 *) &fw->data[*pos]; 121 u8 *b = (u8 *) &fw->data[*pos];
118 int data_offs = 4; 122 int data_offs = 4;
@@ -142,5 +146,3 @@ int dvb_usb_get_hexline(const struct firmware *fw, struct hexline *hx, int *pos)
142 146
143 return *pos; 147 return *pos;
144} 148}
145EXPORT_SYMBOL(dvb_usb_get_hexline);
146
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h
index dd568396e59..5e5d21ad93c 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -341,7 +341,6 @@ struct hexline {
341 u8 data[255]; 341 u8 data[255];
342 u8 chk; 342 u8 chk;
343}; 343};
344extern int dvb_usb_get_hexline(const struct firmware *, struct hexline *, int *);
345extern int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type); 344extern int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type);
346 345
347#endif 346#endif
diff --git a/drivers/media/dvb/dvb-usb/vp702x.c b/drivers/media/dvb/dvb-usb/vp702x.c
index afa00fdb5ec..4a95eca81c5 100644
--- a/drivers/media/dvb/dvb-usb/vp702x.c
+++ b/drivers/media/dvb/dvb-usb/vp702x.c
@@ -53,7 +53,8 @@ int vp702x_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8
53 return ret; 53 return ret;
54} 54}
55 55
56int vp702x_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen) 56static int vp702x_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value,
57 u16 index, u8 *b, int blen)
57{ 58{
58 deb_xfer("out: req. %x, val: %x, ind: %x, buffer: ",req,value,index); 59 deb_xfer("out: req. %x, val: %x, ind: %x, buffer: ",req,value,index);
59 debug_dump(b,blen,deb_xfer); 60 debug_dump(b,blen,deb_xfer);
@@ -88,7 +89,8 @@ unlock:
88 return ret; 89 return ret;
89} 90}
90 91
91int vp702x_usb_inout_cmd(struct dvb_usb_device *d, u8 cmd, u8 *o, int olen, u8 *i, int ilen, int msec) 92static int vp702x_usb_inout_cmd(struct dvb_usb_device *d, u8 cmd, u8 *o,
93 int olen, u8 *i, int ilen, int msec)
92{ 94{
93 u8 bout[olen+2]; 95 u8 bout[olen+2];
94 u8 bin[ilen+1]; 96 u8 bin[ilen+1];
diff --git a/drivers/media/dvb/dvb-usb/vp702x.h b/drivers/media/dvb/dvb-usb/vp702x.h
index a808d48e7bf..c2f97f96c21 100644
--- a/drivers/media/dvb/dvb-usb/vp702x.h
+++ b/drivers/media/dvb/dvb-usb/vp702x.h
@@ -101,8 +101,6 @@ extern int dvb_usb_vp702x_debug;
101extern struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d); 101extern struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d);
102 102
103extern int vp702x_usb_inout_op(struct dvb_usb_device *d, u8 *o, int olen, u8 *i, int ilen, int msec); 103extern int vp702x_usb_inout_op(struct dvb_usb_device *d, u8 *o, int olen, u8 *i, int ilen, int msec);
104extern int vp702x_usb_inout_cmd(struct dvb_usb_device *d, u8 cmd, u8 *o, int olen, u8 *i, int ilen, int msec);
105extern int vp702x_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen); 104extern int vp702x_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen);
106extern int vp702x_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen);
107 105
108#endif 106#endif
diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig
index db3a8b40031..f09e3da669f 100644
--- a/drivers/media/dvb/frontends/Kconfig
+++ b/drivers/media/dvb/frontends/Kconfig
@@ -166,18 +166,6 @@ config DVB_STV0297
166comment "ATSC (North American/Korean Terresterial DTV) frontends" 166comment "ATSC (North American/Korean Terresterial DTV) frontends"
167 depends on DVB_CORE 167 depends on DVB_CORE
168 168
169config DVB_NXT2002
170 tristate "Nxt2002 based"
171 depends on DVB_CORE
172 select FW_LOADER
173 help
174 An ATSC 8VSB tuner module. Say Y when you want to support this frontend.
175
176 This driver needs external firmware. Please use the command
177 "<kerneldir>/Documentation/dvb/get_dvb_firmware nxt2002" to
178 download/extract it, and then copy it to /usr/lib/hotplug/firmware
179 or /lib/firmware (depending on configuration of firmware hotplug).
180
181config DVB_NXT200X 169config DVB_NXT200X
182 tristate "Nextwave NXT2002/NXT2004 based" 170 tristate "Nextwave NXT2002/NXT2004 based"
183 depends on DVB_CORE 171 depends on DVB_CORE
diff --git a/drivers/media/dvb/frontends/Makefile b/drivers/media/dvb/frontends/Makefile
index 615ec830e1c..8f301468568 100644
--- a/drivers/media/dvb/frontends/Makefile
+++ b/drivers/media/dvb/frontends/Makefile
@@ -25,7 +25,6 @@ obj-$(CONFIG_DVB_CX22702) += cx22702.o
25obj-$(CONFIG_DVB_TDA80XX) += tda80xx.o 25obj-$(CONFIG_DVB_TDA80XX) += tda80xx.o
26obj-$(CONFIG_DVB_TDA10021) += tda10021.o 26obj-$(CONFIG_DVB_TDA10021) += tda10021.o
27obj-$(CONFIG_DVB_STV0297) += stv0297.o 27obj-$(CONFIG_DVB_STV0297) += stv0297.o
28obj-$(CONFIG_DVB_NXT2002) += nxt2002.o
29obj-$(CONFIG_DVB_NXT200X) += nxt200x.o 28obj-$(CONFIG_DVB_NXT200X) += nxt200x.o
30obj-$(CONFIG_DVB_OR51211) += or51211.o 29obj-$(CONFIG_DVB_OR51211) += or51211.o
31obj-$(CONFIG_DVB_OR51132) += or51132.o 30obj-$(CONFIG_DVB_OR51132) += or51132.o
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index 1b9934ea5b0..4dcb6050d4f 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -326,11 +326,11 @@ struct dvb_pll_desc dvb_pll_tuv1236d = {
326}; 326};
327EXPORT_SYMBOL(dvb_pll_tuv1236d); 327EXPORT_SYMBOL(dvb_pll_tuv1236d);
328 328
329/* Samsung TBMV30111IN 329/* Samsung TBMV30111IN / TBMV30712IN1
330 * used in Air2PC ATSC - 2nd generation (nxt2002) 330 * used in Air2PC ATSC - 2nd generation (nxt2002)
331 */ 331 */
332struct dvb_pll_desc dvb_pll_tbmv30111in = { 332struct dvb_pll_desc dvb_pll_samsung_tbmv = {
333 .name = "Samsung TBMV30111IN", 333 .name = "Samsung TBMV30111IN / TBMV30712IN1",
334 .min = 54000000, 334 .min = 54000000,
335 .max = 860000000, 335 .max = 860000000,
336 .count = 6, 336 .count = 6,
@@ -343,7 +343,7 @@ struct dvb_pll_desc dvb_pll_tbmv30111in = {
343 { 999999999, 44000000, 166666, 0xfc, 0x02 }, 343 { 999999999, 44000000, 166666, 0xfc, 0x02 },
344 } 344 }
345}; 345};
346EXPORT_SYMBOL(dvb_pll_tbmv30111in); 346EXPORT_SYMBOL(dvb_pll_samsung_tbmv);
347 347
348/* 348/*
349 * Philips SD1878 Tuner. 349 * Philips SD1878 Tuner.
diff --git a/drivers/media/dvb/frontends/dvb-pll.h b/drivers/media/dvb/frontends/dvb-pll.h
index f682c09189b..bb8d4b4eb18 100644
--- a/drivers/media/dvb/frontends/dvb-pll.h
+++ b/drivers/media/dvb/frontends/dvb-pll.h
@@ -38,7 +38,7 @@ extern struct dvb_pll_desc dvb_pll_tded4;
38 38
39extern struct dvb_pll_desc dvb_pll_tuv1236d; 39extern struct dvb_pll_desc dvb_pll_tuv1236d;
40extern struct dvb_pll_desc dvb_pll_tdhu2; 40extern struct dvb_pll_desc dvb_pll_tdhu2;
41extern struct dvb_pll_desc dvb_pll_tbmv30111in; 41extern struct dvb_pll_desc dvb_pll_samsung_tbmv;
42extern struct dvb_pll_desc dvb_pll_philips_sd1878_tda8261; 42extern struct dvb_pll_desc dvb_pll_philips_sd1878_tda8261;
43 43
44int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf, 44int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf,
diff --git a/drivers/media/dvb/frontends/nxt2002.c b/drivers/media/dvb/frontends/nxt2002.c
deleted file mode 100644
index 4f263e65ba1..00000000000
--- a/drivers/media/dvb/frontends/nxt2002.c
+++ /dev/null
@@ -1,706 +0,0 @@
1/*
2 Support for B2C2/BBTI Technisat Air2PC - ATSC
3
4 Copyright (C) 2004 Taylor Jacob <rtjacob@earthlink.net>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20*/
21
22/*
23 * This driver needs external firmware. Please use the command
24 * "<kerneldir>/Documentation/dvb/get_dvb_firmware nxt2002" to
25 * download/extract it, and then copy it to /usr/lib/hotplug/firmware
26 * or /lib/firmware (depending on configuration of firmware hotplug).
27 */
28#define NXT2002_DEFAULT_FIRMWARE "dvb-fe-nxt2002.fw"
29#define CRC_CCIT_MASK 0x1021
30
31#include <linux/init.h>
32#include <linux/module.h>
33#include <linux/moduleparam.h>
34#include <linux/device.h>
35#include <linux/firmware.h>
36#include <linux/string.h>
37#include <linux/slab.h>
38
39#include "dvb_frontend.h"
40#include "nxt2002.h"
41
42struct nxt2002_state {
43
44 struct i2c_adapter* i2c;
45 struct dvb_frontend_ops ops;
46 const struct nxt2002_config* config;
47 struct dvb_frontend frontend;
48
49 /* demodulator private data */
50 u8 initialised:1;
51};
52
53static int debug;
54#define dprintk(args...) \
55 do { \
56 if (debug) printk(KERN_DEBUG "nxt2002: " args); \
57 } while (0)
58
59static int i2c_writebytes (struct nxt2002_state* state, u8 reg, u8 *buf, u8 len)
60{
61 /* probbably a much better way or doing this */
62 u8 buf2 [256],x;
63 int err;
64 struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf2, .len = len + 1 };
65
66 buf2[0] = reg;
67 for (x = 0 ; x < len ; x++)
68 buf2[x+1] = buf[x];
69
70 if ((err = i2c_transfer (state->i2c, &msg, 1)) != 1) {
71 printk ("%s: i2c write error (addr %02x, err == %i)\n",
72 __FUNCTION__, state->config->demod_address, err);
73 return -EREMOTEIO;
74 }
75
76 return 0;
77}
78
79static u8 i2c_readbytes (struct nxt2002_state* state, u8 reg, u8* buf, u8 len)
80{
81 u8 reg2 [] = { reg };
82
83 struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = reg2, .len = 1 },
84 { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = buf, .len = len } };
85
86 int err;
87
88 if ((err = i2c_transfer (state->i2c, msg, 2)) != 2) {
89 printk ("%s: i2c read error (addr %02x, err == %i)\n",
90 __FUNCTION__, state->config->demod_address, err);
91 return -EREMOTEIO;
92 }
93
94 return 0;
95}
96
97static u16 nxt2002_crc(u16 crc, u8 c)
98{
99
100 u8 i;
101 u16 input = (u16) c & 0xFF;
102
103 input<<=8;
104 for(i=0 ;i<8 ;i++) {
105 if((crc ^ input) & 0x8000)
106 crc=(crc<<1)^CRC_CCIT_MASK;
107 else
108 crc<<=1;
109 input<<=1;
110 }
111 return crc;
112}
113
114static int nxt2002_writereg_multibyte (struct nxt2002_state* state, u8 reg, u8* data, u8 len)
115{
116 u8 buf;
117 dprintk("%s\n", __FUNCTION__);
118
119 /* set multi register length */
120 i2c_writebytes(state,0x34,&len,1);
121
122 /* set mutli register register */
123 i2c_writebytes(state,0x35,&reg,1);
124
125 /* send the actual data */
126 i2c_writebytes(state,0x36,data,len);
127
128 /* toggle the multireg write bit*/
129 buf = 0x02;
130 i2c_writebytes(state,0x21,&buf,1);
131
132 i2c_readbytes(state,0x21,&buf,1);
133
134 if ((buf & 0x02) == 0)
135 return 0;
136
137 dprintk("Error writing multireg register %02X\n",reg);
138
139 return 0;
140}
141
142static int nxt2002_readreg_multibyte (struct nxt2002_state* state, u8 reg, u8* data, u8 len)
143{
144 u8 len2;
145 dprintk("%s\n", __FUNCTION__);
146
147 /* set multi register length */
148 len2 = len & 0x80;
149 i2c_writebytes(state,0x34,&len2,1);
150
151 /* set mutli register register */
152 i2c_writebytes(state,0x35,&reg,1);
153
154 /* send the actual data */
155 i2c_readbytes(state,reg,data,len);
156
157 return 0;
158}
159
160static void nxt2002_microcontroller_stop (struct nxt2002_state* state)
161{
162 u8 buf[2],counter = 0;
163 dprintk("%s\n", __FUNCTION__);
164
165 buf[0] = 0x80;
166 i2c_writebytes(state,0x22,buf,1);
167
168 while (counter < 20) {
169 i2c_readbytes(state,0x31,buf,1);
170 if (buf[0] & 0x40)
171 return;
172 msleep(10);
173 counter++;
174 }
175
176 dprintk("Timeout waiting for micro to stop.. This is ok after firmware upload\n");
177 return;
178}
179
180static void nxt2002_microcontroller_start (struct nxt2002_state* state)
181{
182 u8 buf;
183 dprintk("%s\n", __FUNCTION__);
184
185 buf = 0x00;
186 i2c_writebytes(state,0x22,&buf,1);
187}
188
189static int nxt2002_writetuner (struct nxt2002_state* state, u8* data)
190{
191 u8 buf,count = 0;
192
193 dprintk("Tuner Bytes: %02X %02X %02X %02X\n",data[0],data[1],data[2],data[3]);
194
195 dprintk("%s\n", __FUNCTION__);
196 /* stop the micro first */
197 nxt2002_microcontroller_stop(state);
198
199 /* set the i2c transfer speed to the tuner */
200 buf = 0x03;
201 i2c_writebytes(state,0x20,&buf,1);
202
203 /* setup to transfer 4 bytes via i2c */
204 buf = 0x04;
205 i2c_writebytes(state,0x34,&buf,1);
206
207 /* write actual tuner bytes */
208 i2c_writebytes(state,0x36,data,4);
209
210 /* set tuner i2c address */
211 buf = 0xC2;
212 i2c_writebytes(state,0x35,&buf,1);
213
214 /* write UC Opmode to begin transfer */
215 buf = 0x80;
216 i2c_writebytes(state,0x21,&buf,1);
217
218 while (count < 20) {
219 i2c_readbytes(state,0x21,&buf,1);
220 if ((buf & 0x80)== 0x00)
221 return 0;
222 msleep(100);
223 count++;
224 }
225
226 printk("nxt2002: timeout error writing tuner\n");
227 return 0;
228}
229
230static void nxt2002_agc_reset(struct nxt2002_state* state)
231{
232 u8 buf;
233 dprintk("%s\n", __FUNCTION__);
234
235 buf = 0x08;
236 i2c_writebytes(state,0x08,&buf,1);
237
238 buf = 0x00;
239 i2c_writebytes(state,0x08,&buf,1);
240
241 return;
242}
243
244static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware *fw)
245{
246
247 struct nxt2002_state* state = fe->demodulator_priv;
248 u8 buf[256],written = 0,chunkpos = 0;
249 u16 rambase,position,crc = 0;
250
251 dprintk("%s\n", __FUNCTION__);
252 dprintk("Firmware is %zu bytes\n",fw->size);
253
254 /* Get the RAM base for this nxt2002 */
255 i2c_readbytes(state,0x10,buf,1);
256
257 if (buf[0] & 0x10)
258 rambase = 0x1000;
259 else
260 rambase = 0x0000;
261
262 dprintk("rambase on this nxt2002 is %04X\n",rambase);
263
264 /* Hold the micro in reset while loading firmware */
265 buf[0] = 0x80;
266 i2c_writebytes(state,0x2B,buf,1);
267
268 for (position = 0; position < fw->size ; position++) {
269 if (written == 0) {
270 crc = 0;
271 chunkpos = 0x28;
272 buf[0] = ((rambase + position) >> 8);
273 buf[1] = (rambase + position) & 0xFF;
274 buf[2] = 0x81;
275 /* write starting address */
276 i2c_writebytes(state,0x29,buf,3);
277 }
278 written++;
279 chunkpos++;
280
281 if ((written % 4) == 0)
282 i2c_writebytes(state,chunkpos,&fw->data[position-3],4);
283
284 crc = nxt2002_crc(crc,fw->data[position]);
285
286 if ((written == 255) || (position+1 == fw->size)) {
287 /* write remaining bytes of firmware */
288 i2c_writebytes(state, chunkpos+4-(written %4),
289 &fw->data[position-(written %4) + 1],
290 written %4);
291 buf[0] = crc << 8;
292 buf[1] = crc & 0xFF;
293
294 /* write crc */
295 i2c_writebytes(state,0x2C,buf,2);
296
297 /* do a read to stop things */
298 i2c_readbytes(state,0x2A,buf,1);
299
300 /* set transfer mode to complete */
301 buf[0] = 0x80;
302 i2c_writebytes(state,0x2B,buf,1);
303
304 written = 0;
305 }
306 }
307
308 printk ("done.\n");
309 return 0;
310};
311
312static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe,
313 struct dvb_frontend_parameters *p)
314{
315 struct nxt2002_state* state = fe->demodulator_priv;
316 u32 freq = 0;
317 u16 tunerfreq = 0;
318 u8 buf[4];
319
320 freq = 44000 + ( p->frequency / 1000 );
321
322 dprintk("freq = %d p->frequency = %d\n",freq,p->frequency);
323
324 tunerfreq = freq * 24/4000;
325
326 buf[0] = (tunerfreq >> 8) & 0x7F;
327 buf[1] = (tunerfreq & 0xFF);
328
329 if (p->frequency <= 214000000) {
330 buf[2] = 0x84 + (0x06 << 3);
331 buf[3] = (p->frequency <= 172000000) ? 0x01 : 0x02;
332 } else if (p->frequency <= 721000000) {
333 buf[2] = 0x84 + (0x07 << 3);
334 buf[3] = (p->frequency <= 467000000) ? 0x02 : 0x08;
335 } else if (p->frequency <= 841000000) {
336 buf[2] = 0x84 + (0x0E << 3);
337 buf[3] = 0x08;
338 } else {
339 buf[2] = 0x84 + (0x0F << 3);
340 buf[3] = 0x02;
341 }
342
343 /* write frequency information */
344 nxt2002_writetuner(state,buf);
345
346 /* reset the agc now that tuning has been completed */
347 nxt2002_agc_reset(state);
348
349 /* set target power level */
350 switch (p->u.vsb.modulation) {
351 case QAM_64:
352 case QAM_256:
353 buf[0] = 0x74;
354 break;
355 case VSB_8:
356 buf[0] = 0x70;
357 break;
358 default:
359 return -EINVAL;
360 break;
361 }
362 i2c_writebytes(state,0x42,buf,1);
363
364 /* configure sdm */
365 buf[0] = 0x87;
366 i2c_writebytes(state,0x57,buf,1);
367
368 /* write sdm1 input */
369 buf[0] = 0x10;
370 buf[1] = 0x00;
371 nxt2002_writereg_multibyte(state,0x58,buf,2);
372
373 /* write sdmx input */
374 switch (p->u.vsb.modulation) {
375 case QAM_64:
376 buf[0] = 0x68;
377 break;
378 case QAM_256:
379 buf[0] = 0x64;
380 break;
381 case VSB_8:
382 buf[0] = 0x60;
383 break;
384 default:
385 return -EINVAL;
386 break;
387 }
388 buf[1] = 0x00;
389 nxt2002_writereg_multibyte(state,0x5C,buf,2);
390
391 /* write adc power lpf fc */
392 buf[0] = 0x05;
393 i2c_writebytes(state,0x43,buf,1);
394
395 /* write adc power lpf fc */
396 buf[0] = 0x05;
397 i2c_writebytes(state,0x43,buf,1);
398
399 /* write accumulator2 input */
400 buf[0] = 0x80;
401 buf[1] = 0x00;
402 nxt2002_writereg_multibyte(state,0x4B,buf,2);
403
404 /* write kg1 */
405 buf[0] = 0x00;
406 i2c_writebytes(state,0x4D,buf,1);
407
408 /* write sdm12 lpf fc */
409 buf[0] = 0x44;
410 i2c_writebytes(state,0x55,buf,1);
411
412 /* write agc control reg */
413 buf[0] = 0x04;
414 i2c_writebytes(state,0x41,buf,1);
415
416 /* write agc ucgp0 */
417 switch (p->u.vsb.modulation) {
418 case QAM_64:
419 buf[0] = 0x02;
420 break;
421 case QAM_256:
422 buf[0] = 0x03;
423 break;
424 case VSB_8:
425 buf[0] = 0x00;
426 break;
427 default:
428 return -EINVAL;
429 break;
430 }
431 i2c_writebytes(state,0x30,buf,1);
432
433 /* write agc control reg */
434 buf[0] = 0x00;
435 i2c_writebytes(state,0x41,buf,1);
436
437 /* write accumulator2 input */
438 buf[0] = 0x80;
439 buf[1] = 0x00;
440 nxt2002_writereg_multibyte(state,0x49,buf,2);
441 nxt2002_writereg_multibyte(state,0x4B,buf,2);
442
443 /* write agc control reg */
444 buf[0] = 0x04;
445 i2c_writebytes(state,0x41,buf,1);
446
447 nxt2002_microcontroller_start(state);
448
449 /* adjacent channel detection should be done here, but I don't
450 have any stations with this need so I cannot test it */
451
452 return 0;
453}
454
455static int nxt2002_read_status(struct dvb_frontend* fe, fe_status_t* status)
456{
457 struct nxt2002_state* state = fe->demodulator_priv;
458 u8 lock;
459 i2c_readbytes(state,0x31,&lock,1);
460
461 *status = 0;
462 if (lock & 0x20) {
463 *status |= FE_HAS_SIGNAL;
464 *status |= FE_HAS_CARRIER;
465 *status |= FE_HAS_VITERBI;
466 *status |= FE_HAS_SYNC;
467 *status |= FE_HAS_LOCK;
468 }
469 return 0;
470}
471
472static int nxt2002_read_ber(struct dvb_frontend* fe, u32* ber)
473{
474 struct nxt2002_state* state = fe->demodulator_priv;
475 u8 b[3];
476
477 nxt2002_readreg_multibyte(state,0xE6,b,3);
478
479 *ber = ((b[0] << 8) + b[1]) * 8;
480
481 return 0;
482}
483
484static int nxt2002_read_signal_strength(struct dvb_frontend* fe, u16* strength)
485{
486 struct nxt2002_state* state = fe->demodulator_priv;
487 u8 b[2];
488 u16 temp = 0;
489
490 /* setup to read cluster variance */
491 b[0] = 0x00;
492 i2c_writebytes(state,0xA1,b,1);
493
494 /* get multreg val */
495 nxt2002_readreg_multibyte(state,0xA6,b,2);
496
497 temp = (b[0] << 8) | b[1];
498 *strength = ((0x7FFF - temp) & 0x0FFF) * 16;
499
500 return 0;
501}
502
503static int nxt2002_read_snr(struct dvb_frontend* fe, u16* snr)
504{
505
506 struct nxt2002_state* state = fe->demodulator_priv;
507 u8 b[2];
508 u16 temp = 0, temp2;
509 u32 snrdb = 0;
510
511 /* setup to read cluster variance */
512 b[0] = 0x00;
513 i2c_writebytes(state,0xA1,b,1);
514
515 /* get multreg val from 0xA6 */
516 nxt2002_readreg_multibyte(state,0xA6,b,2);
517
518 temp = (b[0] << 8) | b[1];
519 temp2 = 0x7FFF - temp;
520
521 /* snr will be in db */
522 if (temp2 > 0x7F00)
523 snrdb = 1000*24 + ( 1000*(30-24) * ( temp2 - 0x7F00 ) / ( 0x7FFF - 0x7F00 ) );
524 else if (temp2 > 0x7EC0)
525 snrdb = 1000*18 + ( 1000*(24-18) * ( temp2 - 0x7EC0 ) / ( 0x7F00 - 0x7EC0 ) );
526 else if (temp2 > 0x7C00)
527 snrdb = 1000*12 + ( 1000*(18-12) * ( temp2 - 0x7C00 ) / ( 0x7EC0 - 0x7C00 ) );
528 else
529 snrdb = 1000*0 + ( 1000*(12-0) * ( temp2 - 0 ) / ( 0x7C00 - 0 ) );
530
531 /* the value reported back from the frontend will be FFFF=32db 0000=0db */
532
533 *snr = snrdb * (0xFFFF/32000);
534
535 return 0;
536}
537
538static int nxt2002_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
539{
540 struct nxt2002_state* state = fe->demodulator_priv;
541 u8 b[3];
542
543 nxt2002_readreg_multibyte(state,0xE6,b,3);
544 *ucblocks = b[2];
545
546 return 0;
547}
548
549static int nxt2002_sleep(struct dvb_frontend* fe)
550{
551 return 0;
552}
553
554static int nxt2002_init(struct dvb_frontend* fe)
555{
556 struct nxt2002_state* state = fe->demodulator_priv;
557 const struct firmware *fw;
558 int ret;
559 u8 buf[2];
560
561 if (!state->initialised) {
562 /* request the firmware, this will block until someone uploads it */
563 printk("nxt2002: Waiting for firmware upload (%s)...\n", NXT2002_DEFAULT_FIRMWARE);
564 ret = state->config->request_firmware(fe, &fw, NXT2002_DEFAULT_FIRMWARE);
565 printk("nxt2002: Waiting for firmware upload(2)...\n");
566 if (ret) {
567 printk("nxt2002: no firmware upload (timeout or file not found?)\n");
568 return ret;
569 }
570
571 ret = nxt2002_load_firmware(fe, fw);
572 if (ret) {
573 printk("nxt2002: writing firmware to device failed\n");
574 release_firmware(fw);
575 return ret;
576 }
577 printk("nxt2002: firmware upload complete\n");
578
579 /* Put the micro into reset */
580 nxt2002_microcontroller_stop(state);
581
582 /* ensure transfer is complete */
583 buf[0]=0;
584 i2c_writebytes(state,0x2B,buf,1);
585
586 /* Put the micro into reset for real this time */
587 nxt2002_microcontroller_stop(state);
588
589 /* soft reset everything (agc,frontend,eq,fec)*/
590 buf[0] = 0x0F;
591 i2c_writebytes(state,0x08,buf,1);
592 buf[0] = 0x00;
593 i2c_writebytes(state,0x08,buf,1);
594
595 /* write agc sdm configure */
596 buf[0] = 0xF1;
597 i2c_writebytes(state,0x57,buf,1);
598
599 /* write mod output format */
600 buf[0] = 0x20;
601 i2c_writebytes(state,0x09,buf,1);
602
603 /* write fec mpeg mode */
604 buf[0] = 0x7E;
605 buf[1] = 0x00;
606 i2c_writebytes(state,0xE9,buf,2);
607
608 /* write mux selection */
609 buf[0] = 0x00;
610 i2c_writebytes(state,0xCC,buf,1);
611
612 state->initialised = 1;
613 }
614
615 return 0;
616}
617
618static int nxt2002_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings)
619{
620 fesettings->min_delay_ms = 500;
621 fesettings->step_size = 0;
622 fesettings->max_drift = 0;
623 return 0;
624}
625
626static void nxt2002_release(struct dvb_frontend* fe)
627{
628 struct nxt2002_state* state = fe->demodulator_priv;
629 kfree(state);
630}
631
632static struct dvb_frontend_ops nxt2002_ops;
633
634struct dvb_frontend* nxt2002_attach(const struct nxt2002_config* config,
635 struct i2c_adapter* i2c)
636{
637 struct nxt2002_state* state = NULL;
638 u8 buf [] = {0,0,0,0,0};
639
640 /* allocate memory for the internal state */
641 state = kmalloc(sizeof(struct nxt2002_state), GFP_KERNEL);
642 if (state == NULL) goto error;
643
644 /* setup the state */
645 state->config = config;
646 state->i2c = i2c;
647 memcpy(&state->ops, &nxt2002_ops, sizeof(struct dvb_frontend_ops));
648 state->initialised = 0;
649
650 /* Check the first 5 registers to ensure this a revision we can handle */
651
652 i2c_readbytes(state, 0x00, buf, 5);
653 if (buf[0] != 0x04) goto error; /* device id */
654 if (buf[1] != 0x02) goto error; /* fab id */
655 if (buf[2] != 0x11) goto error; /* month */
656 if (buf[3] != 0x20) goto error; /* year msb */
657 if (buf[4] != 0x00) goto error; /* year lsb */
658
659 /* create dvb_frontend */
660 state->frontend.ops = &state->ops;
661 state->frontend.demodulator_priv = state;
662 return &state->frontend;
663
664error:
665 kfree(state);
666 return NULL;
667}
668
669static struct dvb_frontend_ops nxt2002_ops = {
670
671 .info = {
672 .name = "Nextwave nxt2002 VSB/QAM frontend",
673 .type = FE_ATSC,
674 .frequency_min = 54000000,
675 .frequency_max = 860000000,
676 /* stepsize is just a guess */
677 .frequency_stepsize = 166666,
678 .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
679 FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
680 FE_CAN_8VSB | FE_CAN_QAM_64 | FE_CAN_QAM_256
681 },
682
683 .release = nxt2002_release,
684
685 .init = nxt2002_init,
686 .sleep = nxt2002_sleep,
687
688 .set_frontend = nxt2002_setup_frontend_parameters,
689 .get_tune_settings = nxt2002_get_tune_settings,
690
691 .read_status = nxt2002_read_status,
692 .read_ber = nxt2002_read_ber,
693 .read_signal_strength = nxt2002_read_signal_strength,
694 .read_snr = nxt2002_read_snr,
695 .read_ucblocks = nxt2002_read_ucblocks,
696
697};
698
699module_param(debug, int, 0644);
700MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
701
702MODULE_DESCRIPTION("NXT2002 ATSC (8VSB & ITU J83 AnnexB FEC QAM64/256) demodulator driver");
703MODULE_AUTHOR("Taylor Jacob");
704MODULE_LICENSE("GPL");
705
706EXPORT_SYMBOL(nxt2002_attach);
diff --git a/drivers/media/dvb/frontends/nxt2002.h b/drivers/media/dvb/frontends/nxt2002.h
deleted file mode 100644
index 462301f577e..00000000000
--- a/drivers/media/dvb/frontends/nxt2002.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 Driver for the Nxt2002 demodulator
3*/
4
5#ifndef NXT2002_H
6#define NXT2002_H
7
8#include <linux/dvb/frontend.h>
9#include <linux/firmware.h>
10
11struct nxt2002_config
12{
13 /* the demodulator's i2c address */
14 u8 demod_address;
15
16 /* request firmware for device */
17 int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name);
18};
19
20extern struct dvb_frontend* nxt2002_attach(const struct nxt2002_config* config,
21 struct i2c_adapter* i2c);
22
23#endif // NXT2002_H
diff --git a/drivers/media/dvb/frontends/nxt200x.c b/drivers/media/dvb/frontends/nxt200x.c
index 78d2b93d35b..9e353539450 100644
--- a/drivers/media/dvb/frontends/nxt200x.c
+++ b/drivers/media/dvb/frontends/nxt200x.c
@@ -1,9 +1,10 @@
1/* 1/*
2 * Support for NXT2002 and NXT2004 - VSB/QAM 2 * Support for NXT2002 and NXT2004 - VSB/QAM
3 * 3 *
4 * Copyright (C) 2005 Kirk Lapray (kirk.lapray@gmail.com) 4 * Copyright (C) 2005 Kirk Lapray <kirk.lapray@gmail.com>
5 * Copyright (C) 2006 Michael Krufky <mkrufky@m1k.net>
5 * based on nxt2002 by Taylor Jacob <rtjacob@earthlink.net> 6 * based on nxt2002 by Taylor Jacob <rtjacob@earthlink.net>
6 * and nxt2004 by Jean-Francois Thibert (jeanfrancois@sagetv.com) 7 * and nxt2004 by Jean-Francois Thibert <jeanfrancois@sagetv.com>
7 * 8 *
8 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
@@ -614,7 +615,17 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
614 /* write sdm1 input */ 615 /* write sdm1 input */
615 buf[0] = 0x10; 616 buf[0] = 0x10;
616 buf[1] = 0x00; 617 buf[1] = 0x00;
617 nxt200x_writebytes(state, 0x58, buf, 2); 618 switch (state->demod_chip) {
619 case NXT2002:
620 nxt200x_writereg_multibyte(state, 0x58, buf, 2);
621 break;
622 case NXT2004:
623 nxt200x_writebytes(state, 0x58, buf, 2);
624 break;
625 default:
626 return -EINVAL;
627 break;
628 }
618 629
619 /* write sdmx input */ 630 /* write sdmx input */
620 switch (p->u.vsb.modulation) { 631 switch (p->u.vsb.modulation) {
@@ -632,7 +643,17 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
632 break; 643 break;
633 } 644 }
634 buf[1] = 0x00; 645 buf[1] = 0x00;
635 nxt200x_writebytes(state, 0x5C, buf, 2); 646 switch (state->demod_chip) {
647 case NXT2002:
648 nxt200x_writereg_multibyte(state, 0x5C, buf, 2);
649 break;
650 case NXT2004:
651 nxt200x_writebytes(state, 0x5C, buf, 2);
652 break;
653 default:
654 return -EINVAL;
655 break;
656 }
636 657
637 /* write adc power lpf fc */ 658 /* write adc power lpf fc */
638 buf[0] = 0x05; 659 buf[0] = 0x05;
@@ -648,7 +669,17 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
648 /* write accumulator2 input */ 669 /* write accumulator2 input */
649 buf[0] = 0x80; 670 buf[0] = 0x80;
650 buf[1] = 0x00; 671 buf[1] = 0x00;
651 nxt200x_writebytes(state, 0x4B, buf, 2); 672 switch (state->demod_chip) {
673 case NXT2002:
674 nxt200x_writereg_multibyte(state, 0x4B, buf, 2);
675 break;
676 case NXT2004:
677 nxt200x_writebytes(state, 0x4B, buf, 2);
678 break;
679 default:
680 return -EINVAL;
681 break;
682 }
652 683
653 /* write kg1 */ 684 /* write kg1 */
654 buf[0] = 0x00; 685 buf[0] = 0x00;
@@ -714,8 +745,19 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
714 /* write accumulator2 input */ 745 /* write accumulator2 input */
715 buf[0] = 0x80; 746 buf[0] = 0x80;
716 buf[1] = 0x00; 747 buf[1] = 0x00;
717 nxt200x_writebytes(state, 0x49, buf,2); 748 switch (state->demod_chip) {
718 nxt200x_writebytes(state, 0x4B, buf,2); 749 case NXT2002:
750 nxt200x_writereg_multibyte(state, 0x49, buf, 2);
751 nxt200x_writereg_multibyte(state, 0x4B, buf, 2);
752 break;
753 case NXT2004:
754 nxt200x_writebytes(state, 0x49, buf, 2);
755 nxt200x_writebytes(state, 0x4B, buf, 2);
756 break;
757 default:
758 return -EINVAL;
759 break;
760 }
719 761
720 /* write agc control reg */ 762 /* write agc control reg */
721 buf[0] = 0x04; 763 buf[0] = 0x04;
@@ -1199,7 +1241,7 @@ module_param(debug, int, 0644);
1199MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); 1241MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
1200 1242
1201MODULE_DESCRIPTION("NXT200X (ATSC 8VSB & ITU-T J.83 AnnexB 64/256 QAM) Demodulator Driver"); 1243MODULE_DESCRIPTION("NXT200X (ATSC 8VSB & ITU-T J.83 AnnexB 64/256 QAM) Demodulator Driver");
1202MODULE_AUTHOR("Kirk Lapray, Jean-Francois Thibert, and Taylor Jacob"); 1244MODULE_AUTHOR("Kirk Lapray, Michael Krufky, Jean-Francois Thibert, and Taylor Jacob");
1203MODULE_LICENSE("GPL"); 1245MODULE_LICENSE("GPL");
1204 1246
1205EXPORT_SYMBOL(nxt200x_attach); 1247EXPORT_SYMBOL(nxt200x_attach);
diff --git a/drivers/media/dvb/ttpci/av7110.h b/drivers/media/dvb/ttpci/av7110.h
index 6ea30df2e82..fafd25fab83 100644
--- a/drivers/media/dvb/ttpci/av7110.h
+++ b/drivers/media/dvb/ttpci/av7110.h
@@ -273,8 +273,6 @@ struct av7110 {
273extern int ChangePIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid, 273extern int ChangePIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid,
274 u16 subpid, u16 pcrpid); 274 u16 subpid, u16 pcrpid);
275 275
276extern int av7110_setup_irc_config (struct av7110 *av7110, u32 ir_config);
277
278extern int av7110_ir_init(struct av7110 *av7110); 276extern int av7110_ir_init(struct av7110 *av7110);
279extern void av7110_ir_exit(struct av7110 *av7110); 277extern void av7110_ir_exit(struct av7110 *av7110);
280 278
diff --git a/drivers/media/dvb/ttpci/av7110_ir.c b/drivers/media/dvb/ttpci/av7110_ir.c
index 9138132ad25..617e4f6c0ed 100644
--- a/drivers/media/dvb/ttpci/av7110_ir.c
+++ b/drivers/media/dvb/ttpci/av7110_ir.c
@@ -155,6 +155,19 @@ static void input_repeat_key(unsigned long data)
155} 155}
156 156
157 157
158static int av7110_setup_irc_config(struct av7110 *av7110, u32 ir_config)
159{
160 int ret = 0;
161
162 dprintk(4, "%p\n", av7110);
163 if (av7110) {
164 ret = av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, SetIR, 1, ir_config);
165 av7110->ir_config = ir_config;
166 }
167 return ret;
168}
169
170
158static int av7110_ir_write_proc(struct file *file, const char __user *buffer, 171static int av7110_ir_write_proc(struct file *file, const char __user *buffer,
159 unsigned long count, void *data) 172 unsigned long count, void *data)
160{ 173{
@@ -187,19 +200,6 @@ static int av7110_ir_write_proc(struct file *file, const char __user *buffer,
187} 200}
188 201
189 202
190int av7110_setup_irc_config(struct av7110 *av7110, u32 ir_config)
191{
192 int ret = 0;
193
194 dprintk(4, "%p\n", av7110);
195 if (av7110) {
196 ret = av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, SetIR, 1, ir_config);
197 av7110->ir_config = ir_config;
198 }
199 return ret;
200}
201
202
203static void ir_handler(struct av7110 *av7110, u32 ircom) 203static void ir_handler(struct av7110 *av7110, u32 ircom)
204{ 204{
205 dprintk(4, "ircommand = %08x\n", ircom); 205 dprintk(4, "ircommand = %08x\n", ircom);
diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig
index 53308911ae6..e99dfbbf3e9 100644
--- a/drivers/media/video/cx88/Kconfig
+++ b/drivers/media/video/cx88/Kconfig
@@ -32,6 +32,7 @@ config VIDEO_CX88_DVB
32config VIDEO_CX88_ALSA 32config VIDEO_CX88_ALSA
33 tristate "ALSA DMA audio support" 33 tristate "ALSA DMA audio support"
34 depends on VIDEO_CX88 && SND && EXPERIMENTAL 34 depends on VIDEO_CX88 && SND && EXPERIMENTAL
35 select SND_PCM
35 ---help--- 36 ---help---
36 This is a video4linux driver for direct (DMA) audio on 37 This is a video4linux driver for direct (DMA) audio on
37 Conexant 2388x based TV cards. 38 Conexant 2388x based TV cards.
@@ -48,6 +49,7 @@ config VIDEO_CX88_DVB_ALL_FRONTENDS
48 default y 49 default y
49 depends on VIDEO_CX88_DVB 50 depends on VIDEO_CX88_DVB
50 select DVB_MT352 51 select DVB_MT352
52 select VIDEO_CX88_VP3054
51 select DVB_OR51132 53 select DVB_OR51132
52 select DVB_CX22702 54 select DVB_CX22702
53 select DVB_LGDT330X 55 select DVB_LGDT330X
@@ -69,6 +71,16 @@ config VIDEO_CX88_DVB_MT352
69 This adds DVB-T support for cards based on the 71 This adds DVB-T support for cards based on the
70 Connexant 2388x chip and the MT352 demodulator. 72 Connexant 2388x chip and the MT352 demodulator.
71 73
74config VIDEO_CX88_VP3054
75 tristate "VP-3054 Secondary I2C Bus Support"
76 default m
77 depends on DVB_MT352
78 ---help---
79 This adds DVB-T support for cards based on the
80 Connexant 2388x chip and the MT352 demodulator,
81 which also require support for the VP-3054
82 Secondary I2C bus, such at DNTV Live! DVB-T Pro.
83
72config VIDEO_CX88_DVB_OR51132 84config VIDEO_CX88_DVB_OR51132
73 bool "OR51132 ATSC Support" 85 bool "OR51132 ATSC Support"
74 default y 86 default y
diff --git a/drivers/media/video/cx88/Makefile b/drivers/media/video/cx88/Makefile
index 6e5eaa22619..2b902784fac 100644
--- a/drivers/media/video/cx88/Makefile
+++ b/drivers/media/video/cx88/Makefile
@@ -4,8 +4,9 @@ cx8800-objs := cx88-video.o cx88-vbi.o
4cx8802-objs := cx88-mpeg.o 4cx8802-objs := cx88-mpeg.o
5 5
6obj-$(CONFIG_VIDEO_CX88) += cx88xx.o cx8800.o cx8802.o cx88-blackbird.o 6obj-$(CONFIG_VIDEO_CX88) += cx88xx.o cx8800.o cx8802.o cx88-blackbird.o
7obj-$(CONFIG_VIDEO_CX88_DVB) += cx88-dvb.o cx88-vp3054-i2c.o 7obj-$(CONFIG_VIDEO_CX88_DVB) += cx88-dvb.o
8obj-$(CONFIG_VIDEO_CX88_ALSA) += cx88-alsa.o 8obj-$(CONFIG_VIDEO_CX88_ALSA) += cx88-alsa.o
9obj-$(CONFIG_VIDEO_CX88_VP3054) += cx88-vp3054-i2c.o
9 10
10EXTRA_CFLAGS += -I$(src)/.. 11EXTRA_CFLAGS += -I$(src)/..
11EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core 12EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core
@@ -18,6 +19,6 @@ extra-cflags-$(CONFIG_DVB_LGDT330X) += -DHAVE_LGDT330X=1
18extra-cflags-$(CONFIG_DVB_MT352) += -DHAVE_MT352=1 19extra-cflags-$(CONFIG_DVB_MT352) += -DHAVE_MT352=1
19extra-cflags-$(CONFIG_DVB_NXT200X) += -DHAVE_NXT200X=1 20extra-cflags-$(CONFIG_DVB_NXT200X) += -DHAVE_NXT200X=1
20extra-cflags-$(CONFIG_DVB_CX24123) += -DHAVE_CX24123=1 21extra-cflags-$(CONFIG_DVB_CX24123) += -DHAVE_CX24123=1
21extra-cflags-$(CONFIG_VIDEO_CX88_DVB)+= -DHAVE_VP3054_I2C=1 22extra-cflags-$(CONFIG_VIDEO_CX88_VP3054)+= -DHAVE_VP3054_I2C=1
22 23
23EXTRA_CFLAGS += $(extra-cflags-y) $(extra-cflags-m) 24EXTRA_CFLAGS += $(extra-cflags-y) $(extra-cflags-m)
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index ad2f565f522..1bc999247fd 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -1246,6 +1246,11 @@ struct cx88_subid cx88_subids[] = {
1246 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL, 1246 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL,
1247 },{ 1247 },{
1248 .subvendor = 0x18ac, 1248 .subvendor = 0x18ac,
1249 .subdevice = 0xdb54,
1250 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL,
1251 /* Re-branded DViCO: DigitalNow DVB-T Dual */
1252 },{
1253 .subvendor = 0x18ac,
1249 .subdevice = 0xdb11, 1254 .subdevice = 0xdb11,
1250 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS, 1255 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
1251 /* Re-branded DViCO: UltraView DVB-T Plus */ 1256 /* Re-branded DViCO: UltraView DVB-T Plus */
@@ -1293,6 +1298,7 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
1293 switch (tv.model) 1298 switch (tv.model)
1294 { 1299 {
1295 case 28552: /* WinTV-PVR 'Roslyn' (No IR) */ 1300 case 28552: /* WinTV-PVR 'Roslyn' (No IR) */
1301 case 34519: /* WinTV-PCI-FM */
1296 case 90002: /* Nova-T-PCI (9002) */ 1302 case 90002: /* Nova-T-PCI (9002) */
1297 case 92001: /* Nova-S-Plus (Video and IR) */ 1303 case 92001: /* Nova-S-Plus (Video and IR) */
1298 case 92002: /* Nova-S-Plus (Video and IR) */ 1304 case 92002: /* Nova-S-Plus (Video and IR) */
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index dff3893f32f..82f0c5fb241 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -253,7 +253,7 @@ int em28xx_write_ac97(struct em28xx *dev, u8 reg, u8 * val)
253 if ((ret = em28xx_read_reg(dev, AC97BUSY_REG)) < 0) 253 if ((ret = em28xx_read_reg(dev, AC97BUSY_REG)) < 0)
254 return ret; 254 return ret;
255 else if (((u8) ret) & 0x01) { 255 else if (((u8) ret) & 0x01) {
256 em28xx_warn ("AC97 command still being exectuted: not handled properly!\n"); 256 em28xx_warn ("AC97 command still being executed: not handled properly!\n");
257 } 257 }
258 return 0; 258 return 0;
259} 259}
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index eea304f7517..94a14a2bb6d 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -6,6 +6,9 @@
6 Mauro Carvalho Chehab <mchehab@brturbo.com.br> 6 Mauro Carvalho Chehab <mchehab@brturbo.com.br>
7 Sascha Sommer <saschasommer@freenet.de> 7 Sascha Sommer <saschasommer@freenet.de>
8 8
9 Some parts based on SN9C10x PC Camera Controllers GPL driver made
10 by Luca Risolia <luca.risolia@studio.unibo.it>
11
9 This program is free software; you can redistribute it and/or modify 12 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by 13 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or 14 the Free Software Foundation; either version 2 of the License, or
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index c64718aec9c..5a35d3b6550 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -136,7 +136,7 @@ struct saa7134_board saa7134_boards[] = {
136 }, 136 },
137 [SAA7134_BOARD_FLYVIDEO2000] = { 137 [SAA7134_BOARD_FLYVIDEO2000] = {
138 /* "TC Wan" <tcwan@cs.usm.my> */ 138 /* "TC Wan" <tcwan@cs.usm.my> */
139 .name = "LifeView FlyVIDEO2000", 139 .name = "LifeView/Typhoon FlyVIDEO2000",
140 .audio_clock = 0x00200000, 140 .audio_clock = 0x00200000,
141 .tuner_type = TUNER_LG_PAL_NEW_TAPC, 141 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
142 .radio_type = UNSET, 142 .radio_type = UNSET,
@@ -1884,44 +1884,38 @@ struct saa7134_board saa7134_boards[] = {
1884 .gpio = 0x000, 1884 .gpio = 0x000,
1885 }, 1885 },
1886 }, 1886 },
1887 [SAA7134_BOARD_THYPHOON_DVBT_DUO_CARDBUS] = { 1887 [SAA7134_BOARD_FLYDVBT_DUO_CARDBUS] = {
1888 .name = "Typhoon DVB-T Duo Digital/Analog Cardbus", 1888 .name = "LifeView/Typhoon FlyDVB-T Duo Cardbus",
1889 .audio_clock = 0x00200000, 1889 .audio_clock = 0x00200000,
1890 .tuner_type = TUNER_PHILIPS_TDA8290, 1890 .tuner_type = TUNER_PHILIPS_TDA8290,
1891 .radio_type = UNSET, 1891 .radio_type = UNSET,
1892 .tuner_addr = ADDR_UNSET, 1892 .tuner_addr = ADDR_UNSET,
1893 .radio_addr = ADDR_UNSET, 1893 .radio_addr = ADDR_UNSET,
1894 .mpeg = SAA7134_MPEG_DVB, 1894 .mpeg = SAA7134_MPEG_DVB,
1895 /* .gpiomask = 0xe000, */ 1895 .gpiomask = 0x00200000,
1896 .inputs = {{ 1896 .inputs = {{
1897 .name = name_tv, 1897 .name = name_tv,
1898 .vmux = 1, 1898 .vmux = 1,
1899 .amux = TV, 1899 .amux = TV,
1900 /* .gpio = 0x0000, */ 1900 .gpio = 0x200000, /* GPIO21=High for TV input */
1901 .tv = 1, 1901 .tv = 1,
1902 },{ 1902 },{
1903 .name = name_svideo, /* S-Video signal on S-Video input */
1904 .vmux = 8,
1905 .amux = LINE2,
1906 },{
1903 .name = name_comp1, /* Composite signal on S-Video input */ 1907 .name = name_comp1, /* Composite signal on S-Video input */
1904 .vmux = 0, 1908 .vmux = 0,
1905 .amux = LINE2, 1909 .amux = LINE2,
1906 /* .gpio = 0x4000, */
1907 },{ 1910 },{
1908 .name = name_comp2, /* Composite input */ 1911 .name = name_comp2, /* Composite input */
1909 .vmux = 3, 1912 .vmux = 3,
1910 .amux = LINE2, 1913 .amux = LINE2,
1911 /* .gpio = 0x4000, */
1912 },{
1913 .name = name_svideo, /* S-Video signal on S-Video input */
1914 .vmux = 8,
1915 .amux = LINE2,
1916 /* .gpio = 0x4000, */
1917 }}, 1914 }},
1918 .radio = { 1915 .radio = {
1919 .name = name_radio, 1916 .name = name_radio,
1920 .amux = LINE2, 1917 .amux = TV,
1921 }, 1918 .gpio = 0x000000, /* GPIO21=Low for FM radio antenna */
1922 .mute = {
1923 .name = name_mute,
1924 .amux = LINE1,
1925 }, 1919 },
1926 }, 1920 },
1927 [SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII] = { 1921 [SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII] = {
@@ -2701,6 +2695,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
2701 .driver_data = SAA7134_BOARD_FLYVIDEO2000, 2695 .driver_data = SAA7134_BOARD_FLYVIDEO2000,
2702 },{ 2696 },{
2703 .vendor = PCI_VENDOR_ID_PHILIPS, 2697 .vendor = PCI_VENDOR_ID_PHILIPS,
2698 .device = PCI_DEVICE_ID_PHILIPS_SAA7130,
2699 .subvendor = 0x4e42, /* Typhoon */
2700 .subdevice = 0x0138, /* LifeView FlyTV Prime30 OEM */
2701 .driver_data = SAA7134_BOARD_FLYVIDEO2000,
2702 },{
2703 .vendor = PCI_VENDOR_ID_PHILIPS,
2704 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 2704 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
2705 .subvendor = 0x5168, 2705 .subvendor = 0x5168,
2706 .subdevice = 0x0212, /* minipci, LR212 */ 2706 .subdevice = 0x0212, /* minipci, LR212 */
@@ -2935,7 +2935,7 @@ struct pci_device_id saa7134_pci_tbl[] = {
2935 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 2935 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
2936 .subvendor = 0x5168, 2936 .subvendor = 0x5168,
2937 .subdevice = 0x0502, /* Cardbus version */ 2937 .subdevice = 0x0502, /* Cardbus version */
2938 .driver_data = SAA7134_BOARD_FLYDVBTDUO, 2938 .driver_data = SAA7134_BOARD_FLYDVBT_DUO_CARDBUS,
2939 },{ 2939 },{
2940 .vendor = PCI_VENDOR_ID_PHILIPS, 2940 .vendor = PCI_VENDOR_ID_PHILIPS,
2941 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 2941 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
@@ -2980,12 +2980,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
2980 .subdevice = 0x1370, /* cardbus version */ 2980 .subdevice = 0x1370, /* cardbus version */
2981 .driver_data = SAA7134_BOARD_ADS_INSTANT_TV, 2981 .driver_data = SAA7134_BOARD_ADS_INSTANT_TV,
2982 2982
2983 },{ /* Typhoon DVB-T Duo Digital/Analog Cardbus */ 2983 },{
2984 .vendor = PCI_VENDOR_ID_PHILIPS, 2984 .vendor = PCI_VENDOR_ID_PHILIPS,
2985 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 2985 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
2986 .subvendor = 0x4e42, 2986 .subvendor = 0x4e42, /* Typhoon */
2987 .subdevice = 0x0502, 2987 .subdevice = 0x0502, /* LifeView LR502 OEM */
2988 .driver_data = SAA7134_BOARD_THYPHOON_DVBT_DUO_CARDBUS, 2988 .driver_data = SAA7134_BOARD_FLYDVBT_DUO_CARDBUS,
2989 },{ 2989 },{
2990 .vendor = PCI_VENDOR_ID_PHILIPS, 2990 .vendor = PCI_VENDOR_ID_PHILIPS,
2991 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 2991 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
@@ -3206,8 +3206,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
3206 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); 3206 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000);
3207 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000004); 3207 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000004);
3208 break; 3208 break;
3209 case SAA7134_BOARD_FLYDVBTDUO: 3209 case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS:
3210 case SAA7134_BOARD_THYPHOON_DVBT_DUO_CARDBUS:
3211 /* turn the fan on */ 3210 /* turn the fan on */
3212 saa_writeb(SAA7134_GPIO_GPMODE3, 0x08); 3211 saa_writeb(SAA7134_GPIO_GPMODE3, 0x08);
3213 saa_writeb(SAA7134_GPIO_GPSTATUS3, 0x06); 3212 saa_writeb(SAA7134_GPIO_GPSTATUS3, 0x06);
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 399f9952596..1a536e86527 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -861,7 +861,7 @@ static int dvb_init(struct saa7134_dev *dev)
861 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, 861 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config,
862 &dev->i2c_adap); 862 &dev->i2c_adap);
863 break; 863 break;
864 case SAA7134_BOARD_THYPHOON_DVBT_DUO_CARDBUS: 864 case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS:
865 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, 865 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config,
866 &dev->i2c_adap); 866 &dev->i2c_adap);
867 break; 867 break;
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index e70eae8d29b..3261d8bebdd 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -185,7 +185,7 @@ struct saa7134_format {
185#define SAA7134_BOARD_AVERMEDIA_GO_007_FM 57 185#define SAA7134_BOARD_AVERMEDIA_GO_007_FM 57
186#define SAA7134_BOARD_ADS_INSTANT_TV 58 186#define SAA7134_BOARD_ADS_INSTANT_TV 58
187#define SAA7134_BOARD_KWORLD_VSTREAM_XPERT 59 187#define SAA7134_BOARD_KWORLD_VSTREAM_XPERT 59
188#define SAA7134_BOARD_THYPHOON_DVBT_DUO_CARDBUS 60 188#define SAA7134_BOARD_FLYDVBT_DUO_CARDBUS 60
189#define SAA7134_BOARD_PHILIPS_TOUGH 61 189#define SAA7134_BOARD_PHILIPS_TOUGH 61
190#define SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII 62 190#define SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII 62
191#define SAA7134_BOARD_KWORLD_XPERT 63 191#define SAA7134_BOARD_KWORLD_XPERT 63
diff --git a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c
index 54fc33011ff..9d769264a32 100644
--- a/drivers/media/video/stradis.c
+++ b/drivers/media/video/stradis.c
@@ -2012,7 +2012,6 @@ static int __devinit init_saa7146(struct pci_dev *pdev)
2012{ 2012{
2013 struct saa7146 *saa = pci_get_drvdata(pdev); 2013 struct saa7146 *saa = pci_get_drvdata(pdev);
2014 2014
2015 memset(saa, 0, sizeof(*saa));
2016 saa->user = 0; 2015 saa->user = 0;
2017 /* reset the saa7146 */ 2016 /* reset the saa7146 */
2018 saawrite(0xffff0000, SAA7146_MC1); 2017 saawrite(0xffff0000, SAA7146_MC1);
@@ -2062,16 +2061,16 @@ static int __devinit init_saa7146(struct pci_dev *pdev)
2062 } 2061 }
2063 if (saa->audbuf == NULL && (saa->audbuf = vmalloc(65536)) == NULL) { 2062 if (saa->audbuf == NULL && (saa->audbuf = vmalloc(65536)) == NULL) {
2064 dev_err(&pdev->dev, "%d: malloc failed\n", saa->nr); 2063 dev_err(&pdev->dev, "%d: malloc failed\n", saa->nr);
2065 goto errvid; 2064 goto errfree;
2066 } 2065 }
2067 if (saa->osdbuf == NULL && (saa->osdbuf = vmalloc(131072)) == NULL) { 2066 if (saa->osdbuf == NULL && (saa->osdbuf = vmalloc(131072)) == NULL) {
2068 dev_err(&pdev->dev, "%d: malloc failed\n", saa->nr); 2067 dev_err(&pdev->dev, "%d: malloc failed\n", saa->nr);
2069 goto erraud; 2068 goto errfree;
2070 } 2069 }
2071 /* allocate 81920 byte buffer for clipping */ 2070 /* allocate 81920 byte buffer for clipping */
2072 if ((saa->dmavid2 = kzalloc(VIDEO_CLIPMAP_SIZE, GFP_KERNEL)) == NULL) { 2071 if ((saa->dmavid2 = kzalloc(VIDEO_CLIPMAP_SIZE, GFP_KERNEL)) == NULL) {
2073 dev_err(&pdev->dev, "%d: clip kmalloc failed\n", saa->nr); 2072 dev_err(&pdev->dev, "%d: clip kmalloc failed\n", saa->nr);
2074 goto errosd; 2073 goto errfree;
2075 } 2074 }
2076 /* setup clipping registers */ 2075 /* setup clipping registers */
2077 saawrite(virt_to_bus(saa->dmavid2), SAA7146_BASE_EVEN2); 2076 saawrite(virt_to_bus(saa->dmavid2), SAA7146_BASE_EVEN2);
@@ -2085,15 +2084,11 @@ static int __devinit init_saa7146(struct pci_dev *pdev)
2085 I2CBusScan(saa); 2084 I2CBusScan(saa);
2086 2085
2087 return 0; 2086 return 0;
2088errosd: 2087errfree:
2089 vfree(saa->osdbuf); 2088 vfree(saa->osdbuf);
2090 saa->osdbuf = NULL;
2091erraud:
2092 vfree(saa->audbuf); 2089 vfree(saa->audbuf);
2093 saa->audbuf = NULL;
2094errvid:
2095 vfree(saa->vidbuf); 2090 vfree(saa->vidbuf);
2096 saa->vidbuf = NULL; 2091 saa->audbuf = saa->osdbuf = saa->vidbuf = NULL;
2097err: 2092err:
2098 return -ENOMEM; 2093 return -ENOMEM;
2099} 2094}
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
index 5815649bdc7..7c71422f5d3 100644
--- a/drivers/media/video/tda9887.c
+++ b/drivers/media/video/tda9887.c
@@ -876,7 +876,7 @@ static int tda9887_resume(struct device * dev)
876/* ----------------------------------------------------------------------- */ 876/* ----------------------------------------------------------------------- */
877 877
878static struct i2c_driver driver = { 878static struct i2c_driver driver = {
879 .id = -1, /* FIXME */ 879 .id = I2C_DRIVERID_TDA9887,
880 .attach_adapter = tda9887_probe, 880 .attach_adapter = tda9887_probe,
881 .detach_client = tda9887_detach, 881 .detach_client = tda9887_detach,
882 .command = tda9887_command, 882 .command = tda9887_command,
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 2995b22acb4..873bf3d9679 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -216,6 +216,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
216 buffer[3] = 0xa4; 216 buffer[3] = 0xa4;
217 i2c_master_send(c,buffer,4); 217 i2c_master_send(c,buffer,4);
218 default_tuner_init(c); 218 default_tuner_init(c);
219 break;
219 default: 220 default:
220 default_tuner_init(c); 221 default_tuner_init(c);
221 break; 222 break;
@@ -448,7 +449,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
448 printk("%02x ",buffer[i]); 449 printk("%02x ",buffer[i]);
449 printk("\n"); 450 printk("\n");
450 } 451 }
451 /* TEA5767 autodetection code - only for addr = 0xc0 */ 452 /* autodetection code based on the i2c addr */
452 if (!no_autodetect) { 453 if (!no_autodetect) {
453 switch (addr) { 454 switch (addr) {
454 case 0x42: 455 case 0x42:
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index 6d03b9b05c6..c8e5ad0e818 100644
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@ -390,6 +390,14 @@ static void tda9840_setmode(struct CHIPSTATE *chip, int mode)
390 chip_write(chip, TDA9840_SW, t); 390 chip_write(chip, TDA9840_SW, t);
391} 391}
392 392
393static int tda9840_checkit(struct CHIPSTATE *chip)
394{
395 int rc;
396 rc = chip_read(chip);
397 /* lower 5 bits should be 0 */
398 return ((rc & 0x1f) == 0) ? 1 : 0;
399}
400
393/* ---------------------------------------------------------------------- */ 401/* ---------------------------------------------------------------------- */
394/* audio chip descriptions - defines+functions for tda985x */ 402/* audio chip descriptions - defines+functions for tda985x */
395 403
@@ -1264,6 +1272,7 @@ static struct CHIPDESC chiplist[] = {
1264 .addr_hi = I2C_TDA9840 >> 1, 1272 .addr_hi = I2C_TDA9840 >> 1,
1265 .registers = 5, 1273 .registers = 5,
1266 1274
1275 .checkit = tda9840_checkit,
1267 .getmode = tda9840_getmode, 1276 .getmode = tda9840_getmode,
1268 .setmode = tda9840_setmode, 1277 .setmode = tda9840_setmode,
1269 .checkmode = generic_checkmode, 1278 .checkmode = generic_checkmode,
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c
index fad9ea0ae4f..a6330a351ea 100644
--- a/drivers/media/video/tvp5150.c
+++ b/drivers/media/video/tvp5150.c
@@ -746,24 +746,27 @@ static int tvp5150_set_std(struct i2c_client *c, v4l2_std_id std)
746 746
747static inline void tvp5150_reset(struct i2c_client *c) 747static inline void tvp5150_reset(struct i2c_client *c)
748{ 748{
749 u8 type, ver_656, msb_id, lsb_id, msb_rom, lsb_rom; 749 u8 msb_id, lsb_id, msb_rom, lsb_rom;
750 struct tvp5150 *decoder = i2c_get_clientdata(c); 750 struct tvp5150 *decoder = i2c_get_clientdata(c);
751 751
752 type=tvp5150_read(c,TVP5150_AUTOSW_MSK);
753 msb_id=tvp5150_read(c,TVP5150_MSB_DEV_ID); 752 msb_id=tvp5150_read(c,TVP5150_MSB_DEV_ID);
754 lsb_id=tvp5150_read(c,TVP5150_LSB_DEV_ID); 753 lsb_id=tvp5150_read(c,TVP5150_LSB_DEV_ID);
755 msb_rom=tvp5150_read(c,TVP5150_ROM_MAJOR_VER); 754 msb_rom=tvp5150_read(c,TVP5150_ROM_MAJOR_VER);
756 lsb_rom=tvp5150_read(c,TVP5150_ROM_MINOR_VER); 755 lsb_rom=tvp5150_read(c,TVP5150_ROM_MINOR_VER);
757 756
758 if (type==0xdc) { 757 if ((msb_rom==4)&&(lsb_rom==0)) { /* Is TVP5150AM1 */
759 ver_656=tvp5150_read(c,TVP5150_REV_SELECT); 758 tvp5150_info("tvp%02x%02xam1 detected.\n",msb_id, lsb_id);
760 tvp5150_info("tvp%02x%02xam1 detected 656 version is %d.\n",msb_id, lsb_id,ver_656); 759
761 } else if (type==0xfc) { 760 /* ITU-T BT.656.4 timing */
762 tvp5150_info("tvp%02x%02xa detected.\n",msb_id, lsb_id); 761 tvp5150_write(c,TVP5150_REV_SELECT,0);
763 } else { 762 } else {
764 tvp5150_info("unknown tvp%02x%02x chip detected(%d).\n",msb_id,lsb_id,type); 763 if ((msb_rom==3)||(lsb_rom==0x21)) { /* Is TVP5150A */
764 tvp5150_info("tvp%02x%02xa detected.\n",msb_id, lsb_id);
765 } else {
766 tvp5150_info("*** unknown tvp%02x%02x chip detected.\n",msb_id,lsb_id);
767 tvp5150_info("*** Rom ver is %d.%d\n",msb_rom,lsb_rom);
768 }
765 } 769 }
766 tvp5150_info("Rom ver is %d.%d\n",msb_rom,lsb_rom);
767 770
768 /* Initializes TVP5150 to its default values */ 771 /* Initializes TVP5150 to its default values */
769 tvp5150_write_inittab(c, tvp5150_init_default); 772 tvp5150_write_inittab(c, tvp5150_init_default);