Hi, the v4l-dvb-experimental tree on mcentral.de isn't supposed to support cx88/saa7134/xceive based devices, it's only focussed on Empia based products before the development got split out to em28xx-new. This was just a sideeffect since those devices also used the available xceive driver back then. Please apply your patch against the linuxtv.org code. this will save you from incompatibility issues. The v4l-dvb-experimental code hasn't got updated for a very long time and lacks alot features now. thanks, Markus ---------- Forwarded message ---------- From: sustmi sustmi <sustmi@xxxxxxxxx> Date: 2008/9/24 Subject: Re: patch for support Leadtek Winfast DTV1800H To: mrechberger@xxxxxxxxx (sending this message again from other address due to possible spam-filter) Hi, It is several months I send you my patch and it hasn't been merged into repository yet. Are there any problems with merging or do you manage the v4l-dvb-kernel repository any more? I'm also sending you a patch for kernel-2.6.24-git9 and later which lacks 'usage_count' in 'struct i2c_client'. (Do the older kernels need it?) I look forward to your reply. ______________________________________________________________ > Od: mrechberger@xxxxxxxxx > Komu: sustmi sustmi <sustmi@xxxxxxxxx> > Datum: 10.03.2008 18:49 > Předmět: Re: patch for support Leadtek Winfast DTV1800H > Hi, I received this one I'll go through it during the next few days! thanks for the patch! Markus 2008/3/10 sustmi sustmi <sustmi@xxxxxxxxx>: > Hello, > I am sorry if I buging you, but I don't know if the previous message was delivered well (it could be marked as spam). > There were several patches commited to repository since I sent the original message. > If you already read it, please excuse my obtrusiveness. > > ---------- > MESSAGE SENT ON: 24.2.2008 23:22 > ---------- > Hello, > > This patch enables support for both analog and dvb for Leadtek Winfast DTV1800H. > The sound in analog mode can by played through sox or via connector on card's PCB. > > The patch is made against the v4l-dvb-kernel revision 55d60e988b89 (see the third problem). > It also contains some chnges in "global" cx88 code, which you maybe won't like. > > > The first problem - ioctl and callback: > > In the tuner-core.c there is "default" v4l_dvb_tuner_ioctl which calls the tuner_callback(algo_data, ...). > Then the cx88_xc3028_control (registered as tuner_callback) gets the cx88_core pointer as priv->data (where priv is algo_data). > > In the cx88-dvb.c there is another v4l_dvb_tuner_ioctl which calls callback(ops->dev, ...). > Here the cx88_xc3028_control (registered as callback) can't get the cx88_core pointer as priv->data, because priv _is_ the pointer on cx88_core (ops->dev). > > This caused kernel faults to me, so I rewrote the v4l_dvb_tuner_ioctl function to call the callback function with the algo_data parameter (like in tuner_core.c). > > > The second problem - TUNER_RESET3: > > I have two dvb-t devices which uses the XC3028 tuner. The first is Leadtek Winfast DTV1800H and the second is Avermedia M115 (in laptop). > Both these cards don't like the resetting the XC3028 by GPIO in TUNER_RESET3. It somehow breaks the proper loading of dvb firmware. > Maybe the other cards with XC3028 needs it, but my experience is not to do the reset by GPIO. > > > The third problem - "Build issues 2.6.24.2 patch received from Matt Adams" = rev. 6c81945e4403 > > This changes probably enables support for kernel-2.6.24.2, but my gentoo-2.6.22-r9 can't load the video-buf module because of the lack of the sg_set_page. > > > The last problem: > > My English s*cks. :p > > > That's all folks. > Thank you in advance for your reply and opinions. > > ---------- > Miroslav Šustek, sustmidown@xxxxxxxxxx
diff -r 55d60e988b89 linux/drivers/media/video/cx88/cx88-cards.c --- a/linux/drivers/media/video/cx88/cx88-cards.c Fri Oct 12 01:03:30 2007 +0200 +++ b/linux/drivers/media/video/cx88/cx88-cards.c Sun Feb 24 22:07:35 2008 +0100 @@ -1549,6 +1549,36 @@ struct cx88_board cx88_boards[] = { .gpio0 = 0x07fa, }}, }, + [CX88_BOARD_WINFAST_DTV1800H] = { + .name = "LeadTek Winfast DTV1800 Hybrid", + .tuner_type = TUNER_XCEIVE_XC3028, + .radio_type = TUNER_XCEIVE_XC3028, + .tuner_addr = 0x61, + .radio_addr = 0x61, + .input = {{ + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x0400, //pin 2:mute = 0 (off) + .gpio1 = 0x6040, //pin 13:audio = 0 (tuner), pin 14:FM = 1 (off?) + .gpio2 = 0x0000, + },{ + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x0400, //pin 2:mute = 0 (off) + .gpio1 = 0x6060, //pin 13:audio = 1 (line), pin 14:FM = 1 (off?) + .gpio2 = 0x0000, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + }}, + .radio = { + .type = CX88_RADIO, + .gpio0 = 0x0400, //pin 2:mute = 0 (off) + .gpio1 = 0x6000, //pin 13:audio = 0? (tuner), pin 14:FM = 0? (on?) + .gpio2 = 0x0000, + }, + .mpeg = CX88_MPEG_DVB, + }, }; const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); @@ -1868,6 +1898,10 @@ struct cx88_subid cx88_subids[] = { .subdevice = 0x6f18, .card = CX88_BOARD_WINFAST_TV2000_XP_GLOBAL, },{ + .subvendor = 0x107d, + .subdevice = 0x6654, + .card = CX88_BOARD_WINFAST_DTV1800H, + },{ .subvendor = 0x14f1, .subdevice = 0x8852, .card = CX88_BOARD_GENIATECH_X8000_MT, @@ -2087,6 +2121,14 @@ void cx88_card_setup_pre_i2c(struct cx88 cx_set(MO_GP0_IO, 0x00000080); /* 702 out of reset */ udelay(1000); break; + case CX88_BOARD_WINFAST_DTV1800H: + cx_write(MO_GP1_IO, 0x101010); //gpio 12 = 1: powerup XC3028 + mdelay(250); + cx_write(MO_GP1_IO, 0x101000); //gpio 12 = 0: powerdown XC3028 + mdelay(250); + cx_write(MO_GP1_IO, 0x101010); //gpio 12 = 1: powerup XC3028 + mdelay(250); + break; } } diff -r 55d60e988b89 linux/drivers/media/video/cx88/cx88-dvb.c --- a/linux/drivers/media/video/cx88/cx88-dvb.c Fri Oct 12 01:03:30 2007 +0200 +++ b/linux/drivers/media/video/cx88/cx88-dvb.c Sun Feb 24 22:07:35 2008 +0100 @@ -314,6 +314,12 @@ static struct zl10353_config cx88_geniat .r5c_clk_mpegts_output = 0x75, }; +static struct zl10353_config cx88_winfast_dtv1800h = { + .demod_address = (0x1e >> 1), + .no_tuner = 1, + .input_frequency = 0xe609, +}; + static int nxt200x_set_ts_param(struct dvb_frontend* fe, int is_punctured) { struct cx8802_dev *dev= fe->dvb->priv; @@ -386,7 +392,9 @@ static struct xc3028_config geniatech_x8 static int v4l_dvb_tuner_ioctl(struct v4l_dvb_tuner_ops *ops, int cmd, int arg) { - return ((struct cx88_core*)(ops->dev))->callback(ops->dev, cmd, arg); + struct cx88_core *core = ops->dev; + + return core->callback(core->i2c_adap.algo_data, cmd, arg); } @@ -421,6 +429,19 @@ static int dvb_register(struct cx8802_de dvb_attach(dvb_pll_attach, &dev->dvb.frontend->ops.tuner_ops, 0x60, &dev->core->i2c_adap, &dvb_pll_thomson_dtt7579); + } + break; + case CX88_BOARD_WINFAST_DTV1800H: + dev->dvb.frontend = dvb_attach(zl10353_attach, &cx88_winfast_dtv1800h, &dev->core->i2c_adap); + if (dev->dvb.frontend != NULL) { + dev->dvb.frontend->ops.tuner_ops.fe = dev->dvb.frontend; + + dev->dvb.frontend->ops.tuner_ops.ioctl = v4l_dvb_tuner_ioctl; + dev->dvb.frontend->ops.tuner_ops.dev = dev->core; + dev->dvb.frontend->ops.i2c_gate_ctrl = NULL; + dev->dvb.frontend->ops.sleep = NULL; + + dvb_attach(xc3028_attach, &dev->dvb.frontend->ops.tuner_ops, &dev->core->i2c_adap, &dev->core->xc3028conf); } break; case CX88_BOARD_WINFAST_DTV2000H: diff -r 55d60e988b89 linux/drivers/media/video/cx88/cx88-i2c.c --- a/linux/drivers/media/video/cx88/cx88-i2c.c Fri Oct 12 01:03:30 2007 +0200 +++ b/linux/drivers/media/video/cx88/cx88-i2c.c Sun Feb 24 22:07:35 2008 +0100 @@ -199,7 +199,7 @@ static int cx88_xc3028_control(void *pri switch (command) { case TUNER_RESET1: case TUNER_RESET2: - case TUNER_RESET3: +// case TUNER_RESET3: switch (mode) { case V4L2_INT_TUNER_RADIO: printk("Switching to radio!\n"); @@ -291,6 +291,7 @@ static int attach_inform(struct i2c_clie case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL: case CX88_BOARD_PINNACLE_HYBRID_PCTV: + case CX88_BOARD_WINFAST_DTV1800H: /* tun_setup.tuner_mode = TODO */ tun_setup.tuner_mode = &core->mode; tun_setup.tuner_callback = core->callback = cx88_xc3028_control; @@ -311,9 +312,10 @@ static int attach_inform(struct i2c_clie case CX88_BOARD_POWERCOLOR_REAL_ANGEL: case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL: case CX88_BOARD_PINNACLE_HYBRID_PCTV: + case CX88_BOARD_WINFAST_DTV1800H: /* tun_setup.tuner_mode = TODO */ tun_setup.tuner_mode = &core->mode; - tun_setup.tuner_callback = cx88_xc3028_control; + tun_setup.tuner_callback = core->callback = cx88_xc3028_control; break; } diff -r 55d60e988b89 linux/drivers/media/video/cx88/cx88.h --- a/linux/drivers/media/video/cx88/cx88.h Fri Oct 12 01:03:30 2007 +0200 +++ b/linux/drivers/media/video/cx88/cx88.h Sun Feb 24 22:07:35 2008 +0100 @@ -219,6 +219,7 @@ extern struct sram_channel cx88_sram_cha #define CX88_BOARD_POWERCOLOR_REAL_ANGEL 60 #define CX88_BOARD_GENIATECH_X8000_MT 61 #define CX88_BOARD_PIXELVIEW_PLAYTV_MPEG 62 +#define CX88_BOARD_WINFAST_DTV1800H 63 enum cx88_itype { CX88_VMUX_COMPOSITE1 = 1,
diff -r cd030297f684 linux/drivers/media/video/bt866.c --- a/linux/drivers/media/video/bt866.c Fri May 02 16:53:52 2008 +0200 +++ b/linux/drivers/media/video/bt866.c Sat Sep 13 14:18:18 2008 +0200 @@ -301,7 +301,6 @@ .addr = 0, .adapter = NULL, .driver = &i2c_driver_bt866, - .usage_count = 0 }; static int bt866_found_proc(struct i2c_adapter *adapter, diff -r cd030297f684 linux/drivers/media/video/ks0127.c --- a/linux/drivers/media/video/ks0127.c Fri May 02 16:53:52 2008 +0200 +++ b/linux/drivers/media/video/ks0127.c Sat Sep 13 14:18:18 2008 +0200 @@ -764,7 +764,6 @@ .addr = 0, .adapter = NULL, .driver = &i2c_driver_ks0127, - .usage_count = 0 }; static int ks0127_found_proc(struct i2c_adapter *adapter, int addr, int kind)
_______________________________________________ linux-dvb mailing list linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb