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

sioux sioux_it at libero.it
Sun Dec 2 01:08:18 CET 2007


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:

sioux at 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
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- 
ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- 
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 32 (21000ns min, 8000ns max)
        Interrupt: pin A routed to IRQ 21
        Region 0: Memory at ed000000 (32-bit, non-prefetchable) [size=2K]
        Capabilities: [40] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA 
PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=1 PME-
00: 31 11 33 71 06 00 90 02 d1 00 80 04 00 20 00 00
10: 00 00 00 ed 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 22 18 22 00
30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 01 54 20
40: 01 00 02 06 00 20 00 1c 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


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]

_____________________________________________________


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 at not-available.sorry> :-) */
        .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,
        },
    },

.......

        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)) {
            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;
            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.

So:

sudo modprobe saa7134 card=118

it's ok and than all works fine.

______________________________________________

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 at not-available.sorry> :-) */
    .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
};

____________________________________


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 at 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 at 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!

Thank You.

Sioux.











More information about the linux-dvb mailing list