Re: new driver for: Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022] as card=118 in cardlist.saa7134

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sioux,

Am Sonntag, den 02.12.2007, 01:08 +0100 schrieb sioux:
> Hey guys... I am feed up to stay compile each time when a new kernel 
> upgrades cames up.
> 
> Please I need your help to complite my stupid work (my prefered distro 
> is a ubuntu... please at least for my distro can you redistribute this 
> driver?)
> 
> The works that needs to be complited is about PCI kernel automatic loads 
> of this video card and probably some other.
> 
> This is the card:

have a look at what we had back in May for the card.
http://www.linuxtv.org/pipermail/linux-dvb/2007-May/017946.html

It is trashed with some top-postings, but finally Egidio reported
everything working by forcing the TIGER_S.

The remote is not yet investigated.

> sioux@sioux-desktop:~$ sudo lspci -s 02:09.0 -vv -xxxx
> 02:09.0 Multimedia controller: Philips Semiconductors SAA7133/SAA7135 
> Video Broadcast Decoder (rev d1)
>         Subsystem: Twinhan Technology Co. Ltd Unknown device 0022
[...]
> And here is my driver Signed off for this card that is: Twinhan Hybrid 
> DTV-DVB 3056 PCI  [1822:0022]
> 
> ________________________________ well
> 
> 
> In cardlist.saa7134 please add:
> 
> 118 -> Twinhan Hybrid DTV-DVB 3056 PCI          [1822:0022]
> 

A script will do this automatically when "make commit" is called.

> ____________________________________________________
> 
> 
> In saa7134.h please add:
> 
> #define SAA7134_BOARD_TWINHAN_DTV_DVB_3056 118
> 
> _____________________________________________________________
> 
> 
> In saa7134.card.c add:
> 
>     [SAA7134_BOARD_TWINHAN_DTV_DVB_3056] = {
>                 /* sioux signed-off <email@xxxxxxxxxxxxxxxxxxx> :-) */
>         .name           = "Twinhan Hybrid DTV-DVB 3056 PCI",
>         .audio_clock    = 0x00187de7,
>         .tuner_type     = TUNER_PHILIPS_TDA8290,
>         .radio_type     = UNSET,
>         .tuner_addr    = ADDR_UNSET,
>         .radio_addr    = ADDR_UNSET,
>         .tuner_config   = 2,
>         .mpeg           = SAA7134_MPEG_DVB,
>         .gpiomask       = 0x0400000,
>         .inputs = {{
>             .name   = name_tv,
>             .vmux   = 1,
>             .amux   = TV,
>             .tv     = 1,
>         },{
>             .name   = name_comp1,
>             .vmux   = 3,
>             .amux   = LINE1,
>         },{
>             .name   = name_svideo,
>             .vmux   = 8,
>             .amux   = LINE1,
>         }},
>         .radio = {
>             .name   = name_radio,
>             .amux   = TV,
>         },
>     },
> 

Unless you teach me better, I'll keep this like the TIGER_S has it and
what Egidio tested. 

> .......
> 
>         case SAA7134_BOARD_TWINHAN_DTV_DVB_3056:
>     /* I don't know why I have to do this, but this cards was ok as 
> tiger_s. In case fix me */
>     /* No other different ways could I found. Signed OFF by sioux */
>         {
>         u8 data[] = { 0x3c, 0x33, 0x60};
>         struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = 
> sizeof(data)};
>         if(dev->autodetected && (dev->eedata[0x49] == 0x50)) {

This breaks it for you and you don't need any eeprom detection at all.
But your card is sharp here,

>             dev->board = SAA7134_BOARD_TWINHAN_DTV_DVB_3056;
>             printk(KERN_INFO "%s: Reconfigured board as %s\n",
>                 dev->name, saa7134_boards[dev->board].name);
>         }
>         if(dev->board == SAA7134_BOARD_TWINHAN_DTV_DVB_3056) {
>             tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
>             tun_setup.type = TUNER_PHILIPS_TDA8290;
>             tun_setup.addr = 0x4b;

and then the TDA8290 is forced to an wrong address. You have it at 0x42.

>             tun_setup.config = 2;
> 
>             saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup);
>             data[2] = 0x68;
>         }
>         i2c_transfer(&dev->i2c_adap, &msg, 1);
>         }
> 
> 
> This is one problem... if in saa7134.card.c I add this code for 
> automatic driver load:
> 
>         .vendor       = PCI_VENDOR_ID_PHILIPS,
>         .device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
>         .subvendor    = 0x1822, /*Twinhan Technology Co. Ltd*/
>         .subdevice    = 0x0022,
>         .driver_data  = SAA7134_BOARD_TWINHAN_DTV_DVB_3056
> 
> The card is loaded but only: DVB-T and radio works fine, the analog 
> tuner no; gives no audio e not all channels are correctly scanned and 
> the pictures are unstable. I don't know why some more works around need 
> to be done.

If autodetected, the analog demodulator is forced to a wrong address by
the eeprom detection. The radio is demodulated by the saa7131e.

> 
> So:
> 
> sudo modprobe saa7134 card=118
> 
> it's ok and than all works fine.

If _not_ autodetected, the tda8290 is not forced to a wrong address by
the successful eeprom detection and works fine at 0x42.

> 
> ______________________________________________
> 
> This is the code to add in saa7134-dvb.c
> 
>     case SAA7134_BOARD_TWINHAN_DTV_DVB_3056:
>         configure_tda827x_fe(dev, &twinhan_dtv_dvb_3056_config);
> 
> 
> static struct tda1004x_config twinhan_dtv_dvb_3056_config = {
>         /* sioux signed-off <email@xxxxxxxxxxxxxxxxxxx> :-) */
>     .demod_address = 0x08,
>     .invert        = 1,
>     .invert_oclk   = 0,
>     .xtal_freq     = TDA10046_XTAL_16M,
>     .agc_config    = TDA10046_AGC_TDA827X,
>     .gpio_config   = TDA10046_GP01_I,
>     .if_freq       = TDA10046_FREQ_045,
>     .i2c_gate      = 0x42,
      ^^^^^^^^^^^^^^^^^^^^^
That was the point on this card.

>     .tuner_address = 0x61,
>     .tuner_config  = 2,
>     .antenna_switch= 1,
>     .request_firmware = philips_tda1004x_request_firmware
> };
> 
> ____________________________________
> 
> 
> That's all I have done!
> 
> ____________________________________
> 
> Here is the dmesg | grep saa result with sudo modprobe:
> 
> [  233.619551] saa7130/34: v4l2 driver version 0.2.14 loaded
> [  233.623436] saa7133[0]: found at 0000:02:09.0, rev: 209, irq: 21, 
> latency: 32, mmio: 0xed000000
> [  233.623494] saa7133[0]: subsystem: 1822:0022, board: Twinhan Hybrid 
> DTV-DVB 3056 PCI [card=118,insmod option]
> [  233.623512] saa7133[0]: board init: gpio is 40000
> [  233.768202] saa7133[0]: i2c eeprom 00: 22 18 22 00 54 20 1c 00 43 43 
> a9 1c 55 d2 b2 92
> [  233.768222] saa7133[0]: i2c eeprom 10: 00 01 fb 00 ff 20 ff ff ff ff 
> ff ff ff ff ff ff
> [  233.768236] saa7133[0]: i2c eeprom 20: 01 40 01 02 03 01 01 03 08 ff 
> 00 10 ff ff ff ff
> [  233.768251] saa7133[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff
> [  233.768265] saa7133[0]: i2c eeprom 40: ff 21 00 c2 84 10 03 32 15 50 
                                                                       ^^  <---------------
> ff ff ff ff ff ff
> [  233.768279] saa7133[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff
> [  233.768293] saa7133[0]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff
> [  233.768307] saa7133[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff
> [  233.768321] saa7133[0]: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff
> [  233.768336] saa7133[0]: i2c eeprom 90: ff ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff
> [  233.768350] saa7133[0]: i2c eeprom a0: ff ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff
> [  233.768364] saa7133[0]: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff
> [  233.768378] saa7133[0]: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff
> [  233.768393] saa7133[0]: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff
> [  233.768407] saa7133[0]: i2c eeprom e0: ff ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff
> [  233.768421] saa7133[0]: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff
> [  233.852063] tuner' 0-0042: chip found @ 0x84 (saa7133[0])
> [  234.944765] saa7133[0]: registered device video0 [v4l2]
> [  234.945574] saa7133[0]: registered device vbi0
> [  234.945637] saa7133[0]: registered device radio0
> [  235.054130] saa7134 ALSA driver for DMA sound loaded
> [  235.054178] saa7133[0]/alsa: saa7133[0] at 0xed000000 irq 21 
> registered as card -2
> [  235.130080] DVB: registering new adapter (saa7133[0])
> 
> 
> And here is the result for DVB-T with kaffeine:
> 
> sioux@sioux-desktop:~$ kaffeine
> 0
> /dev/dvb/adapter0/frontend0 : opened ( Philips TDA10046H DVB-T )
> /dev/dvb/0/frontend1 : : Nessun file o directory
> Loaded epg data : 5 events (3 msecs)
> sioux@sioux-desktop:~$ Tuning to: RaiDue / autocount: 0
> DvbCam::probe(): /dev/dvb/adapter0/ca0: : Nessun file o directory
> Using DVB device 0:0 "Philips TDA10046H DVB-T"
> tuning DVB-T to 698000000 Hz
> inv:2 bw:0 fecH:2 fecL:9 mod:3 tm:1 gi:0 hier:4
> ..... LOCKED.
> 
> ____________________________________
> 
> 
> Well, now
> please someone else much more developer of me (I am not a developer... 
> just a crazy sioux) please do the rest!

Well done, let's try to talk to the pidgins.

> Thank You.
> 
> Sioux.

Here is a patch against current v4l-dvb master repo, which should help
to overcome your issues.

Please test and report, that we can achieve what you desire!

Also please read about submitting patches, especially about the
Signed-off-by line.
http://www.linuxtv.org/v4lwiki/index.php/SubmittingPatches#Sign_your_work

If you don't like to provide valid name and e-mail, we can only give
credit to Sioux at <email@xxxxxxxxxxxxxxxxxxx> and me or somebody else
must try to get the stuff through without having the card.

Since it is more than six months back, that the card could have been
added, guess I'll try this next pointing at the state of affairs we have
here now.

Cheers,
Hermann

diff -r 27b2c6a80826 linux/drivers/media/video/saa7134/saa7134-cards.c
--- a/linux/drivers/media/video/saa7134/saa7134-cards.c	Fri Nov 30 18:27:26 2007 +0200
+++ b/linux/drivers/media/video/saa7134/saa7134-cards.c	Mon Dec 03 19:24:53 2007 +0100
@@ -3600,6 +3600,36 @@ struct saa7134_board saa7134_boards[] = 
 			.tv     = 1,
 		}},
 	},
+	[SAA7134_BOARD_TWINHAN_DTV_DVB_3056] = {
+		.name           = "Twinhan Hybrid DTV-DVB 3056 PCI",
+		.audio_clock    = 0x00187de7,
+		.tuner_type     = TUNER_PHILIPS_TDA8290,
+		.radio_type     = UNSET,
+		.tuner_addr	= ADDR_UNSET,
+		.radio_addr	= ADDR_UNSET,
+		.tuner_config   = 2,
+		.mpeg           = SAA7134_MPEG_DVB,
+		.gpiomask       = 0x0200000,
+		.inputs = {{
+			.name   = name_tv,
+			.vmux   = 1,
+			.amux   = TV,
+			.tv     = 1,
+		}, {
+			.name   = name_comp1,
+			.vmux   = 3,
+			.amux   = LINE1,
+		}, {
+			.name   = name_svideo,
+			.vmux   = 8,
+			.amux   = LINE1,
+		} },
+		.radio = {
+			.name   = name_radio,
+			.amux   = TV,
+			.gpio   = 0x0200000,
+		},
+	},
 };
 
 const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -4370,6 +4400,12 @@ struct pci_device_id saa7134_pci_tbl[] =
 		.subvendor    = 0x4e42,
 		.subdevice    = 0x3502,
 		.driver_data  = SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS
+	}, {
+		.vendor       = PCI_VENDOR_ID_PHILIPS,
+		.device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
+		.subvendor    = 0x1822, /*Twinhan Technology Co. Ltd*/
+		.subdevice    = 0x0022,
+		.driver_data  = SAA7134_BOARD_TWINHAN_DTV_DVB_3056
 	},{
 		/* --- boards without eeprom + subsystem ID --- */
 		.vendor       = PCI_VENDOR_ID_PHILIPS,
@@ -4782,6 +4818,7 @@ int saa7134_board_init2(struct saa7134_d
 	case SAA7134_BOARD_ASUSTeK_P7131_DUAL:
 	case SAA7134_BOARD_ASUSTeK_P7131_HYBRID_LNA:
 	case SAA7134_BOARD_MEDION_MD8800_QUADRO:
+	case SAA7134_BOARD_TWINHAN_DTV_DVB_3056:
 		/* this is a hybrid board, initialize to analog mode
 		 * and configure firmware eeprom address
 		 */
diff -r 27b2c6a80826 linux/drivers/media/video/saa7134/saa7134-dvb.c
--- a/linux/drivers/media/video/saa7134/saa7134-dvb.c	Fri Nov 30 18:27:26 2007 +0200
+++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c	Mon Dec 03 19:05:39 2007 +0100
@@ -778,6 +778,21 @@ static struct tda1004x_config avermedia_
 	.request_firmware = philips_tda1004x_request_firmware
 };
 
+static struct tda1004x_config twinhan_dtv_dvb_3056_config = {
+	.demod_address = 0x08,
+	.invert        = 1,
+	.invert_oclk   = 0,
+	.xtal_freq     = TDA10046_XTAL_16M,
+	.agc_config    = TDA10046_AGC_TDA827X,
+	.gpio_config   = TDA10046_GP01_I,
+	.if_freq       = TDA10046_FREQ_045,
+	.i2c_gate      = 0x42,
+	.tuner_address = 0x61,
+	.tuner_config  = 2,
+	.antenna_switch = 1,
+	.request_firmware = philips_tda1004x_request_firmware
+};
+
 /* ------------------------------------------------------------------
  * special case: this card uses saa713x GPIO22 for the mode switch
  */
@@ -1043,6 +1058,8 @@ static int dvb_init(struct saa7134_dev *
 	case SAA7134_BOARD_AVERMEDIA_SUPER_007:
 		configure_tda827x_fe(dev, &avermedia_super_007_config);
 		break;
+	case SAA7134_BOARD_TWINHAN_DTV_DVB_3056:
+		configure_tda827x_fe(dev, &twinhan_dtv_dvb_3056_config);
 	default:
 		wprintk("Huh? unknown DVB card?\n");
 		break;
diff -r 27b2c6a80826 linux/drivers/media/video/saa7134/saa7134.h
--- a/linux/drivers/media/video/saa7134/saa7134.h	Fri Nov 30 18:27:26 2007 +0200
+++ b/linux/drivers/media/video/saa7134/saa7134.h	Mon Dec 03 18:16:32 2007 +0100
@@ -247,6 +247,7 @@ struct saa7134_format {
 #define SAA7134_BOARD_SABRENT_TV_PCB05     115
 #define SAA7134_BOARD_10MOONSTVMASTER3     116
 #define SAA7134_BOARD_AVERMEDIA_SUPER_007  117
+#define SAA7134_BOARD_TWINHAN_DTV_DVB_3056 118
 
 #define SAA7134_MAXBOARDS 8
 #define SAA7134_INPUT_MAX 8




_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux