From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp2.aster.pl ([212.76.33.47]) by www.linuxtv.org with esmtp (Exim 4.63) (envelope-from ) id 1LCLtX-0002sA-CX for linux-dvb@linuxtv.org; Mon, 15 Dec 2008 23:26:40 +0100 From: "Daniel Perzynski" To: Date: Mon, 15 Dec 2008 23:25:43 +0100 Message-ID: <000901c95f04$11bda940$3538fbc0$@Perzynski@aster.pl> MIME-Version: 1.0 Content-Language: en-us Subject: Re: [linux-dvb] Avermedia A312 - patch for review List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1946524532==" Mime-version: 1.0 Sender: linux-dvb-bounces@linuxtv.org Errors-To: linux-dvb-bounces+mchehab=infradead.org@linuxtv.org List-ID: This is a multipart message in MIME format. --===============1946524532== Content-Type: multipart/alternative; boundary="----=_NextPart_000_000A_01C95F0C.73821140" Content-Language: en-us This is a multipart message in MIME format. ------=_NextPart_000_000A_01C95F0C.73821140 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, According to the suggestions I've modified dvb-usb-ids.h and cxusb.c to add a support for that card. I would appreciate someone to look at the code below and compare it with spec on the wiki for that card. --- ala/v4l-dvb/linux/drivers/media/dvb/dvb-usb/dvb-usb-ids.h 2008-12-14 23:11:28.000000000 +0100 +++ v4l-dvb/linux/drivers/media/dvb/dvb-usb/dvb-usb-ids.h 2008-12-14 22:08:17.000000000 +0100 @@ -234,5 +234,5 @@ #define USB_PID_XTENSIONS_XD_380 0x0381 #define USB_PID_TELESTAR_STARSTICK_2 0x8000 #define USB_PID_MSI_DIGI_VOX_MINI_III 0x8807 - +#define USB_PID_AVERMEDIA_A312 0xa312 #endif --- ala/v4l-dvb/linux/drivers/media/dvb/dvb-usb/cxusb.c 2008-12-14 23:11:28.000000000 +0100 +++ v4l-dvb/linux/drivers/media/dvb/dvb-usb/cxusb.c 2008-12-14 22:43:33.000000000 +0100 @@ -1224,6 +1224,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_nano2_properties; static struct dvb_usb_device_properties cxusb_bluebird_nano2_needsfirmware_properties; static struct dvb_usb_device_properties cxusb_aver_a868r_properties; +static struct dvb_usb_device_properties cxusb_aver_a312_properties; + static struct dvb_usb_device_properties cxusb_d680_dmb_properties; static int cxusb_probe(struct usb_interface *intf, @@ -1248,6 +1250,8 @@ THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &cxusb_aver_a868r_properties, THIS_MODULE, NULL, adapter_nr) || + 0 == dvb_usb_device_init(intf, &cxusb_aver_a312_properties, + THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dualdig4_rev2_properties, THIS_MODULE, NULL, adapter_nr) || @@ -1277,6 +1281,7 @@ { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2) }, { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2_NFW_WARM) }, { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_A868R) }, + { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_A312) }, { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_4_REV_2) }, { USB_DEVICE(USB_VID_CONEXANT, USB_PID_CONEXANT_D680_DMB) }, {} /* Terminating entry */ @@ -1724,6 +1729,48 @@ } }; +static struct dvb_usb_device_properties cxusb_aver_a312_properties = { + .caps = DVB_USB_IS_AN_I2C_ADAPTER, + + .usb_ctrl = CYPRESS_FX2, + + .size_of_priv = sizeof(struct cxusb_state), + + .num_adapters = 1, + .adapter = { + { + .streaming_ctrl = cxusb_aver_streaming_ctrl, + .frontend_attach = cxusb_aver_lgdt3303_frontend_attach, + .tuner_attach = cxusb_dvico_xc3028_tuner_attach, + /* parameter for the MPEG2-data transfer */ + .stream = { + .type = USB_BULK, + .count = 5, + .endpoint = 0x04, + .u = { + .bulk = { + .buffersize = 8192, + } + } + }, + + }, + }, + .power_ctrl = cxusb_aver_power_ctrl, + + .i2c_algo = &cxusb_i2c_algo, + + .generic_bulk_ctrl_endpoint = 0x01, + + .num_device_descs = 1, + .devices = { + { "AVerMedia AVerTVHD (A312)", + { NULL }, + { &cxusb_table[17], NULL }, + }, + } +}; + static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_rev2_properties = { .caps = DVB_USB_IS_AN_I2C_ADAPTER, After modprobing cxusb driver I have: vb-usb: found a 'AVerMedia AVerTVHD (A312)' in warm state. dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. DVB: registering new adapter (AVerMedia AVerTVHD (A312)) DVB: registering adapter 0 frontend 0 (LG Electronics LGDT3303 VSB/QAM Frontend)... xc2028 4-0061: creating new instance xc2028 4-0061: type set to XCeive xc2028/xc3028 tuner dvb-usb: AVerMedia AVerTVHD (A312) successfully initialized and connected. usbcore: registered new interface driver dvb_usb_cxusb h3xu5 v4l-dvb # ls -laR /dev/dvb/ /dev/dvb/: total 0 drwxr-xr-x 3 root root 60 Dec 14 23:06 . drwxr-xr-x 15 root root 4640 Dec 14 23:06 .. drwxr-xr-x 2 root root 120 Dec 14 23:06 adapter0 /dev/dvb/adapter0: total 0 drwxr-xr-x 2 root root 120 Dec 14 23:06 . drwxr-xr-x 3 root root 60 Dec 14 23:06 .. crw-rw---- 1 root video 212, 0 Dec 14 23:06 demux0 crw-rw---- 1 root video 212, 1 Dec 14 23:06 dvr0 crw-rw---- 1 root video 212, 3 Dec 14 23:06 frontend0 crw-rw---- 1 root video 212, 2 Dec 14 23:06 net0 The question is if it is ok or maybe something is missing here and what should be next steps. Regards, ------=_NextPart_000_000A_01C95F0C.73821140 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

According to the suggestions I’ve modified = dvb-usb-ids.h and cxusb.c to add a support for that card.

 

I would appreciate someone to look at the code = below and compare it with spec on the wiki for that card.

 

--- ala/v4l-dvb/linux/drivers/media/dvb/dvb-usb/dvb-usb-ids.h  &nbs= p;            = 2008-12-14 23:11:28.000000000 +0100

+++ = v4l-dvb/linux/drivers/media/dvb/dvb-usb/dvb-usb-ids.h   = 2008-12-14 22:08:17.000000000 +0100

@@ -234,5 +234,5 @@

 #define = USB_PID_XTENSIONS_XD_380        &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   0x0381

 #define = USB_PID_TELESTAR_STARSTICK_2       &nb= sp;           &nbs= p;            = ;         0x8000

 #define = USB_PID_MSI_DIGI_VOX_MINI_III       &n= bsp;           0x8807

-

+#define = USB_PID_AVERMEDIA_A312        &nb= sp;           &nbs= p;     0xa312

 #endif

--- = ala/v4l-dvb/linux/drivers/media/dvb/dvb-usb/cxusb.c   &nbs= p;        2008-12-14 23:11:28.000000000 +0100

+++ = v4l-dvb/linux/drivers/media/dvb/dvb-usb/cxusb.c    &n= bsp;           = 2008-12-14 22:43:33.000000000 +0100

@@ -1224,6 +1224,8 @@

 static struct dvb_usb_device_properties cxusb_bluebird_nano2_properties;

 static struct dvb_usb_device_properties cxusb_bluebird_nano2_needsfirmware_properties;

 static struct dvb_usb_device_properties cxusb_aver_a868r_properties;

+static struct dvb_usb_device_properties cxusb_aver_a312_properties;

+

 static struct dvb_usb_device_properties cxusb_d680_dmb_properties;

 

 static int cxusb_probe(struct usb_interface = *intf,

@@ -1248,6 +1250,8 @@

         &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;           THIS_MODULE, NULL, adapter_nr) ||

         &= nbsp;          0 =3D=3D = dvb_usb_device_init(intf, &cxusb_aver_a868r_properties,

         &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;           THIS_MODULE, NULL, adapter_nr) ||

+         =         0 =3D=3D dvb_usb_device_init(intf, &cxusb_aver_a312_properties,

+         =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;        THIS_MODULE, NULL, adapter_nr) ||

         &= nbsp;          0 =3D=3D = dvb_usb_device_init(intf,

         &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;           &cxusb_bluebird_dualdig4_rev2_properties,

         &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;           THIS_MODULE, NULL, adapter_nr) ||

@@ -1277,6 +1281,7 @@

         &= nbsp;      { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2) },

         &= nbsp;      { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2_NFW_WARM) },

         &= nbsp;      { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_A868R) },

+         =     { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_A312) },

         &= nbsp;      { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_4_REV_2) },

         &= nbsp;      { USB_DEVICE(USB_VID_CONEXANT, USB_PID_CONEXANT_D680_DMB) },

         &= nbsp;      = {}            = ;            =      /* Terminating entry */

@@ -1724,6 +1729,48 @@

         &= nbsp;      }

 };

 

+static struct dvb_usb_device_properties cxusb_aver_a312_properties =3D {

+         =     .caps =3D DVB_USB_IS_AN_I2C_ADAPTER,

+

+         =     = .usb_ctrl         =3D = CYPRESS_FX2,

+

+         =     .size_of_priv     =3D = sizeof(struct cxusb_state),

+

+         =     .num_adapters =3D 1,

+         =     .adapter =3D {

+         =             &= nbsp;       {

+         =             &= nbsp;           &n= bsp;           = .streaming_ctrl   =3D cxusb_aver_streaming_ctrl,

+         =             &= nbsp;           &n= bsp;           = .frontend_attach  =3D cxusb_aver_lgdt3303_frontend_attach,

+         =             &= nbsp;           &n= bsp;           = .tuner_attach     =3D cxusb_dvico_xc3028_tuner_attach,

+         =             &= nbsp;           &n= bsp;           /* = parameter for the MPEG2-data transfer */

+         =             &= nbsp;           &n= bsp;           .stream = =3D {

+         =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   .type =3D USB_BULK,

+         =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   .count =3D 5,

+         =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   .endpoint =3D 0x04,

+         =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   .u =3D {

+         =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;       .bulk =3D {

+         =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;            =            .buffersize =3D 8192,

+         =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;       }

+         =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   }

+         =             &= nbsp;           &n= bsp;           = },

+

+         =             &= nbsp;       },

+         =     },

+         =     .power_ctrl       =3D = cxusb_aver_power_ctrl,

+

+          &n= bsp;  .i2c_algo         =3D &cxusb_i2c_algo,

+

+         =     .generic_bulk_ctrl_endpoint =3D 0x01,

+

+         =     .num_device_descs =3D 1,

+         =     .devices =3D {

+         =             &= nbsp;       {   "AVerMedia = AVerTVHD (A312)",

+         =             &= nbsp;           &n= bsp;           { NULL = },

+         =             &= nbsp;           &n= bsp;           { &cxusb_table[17], NULL },

+         =             &= nbsp;       },

+         =     }

+};

+

 static

 struct dvb_usb_device_properties cxusb_bluebird_dualdig4_rev2_properties =3D {

         &= nbsp;      .caps =3D = DVB_USB_IS_AN_I2C_ADAPTER,

 

After modprobing cxusb driver I = have:

 

vb-usb: found a 'AVerMedia AVerTVHD (A312)' in warm = state.

dvb-usb: will pass the complete MPEG2 transport = stream to the software demuxer.

DVB: registering new adapter (AVerMedia AVerTVHD = (A312))

DVB: registering adapter 0 frontend 0 (LG = Electronics LGDT3303 VSB/QAM Frontend)...

xc2028 4-0061: creating new instance

xc2028 4-0061: type set to XCeive xc2028/xc3028 = tuner

dvb-usb: AVerMedia AVerTVHD (A312) successfully = initialized and connected.

usbcore: registered new interface driver = dvb_usb_cxusb

 

h3xu5 v4l-dvb # ls -laR /dev/dvb/

/dev/dvb/:

total 0

drwxr-xr-x  3 root root   60 Dec 14 = 23:06 .

drwxr-xr-x 15 root root 4640 Dec 14 23:06 = ..

drwxr-xr-x  2 root root  120 Dec 14 23:06 = adapter0

 

/dev/dvb/adapter0:

total 0

drwxr-xr-x 2 root root     120 = Dec 14 23:06 .

drwxr-xr-x 3 root = root      60 Dec 14 23:06 ..

crw-rw---- 1 root video 212, 0 Dec 14 23:06 = demux0

crw-rw---- 1 root video 212, 1 Dec 14 23:06 = dvr0

crw-rw---- 1 root video 212, 3 Dec 14 23:06 = frontend0

crw-rw---- 1 root video 212, 2 Dec 14 23:06 = net0

 

The question is if it is ok or maybe something is = missing here and what should be next steps.

 

Regards,

 

------=_NextPart_000_000A_01C95F0C.73821140-- --===============1946524532== 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 --===============1946524532==--