From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 216.14.233.220.exetel.com.au ([220.233.14.216] helo=mail.carbonaro.org) by www.linuxtv.org with esmtp (Exim 4.63) (envelope-from ) id 1KQL93-0001gA-MX for linux-dvb@linuxtv.org; Tue, 05 Aug 2008 13:56:08 +0200 Date: Tue, 5 Aug 2008 21:34:32 +1000 (EST) From: Mark Carbonaro To: stev391@email.com Message-ID: <4895080.81217937323843.JavaMail.mark@trogdor.carbonaro.org> In-Reply-To: <1292178.61217937203262.JavaMail.mark@trogdor.carbonaro.org> MIME-Version: 1.0 Cc: linux-dvb@linuxtv.org Subject: Re: [linux-dvb] [PATCH-TESTERS-REQUIRED] Leadtek Winfast PxDVR 3200 H - DVB Only support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0662701667==" Mime-version: 1.0 Sender: linux-dvb-bounces@linuxtv.org Errors-To: linux-dvb-bounces+mchehab=infradead.org@linuxtv.org List-ID: --===============0662701667== Content-Type: multipart/alternative; boundary="----=_Part_4_33079566.1217937323840" ------=_Part_4_33079566.1217937323840 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Fantastic, I will start testing it tonight and I will let you know how I get on. ----- Original Message ----- From: stev391@email.com To: "Mark Carbonaro" , "Jonathan Hummel" Cc: linux-dvb@linuxtv.org Sent: Monday, 4 August, 2008 9:34:06 PM (GMT+1000) Auto-Detected Subject: [PATCH-TESTERS-REQUIRED] Leadtek Winfast PxDVR 3200 H - DVB Only support Mark, Jon, Inline (and attached) below is a patch against Steven Toths cx2388s-sram branch, that enables DVB support on the Leadtek Winfast PxDVR 3200 H. The code is not exactly elegant at the moment, I'm waiting for Steven to refactor his callback code before I tidy this up, but at least you can take the dust off the card and use part of it. Let me know what issues you run into. (For example occasional on boot up, the card gets a subvendor id of 0000 and subproduct of 0000, this I have no idea why, but a soft restart makes it work). If anyone knows where to start with the Analog support please let me know... Regards, Stephen. ----------Patch----------- diff -Naur cx23885-sram/linux/Documentation/video4linux/CARDLIST.cx23885 cx23885-sram_dev/linux/Documentation/video4linux/CARDLIST.cx23885 --- cx23885-sram/linux/Documentation/video4linux/CARDLIST.cx23885 2008-08-04 20:29:16.000000000 +1000 +++ cx23885-sram_dev/linux/Documentation/video4linux/CARDLIST.cx23885 2008-08-04 20:50:15.000000000 +1000 @@ -9,3 +9,4 @@ 8 -> Hauppauge WinTV-HVR1700 & nbsp; [0070:8101] 9 -> Hauppauge WinTV-HVR1400 [0070:8010] 10 -> DViCO FusionHDTV7 Dual Express [18ac:d618] + 11 -> Leadtek Winfast PxDVR3200 H [107d:6681] diff -Naur cx23885-sram/linux/drivers/media/video/cx23885/cx23885-cards.c cx23885-sram_dev/linux/drivers/media/video/cx23885/cx23885-cards.c --- cx23885-sram/linux/drivers/media/video/cx23885/cx23885-cards.c 2008-08-04 20:29:17.000000000 +1000 +++ cx23885-sram_dev/linux/drivers/media/video/cx23885/cx23885-cards.c 2008-08-04 21:14:55.000000000 +1000 @@ -149,6 +149,11 @@ .portb = CX23885_MPEG_DVB, .portc = CX23885_MPEG_DVB, }, + [CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H] = { + .name = "Leadtek Winfast PxDVR3200 H", +// .portb = CX23885_MPEG_ENCODER, + .portc = CX23885_MPEG_DVB, + }, }; const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards); @@ -220,6 +225,10 @@ .subvendor = 0x18ac, .subdevice = 0xd618, .card = CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP, + },{ + .subvendor = 0x107d, + .subdevice = 0x6681, + .card = CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H, }, }; const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids); @@ -466,6 +475,17 @@ mdelay(20); cx_set(GP0_IO, 0x000f000f); break; + case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: + /* GPIO-2 xc3028 tuner reset */ + /* Put the parts into reset and back */ + cx_set(GP0_IO, 0x00040000); + mdelay(20); + cx_clear(GP0_IO, 0x00000004); + mdelay(20); + cx_set(GP0_IO, 0x00040004); +// mdelay(20); +// cx_write(GP0_IO, 0x00070404); + break; } } @@ -549,6 +569,7 @@ case CX23885_BOARD_HAUPPAUGE_HVR1200: case CX23885_BOARD_HAUPPAUGE_HVR1700: case CX23885_BOARD_HAUPPAUGE_HVR1400: + case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: default: ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ @@ -562,6 +583,7 @@ case CX23885_BOARD_HAUPPAUGE_HVR1800: case CX23885_BOARD_HAUPPAUGE_HVR1800lp: case CX23885_BOARD_HAUPPAUGE_HVR1700: + case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: request_module("cx25840"); break; } diff -Naur cx23885-sram/linux/drivers/media/video/cx23885/cx23885-dvb.c cx23885-sram_dev/linux/drivers/media/video/cx23885/cx23885-dvb.c --- cx23885-sram/linux/drivers/media/video/cx23885/cx23885-dvb.c 2008-08-04 20:29:17.000000000 +1000 +++ cx23885-sram_dev/linux/drivers/media/video/cx23885/cx23885-dvb.c 2008-08-04 20:48:07.000000000 +1000 @@ -36,6 +36,7 @@ #include "tda8290.h" #include "tda18271.h" #include "lgdt330x.h" +#include "zl10353.h" #include "xc5000.h" #include "tda10048.h" #include "tuner-xc2028.h" @@ -155,6 +156,40 @@ .serial_mpeg = 0x40, }; +static int cx23885_leadtek_xc2028_callback(void *ptr, int command, int arg) +{ + struct cx23885_tsport *port = ptr; + struct cx23885_dev *dev = port->dev; + u32 reset_mask = 0; + + switch (command) { + case XC2028_TUNER_RESET: + dprintk(1, "%s: XC2028_TUNER_RESET %d\n", __func__, + arg); + reset_mask = 0x00070404; + + cx_clear(GP0_IO, reset_mask); + mdelay(5); + cx_set(GP0_IO, reset_mask); + break; + case XC2028_RESET_CLK: + dprintk(1, "%s: XC2028_RESET_CLK %d\n", __func__, arg); + break; + default: + dprintk(1, "%s: unknown command %d, arg %d\n", __func__, + command, arg); + return -EINVAL; + } + + return 0; +} + +static struct zl10353_config dvico_fusionhdtv_xc3028 = { + .demod_address = 0x0f, + .if2 = 45600, + .no_tuner = 1, +}; + static struct s5h1409_config hauppauge_hvr1500q_config = { .demod_address = 0x32 >> 1, .output_mode = S5H1409_SERIAL_OUTPUT, @@ -481,6 +516,32 @@ &i2c_bus->i2c_adap, &dvico_xc5000_tunerconfig, i2c_bus); break; + case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: + i2c_bus = &dev->i2c_bus[0]; + + port->dvb.frontend = dvb_attach(zl10353_attach, + &dvico_fusionhdtv_xc3028, + &i2c_bus->i2c_adap); + if (port->dvb.frontend != NULL) { + struct dvb_frontend *fe; + struct xc2028_config cfg = { + .i2c_adap = &dev->i2c_bus[1].i2c_adap, + .i2c_addr = 0x61, + .video_dev = port, + .callback = cx23885_leadtek_xc2028_callback, + }; + static struct xc2028_ctrl ctl = { + .fname = "xc3028-v27.fw", + .max_len = 64, + .demod = XC3028_FE_ZARLINK456, + }; + + fe = dvb_attach(xc2028_attach, port->dvb.frontend, + &cfg); + if (fe != NULL && fe->ops.tuner_ops.set_config != NULL) + fe->ops.tuner_ops.set_config(fe, &ctl); + } + break; default: printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", dev->name); diff -Naur cx23885-sram/linux/drivers/media/video/cx23885/cx23885.h cx23885-sram_dev/linux/drivers/media/video/cx23885/cx23885.h --- cx23885-sram/linux/drivers/media/video/cx23885/cx23885.h 2008-08-04 20:29:17.000000000 +1000 +++ cx23885-sram_dev/linux/drivers/media/video/cx23885/cx23885.h 2008-08-04 20:48:39.000000000 +1000 @@ -67,6 +67,7 @@ #define CX23885_BOARD_HAUPPAUGE_HVR1700 8 #define CX23885_BOARD_HAUPPAUGE_HVR1400 9 #define CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP 10 +#define CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H 11 /* Currently unsupported by the driver: PAL/H, NTSC/Kr, SECAM B/G/H/LC */ #define CX23885_NORMS (\ diff -Naur cx23885-sram/linux/drivers/media/video/cx23885/Kconfig cx23885-sram_dev/linux/drivers/media/video/cx23885/Kconfig --- cx23885-sram/linux/drivers/media/video/cx23885/Kconfig 2008-08-04 20:29:17.000000000 +1000 +++ cx23885-sram_dev/linux/drivers/media/video/cx23885/Kconfig 2008-08-04 20:49:05.000000000 +1000 @@ -15,6 +15,7 @@ select MEDIA_TUNER_MT2131 if !DVB_FE_CUSTOMISE select DVB_S5H1409 if !DVB_FE_CUSTOMISE select DVB_LGDT330X if !DVB_FE_CUSTOMISE + select DVB_ZL10353 if !DVB_FE_CUSTOMISE select MEDIA_TUNER_XC2028 if !DVB_FE_CUSTOMIZE select MEDIA_TUNER_TDA8290 if !DVB_FE_CUSTOMIZE select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMIZE -- Be Yourself @ mail.com! Choose From 200+ Email Addresses Get a Free Account at www.mail.com ! ------=_Part_4_33079566.1217937323840 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <= div style=3D'font-family: Times New Roman; font-size: 12pt; color: #000000'= >Fantastic, I will start testing it tonight and I will let you know how I g= et on.

----- Original Message -----
From: stev391@email.com
To= : "Mark Carbonaro" <mark@carbonaro.org>, "Jonathan Hummel" <jhhumm= el@bigpond.com>
Cc: linux-dvb@linuxtv.org
Sent: Monday, 4 August, = 2008 9:34:06 PM (GMT+1000) Auto-Detected
Subject: [PATCH-TESTERS-REQUIRE= D] Leadtek Winfast PxDVR 3200 H - DVB Only support

Mark, Jon,

Inline (and attached) below is a patch against Steven Tot= hs cx2388s-sram branch, that enables DVB support on the Leadtek Winfast PxD= VR 3200 H.

The code is not exactly elegant at the moment, I'm waitin= g for Steven to refactor his callback code before I tidy this up, but at le= ast you can take the dust off the card and use part of it.

Let me kn= ow what issues you run into. (For example occasional on boot up, the card g= ets a subvendor id of 0000 and subproduct of 0000, this I have no idea why,= but a soft restart makes it work).

If anyone knows where to start w= ith the Analog support please let me know...

Regards,

Stephen= .

----------Patch-----------

diff -Naur cx23885-sram/linux/Do= cumentation/video4linux/CARDLIST.cx23885 cx23885-sram_dev/linux/Documentati= on/video4linux/CARDLIST.cx23885
--- cx23885-sram/linux/Documentation/vid= eo4linux/CARDLIST.cx23885    2008-08-04 20:29:16.000000000 += 1000
+++ cx23885-sram_dev/linux/Documentation/video4linux/CARDLIST.cx238= 85    2008-08-04 20:50:15.000000000 +1000
@@ -9,3 +9,4 @@=
   8 -> Hauppauge WinTV-HVR1700   & nbsp;           &nbs= p;             = [0070:8101]
   9 -> Hauppauge WinTV-HVR1400  &nbs= p;            &= nbsp;           &nbs= p; [0070:8010]
  10 -> DViCO FusionHDTV7 Dual Express  = ;            &n= bsp;       [18ac:d618]
+ 11 -> Leadtek = Winfast PxDVR3200 H           =    [107d:6681]
diff -Naur cx23885-sram/linux/drivers/media/vi= deo/cx23885/cx23885-cards.c cx23885-sram_dev/linux/drivers/media/video/cx23= 885/cx23885-cards.c
--- cx23885-sram/linux/drivers/media/video/cx23885/c= x23885-cards.c    2008-08-04 20:29:17.000000000 +1000
+++= cx23885-sram_dev/linux/drivers/media/video/cx23885/cx23885-cards.c &n= bsp;  2008-08-04 21:14:55.000000000 +1000
@@ -149,6 +149,11 @@
&= nbsp;        .portb     &= nbsp;  =3D CX23885_MPEG_DVB,
       &= nbsp; .portc        =3D CX23885_MPEG_DVB,
=      },
+    [CX23885_BOARD_LEADTEK_W= INFAST_PXDVR3200_H] =3D {
+        .name&n= bsp;       =3D "Leadtek Winfast PxDVR3200 H",
+= //        .portb     &nbs= p;  =3D CX23885_MPEG_ENCODER,
+       = ; .portc        =3D CX23885_MPEG_DVB,
+&nb= sp;   },
 };
 const unsigned int cx23885_bcount = =3D ARRAY_SIZE(cx23885_boards);
 
@@ -220,6 +225,10 @@
 =         .subvendor =3D 0x18ac,
  = ;       .subdevice =3D 0xd618,
  &nbs= p;      .card      =3D CX23885= _BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP,
+    },{
+ &n= bsp;      .subvendor =3D 0x107d,
+   =     .subdevice =3D 0x6681,
+     &nb= sp;  .card      =3D CX23885_BOARD_LEADTEK_WIN= FAST_PXDVR3200_H,
     },
 };
 const= unsigned int cx23885_idcount =3D ARRAY_SIZE(cx23885_subids);
@@ -466,6 = +475,17 @@
         mdelay(20);
&n= bsp;        cx_set(GP0_IO, 0x000f000f);
&n= bsp;        break;
+    cas= e CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H:
+     &= nbsp;  /* GPIO-2  xc3028 tuner reset */
+    &n= bsp;   /* Put the parts into reset and back */
+  &n= bsp;     cx_set(GP0_IO, 0x00040000);
+    =     mdelay(20);
+        cx= _clear(GP0_IO, 0x00000004);
+        mdela= y(20);
+        cx_set(GP0_IO, 0x00040004)= ;
+//        mdelay(20);
+//  = ;      cx_write(GP0_IO, 0x00070404);
+  &n= bsp;     break;
     }
 }
=  
@@ -549,6 +569,7 @@
     case CX23885_BOAR= D_HAUPPAUGE_HVR1200:
     case CX23885_BOARD_HAUPPAU= GE_HVR1700:
     case CX23885_BOARD_HAUPPAUGE_HVR140= 0:
+    case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H:     default:
       = ;  ts2->gen_ctrl_val  =3D 0xc; /* Serial bus + punctured clock= */
         ts2->ts_clk_en_val = =3D 0x1; /* Enable TS_CLK */
@@ -562,6 +583,7 @@
   &n= bsp; case CX23885_BOARD_HAUPPAUGE_HVR1800:
     case= CX23885_BOARD_HAUPPAUGE_HVR1800lp:
     case CX2388= 5_BOARD_HAUPPAUGE_HVR1700:
+    case CX23885_BOARD_LEADTE= K_WINFAST_PXDVR3200_H:
         reque= st_module("cx25840");
         break;=
     }
diff -Naur cx23885-sram/linux/drivers/med= ia/video/cx23885/cx23885-dvb.c cx23885-sram_dev/linux/drivers/media/video/c= x23885/cx23885-dvb.c
--- cx23885-sram/linux/drivers/media/video/cx23885/= cx23885-dvb.c    2008-08-04 20:29:17.000000000 +1000
+++ = cx23885-sram_dev/linux/drivers/media/video/cx23885/cx23885-dvb.c  = ;  2008-08-04 20:48:07.000000000 +1000
@@ -36,6 +36,7 @@
 #= include "tda8290.h"
 #include "tda18271.h"
 #include "lgdt3= 30x.h"
+#include "zl10353.h"
 #include "xc5000.h"
 #incl= ude "tda10048.h"
 #include "tuner-xc2028.h"
@@ -155,6 +156,40 @@=
     .serial_mpeg =3D 0x40,
 };
 +static int cx23885_leadtek_xc2028_callback(void *ptr, int command, int a= rg)
+{
+    struct cx23885_tsport *port =3D ptr;
+&= nbsp;   struct cx23885_dev *dev =3D port->dev;
+  = ;  u32 reset_mask =3D 0;
+
+    switch (command) = {
+    case XC2028_TUNER_RESET:
+    &n= bsp;   dprintk(1, "%s: XC2028_TUNER_RESET %d\n", __func__,
+&n= bsp;           arg);
+ &nbs= p;      reset_mask =3D 0x00070404;
+
+  = ;      cx_clear(GP0_IO, reset_mask);
+  &n= bsp;     mdelay(5);
+       = ; cx_set(GP0_IO, reset_mask);
+        bre= ak;
+    case XC2028_RESET_CLK:
+    &n= bsp;   dprintk(1, "%s: XC2028_RESET_CLK %d\n", __func__, arg);+        break;
+    defau= lt:
+        dprintk(1, "%s: unknown comma= nd %d, arg %d\n", __func__,
+         = ;      command, arg);
+     = ;   return -EINVAL;
+    }
+
+  = ;  return 0;
+}
+
+static struct zl10353_config dvico_fusionh= dtv_xc3028 =3D {
+    .demod_address =3D 0x0f,
+ =    .if2         &nbs= p; =3D 45600,
+    .no_tuner     = ; =3D 1,
+};
+
 static struct s5h1409_config hauppauge_hvr150= 0q_config =3D {
     .demod_address =3D 0x32 >>= ; 1,
     .output_mode   =3D S5H1409_SERIA= L_OUTPUT,
@@ -481,6 +516,32 @@
       &= nbsp;         &i2c_bus->i2c_adap,
&= nbsp;              &= nbsp; &dvico_xc5000_tunerconfig, i2c_bus);
     =     break;
+    case CX23885_BOARD_LEADTEK= _WINFAST_PXDVR3200_H:
+        i2c_bus =3D= &dev->i2c_bus[0];
+
+        po= rt->dvb.frontend =3D dvb_attach(zl10353_attach,
+    &= nbsp;               =        &dvico_fusionhdtv_xc3028,
+&nbs= p;               &nb= sp;          &i2c_bus->i2c_a= dap);
+        if (port->dvb.frontend != =3D NULL) {
+            st= ruct dvb_frontend      *fe;
+   =         struct xc2028_config  &nbs= p;   cfg =3D {
+          &= nbsp;     .i2c_adap  =3D &dev->i2c_bus[1].i2c_ad= ap,
+             &nbs= p;  .i2c_addr  =3D 0x61,
+       = ;         .video_dev =3D port,
+ &nbs= p;              .callback=   =3D cx23885_leadtek_xc2028_callback,
+     &n= bsp;      };
+        =     static struct xc2028_ctrl ctl =3D {
+  &nbs= p;             .fname &nb= sp;     =3D "xc3028-v27.fw",
+    &nb= sp;           .max_len  &= nbsp;  =3D 64,
+          &= nbsp;     .demod       =3D XC3= 028_FE_ZARLINK456,
+          &n= bsp; };
+
+            f= e =3D dvb_attach(xc2028_attach, port->dvb.frontend,
+  &nbs= p;               &nb= sp; &cfg);
+           = if (fe !=3D NULL && fe->ops.tuner_ops.set_config !=3D NULL)
= +               = ; fe->ops.tuner_ops.set_config(fe, &ctl);
+    &nb= sp;   }
+        break;
 = ;    default:
        = printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n",
=               &= nbsp; dev->name);
diff -Naur cx23885-sram/linux/drivers/media/video/c= x23885/cx23885.h cx23885-sram_dev/linux/drivers/media/video/cx23885/cx23885= .h
--- cx23885-sram/linux/drivers/media/video/cx23885/cx23885.h &nb= sp;  2008-08-04 20:29:17.000000000 +1000
+++ cx23885-sram_dev/linux= /drivers/media/video/cx23885/cx23885.h    2008-08-04 20:48:3= 9.000000000 +1000
@@ -67,6 +67,7 @@
 #define CX23885_BOARD_HAUPP= AUGE_HVR1700        8
 #define C= X23885_BOARD_HAUPPAUGE_HVR1400        9<= br> #define CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP 10
+#define C= X23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H 11
 
 /* Currently= unsupported by the driver: PAL/H, NTSC/Kr, SECAM B/G/H/LC */
 #def= ine CX23885_NORMS (\
diff -Naur cx23885-sram/linux/drivers/media/video/c= x23885/Kconfig cx23885-sram_dev/linux/drivers/media/video/cx23885/Kconfig--- cx23885-sram/linux/drivers/media/video/cx23885/Kconfig  &nb= sp; 2008-08-04 20:29:17.000000000 +1000
+++ cx23885-sram_dev/linux/drive= rs/media/video/cx23885/Kconfig    2008-08-04 20:49:05.000000= 000 +1000
@@ -15,6 +15,7 @@
     select MEDIA_TUN= ER_MT2131 if !DVB_FE_CUSTOMISE
     select DVB_S5H14= 09 if !DVB_FE_CUSTOMISE
     select DVB_LGDT330X if = !DVB_FE_CUSTOMISE
+     select DVB_ZL10353 if !DVB_FE_CUS= TOMISE
     select MEDIA_TUNER_XC2028 if !DVB_FE_CUS= TOMIZE
     select MEDIA_TUNER_TDA8290 if !DVB_FE_CU= STOMIZE
     select MEDIA_TUNER_TDA18271 if !DVB_FE_= CUSTOMIZE

--=20
Be Yourself @ mail.com!
Choose From 200+ Email Addresses
Get a Free Account at www.mail.com!
------=_Part_4_33079566.1217937323840-- --===============0662701667== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-dvb mailing list linux-dvb@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb --===============0662701667==--