Return-path: Received: from mail.tu-berlin.de ([130.149.7.33]) by mail.linuxtv.org with esmtp (Exim 4.69) (envelope-from <123kash@gmail.com>) id 1NZKpm-0007qt-Er for linux-dvb@linuxtv.org; Mon, 25 Jan 2010 10:02:11 +0100 Received: from mail-bw0-f214.google.com ([209.85.218.214]) by mail.tu-berlin.de (exim-4.69/mailfrontend-c) with esmtp for id 1NZKpl-0002Pr-Pb; Mon, 25 Jan 2010 10:02:10 +0100 Received: by bwz6 with SMTP id 6so2457774bwz.11 for ; Mon, 25 Jan 2010 01:02:08 -0800 (PST) MIME-Version: 1.0 Date: Mon, 25 Jan 2010 12:02:08 +0300 Message-ID: From: Sergey Ivanov <123kash@gmail.com> To: linux-dvb@linuxtv.org Subject: [linux-dvb] Twinhan 1027 (once again) Reply-To: linux-media@vger.kernel.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0537407733==" Mime-version: 1.0 Sender: linux-dvb-bounces@linuxtv.org Errors-To: linux-dvb-bounces+mchehab=infradead.org@linuxtv.org List-ID: --===============0537407733== Content-Type: multipart/alternative; boundary=00032555415a934489047df96c44 --00032555415a934489047df96c44 Content-Type: text/plain; charset=ISO-8859-1 When v4l-dvb starts to support this card? You already have well tested patch for this purpose. But it still "experimental". I had one doubt, i'm not sure if we need all of those chips, that patch contain, cos this card has only cx88x & mb86a16, so i exclude em, and it looks work. diff -r 2a50a0a1c951 linux/drivers/media/video/cx88/cx88-cards.c --- a/linux/drivers/media/video/cx88/cx88-cards.c Sat Jan 23 00:14:32 2010 -0200 +++ b/linux/drivers/media/video/cx88/cx88-cards.c Sun Jan 24 15:04:25 2010 +0300 @@ -2120,6 +2120,18 @@ } }, .mpeg = CX88_MPEG_DVB, }, + [CX88_BOARD_TWINHAN_VP1027_DVBS] = { + .name = "Twinhan VP-1027 DVB-S", + .tuner_type = TUNER_ABSENT, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .input = {{ + .type = CX88_VMUX_DVB, + .vmux = 0, + } }, + .mpeg = CX88_MPEG_DVB, + }, }; /* ------------------------------------------------------------------ */ @@ -2584,6 +2596,10 @@ .subvendor = 0xb034, .subdevice = 0x3034, .card = CX88_BOARD_PROF_7301, + }, { + .subvendor = 0x1822, + .subdevice = 0x0023, + .card = CX88_BOARD_TWINHAN_VP1027_DVBS, }, }; @@ -3075,6 +3091,13 @@ cx_set(MO_GP1_IO, 0x10); mdelay(50); break; + + case CX88_BOARD_TWINHAN_VP1027_DVBS: + cx_write(MO_GP0_IO, 0x00003230); + cx_write(MO_GP0_IO, 0x00003210); + msleep(1); + cx_write(MO_GP0_IO, 0x00001230); + break; } } diff -r 2a50a0a1c951 linux/drivers/media/video/cx88/cx88-dvb.c --- a/linux/drivers/media/video/cx88/cx88-dvb.c Sat Jan 23 00:14:32 2010 -0200 +++ b/linux/drivers/media/video/cx88/cx88-dvb.c Sun Jan 24 15:04:25 2010 +0300 @@ -57,6 +57,7 @@ #include "stv0900.h" #include "stb6100.h" #include "stb6100_proc.h" +#include "mb86a16.h" MODULE_DESCRIPTION("driver for cx2388x based DVB cards"); MODULE_AUTHOR("Chris Pascoe "); @@ -251,6 +252,10 @@ .if2 = 45600, }; +static struct mb86a16_config twinhan_vp1027 = { + .demod_address = 0x08, +}; + #if defined(CONFIG_VIDEO_CX88_VP3054) || (defined(CONFIG_VIDEO_CX88_VP3054_MODULE) && defined(MODULE)) static int dntv_live_dvbt_pro_demod_init(struct dvb_frontend* fe) { @@ -446,6 +451,30 @@ return 0; } +static int vp1027_set_voltage(struct dvb_frontend *fe, + fe_sec_voltage_t voltage) +{ + struct cx8802_dev *dev = fe->dvb->priv; + struct cx88_core *core = dev->core; + switch (voltage) { + case SEC_VOLTAGE_OFF: + dprintk(1, "LNB Voltage OFF\n"); + cx_write(MO_GP0_IO, 0x00001230); + break; + case SEC_VOLTAGE_13: + dprintk(1, "LNB SEC Voltage=13\n"); + cx_write(MO_GP0_IO, 0x00001220); + break; + case SEC_VOLTAGE_18: + dprintk(1, "LNB SEC Voltage=18\n"); + cx_write(MO_GP0_IO, 0x00001222); + break; + } + if (core->prev_set_voltage) + return core->prev_set_voltage(fe, voltage); + return 0; +}; + static struct cx24123_config geniatech_dvbs_config = { .demod_address = 0x55, .set_ts_params = cx24123_set_ts_param, @@ -1210,6 +1239,17 @@ } break; } + case CX88_BOARD_TWINHAN_VP1027_DVBS: + dev->ts_gen_cntrl = 0x00; + fe0->dvb.frontend = dvb_attach(mb86a16_attach, + &twinhan_vp1027, + &core->i2c_adap); + if (fe0->dvb.frontend) { + core->prev_set_voltage = fe0->dvb.frontend->ops.set_voltage; + fe0->dvb.frontend->ops.set_voltage = vp1027_set_voltage; + } + break; + default: printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", core->name); diff -r 2a50a0a1c951 linux/drivers/media/video/cx88/cx88.h --- a/linux/drivers/media/video/cx88/cx88.h Sat Jan 23 00:14:32 2010 -0200 +++ b/linux/drivers/media/video/cx88/cx88.h Sun Jan 24 15:04:25 2010 +0300 @@ -240,6 +240,7 @@ #define CX88_BOARD_WINFAST_DTV1800H 81 #define CX88_BOARD_WINFAST_DTV2000H_J 82 #define CX88_BOARD_PROF_7301 83 +#define CX88_BOARD_TWINHAN_VP1027_DVBS 84 enum cx88_itype { CX88_VMUX_COMPOSITE1 = 1, --00032555415a934489047df96c44 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable When v4l-dvb starts to support this card? You already have well tested patc= h for this purpose. But it still "experimental". I had one doubt,= i'm not sure if we need all of those chips, that patch contain, cos th= is card has only cx88x & mb86a16, so i exclude em, and it looks work.

diff -r 2a50a0a1c951 linux/drivers/media/video/cx88/cx88-cards.c--- a/linux/drivers/media/video/cx88/cx88-cards.c=A0=A0=A0 Sat Jan 23 00:1= 4:32 2010 -0200
+++ b/linux/drivers/media/video/cx88/cx88-cards.c=A0=A0= =A0 Sun Jan 24 15:04:25 2010 +0300
@@ -2120,6 +2120,18 @@
=A0=A0=A0=A0 =A0=A0=A0 } },
=A0=A0=A0=A0 =A0= =A0=A0 .mpeg=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D CX88_MPEG_DVB,
=A0=A0=A0= =A0 },
+=A0=A0=A0 [CX88_BOARD_TWINHAN_VP1027_DVBS] =3D {
+=A0=A0=A0 = =A0=A0=A0=A0=A0=A0=A0 .name=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D "Twinhan= VP-1027 DVB-S",
+=A0=A0=A0 =A0=A0=A0 .tuner_type=A0=A0=A0=A0 =3D T= UNER_ABSENT,
+=A0=A0=A0 =A0=A0=A0 .radio_type=A0=A0=A0=A0 =3D UNSET,
+=A0=A0=A0 =A0= =A0=A0 .tuner_addr=A0=A0=A0=A0 =3D ADDR_UNSET,
+=A0=A0=A0 =A0=A0=A0 .rad= io_addr=A0=A0=A0=A0 =3D ADDR_UNSET,
+=A0=A0=A0 =A0=A0=A0 .input=A0=A0=A0= =A0=A0=A0=A0=A0=A0 =3D {{
+=A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0 .type= =A0=A0 =3D CX88_VMUX_DVB,
+=A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0 .vmux= =A0=A0 =3D 0,
+=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 } },
+=A0=A0=A0 =A0=A0=A0 .mpeg=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 =3D CX88_MPEG_DVB,
+=A0=A0=A0 },
=A0};
= =A0
=A0/* --------------------------------------------------------------= ---- */
@@ -2584,6 +2596,10 @@
=A0=A0=A0=A0 =A0=A0=A0 .subvendor =3D = 0xb034,
=A0=A0=A0=A0 =A0=A0=A0 .subdevice =3D 0x3034,
=A0=A0=A0=A0 =A0=A0=A0 .ca= rd=A0=A0=A0=A0=A0 =3D CX88_BOARD_PROF_7301,
+=A0=A0=A0 }, {
+=A0=A0= =A0 =A0=A0=A0=A0=A0=A0=A0 .subvendor =3D 0x1822,
+=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 .subdevice =3D 0x0023,
+=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 .card=A0=A0=A0=A0=A0 =3D CX88_BOARD_TWINHAN_VP1027= _DVBS,
=A0=A0=A0=A0 },
=A0};
=A0
@@ -3075,6 +3091,13 @@
=A0=A0=A0=A0 = =A0=A0=A0 cx_set(MO_GP1_IO, 0x10);
=A0=A0=A0=A0 =A0=A0=A0 mdelay(50);=A0=A0=A0=A0 =A0=A0=A0 break;
+
+=A0=A0=A0 case CX88_BOARD_TWINHAN_V= P1027_DVBS:
+=A0=A0=A0 =A0=A0=A0 cx_write(MO_GP0_IO, 0x00003230);
+=A0=A0=A0 =A0=A0=A0 cx_write(MO_GP0_IO, 0x00003210);
+=A0=A0=A0 =A0=A0= =A0 msleep(1);
+=A0=A0=A0 =A0=A0=A0 cx_write(MO_GP0_IO, 0x00001230);
= +=A0=A0=A0 =A0=A0=A0 break;
=A0=A0=A0=A0 }
=A0}
=A0
diff -r 2a5= 0a0a1c951 linux/drivers/media/video/cx88/cx88-dvb.c
--- a/linux/drivers/= media/video/cx88/cx88-dvb.c=A0=A0=A0 Sat Jan 23 00:14:32 2010 -0200
+++ b/linux/drivers/media/video/cx88/cx88-dvb.c=A0=A0=A0 Sun Jan 24 15:04:2= 5 2010 +0300
@@ -57,6 +57,7 @@
=A0#include "stv0900.h"
= =A0#include "stb6100.h"
=A0#include "stb6100_proc.h"=
+#include "mb86a16.h"
=A0
=A0MODULE_DESCRIPTION("driver for cx2388x based DVB cards"= );
=A0MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>");
@@ -251,6 +252,10 = @@
=A0=A0=A0=A0 .if2=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 45600,
=A0};
=A0<= br>+static struct mb86a16_config twinhan_vp1027 =3D {
+=A0=A0=A0 .demod_= address=A0 =3D 0x08,
+};
+
=A0#if defined(CONFIG_VIDEO_CX88_VP3054= ) || (defined(CONFIG_VIDEO_CX88_VP3054_MODULE) && defined(MODULE))<= br> =A0static int dntv_live_dvbt_pro_demod_init(struct dvb_frontend* fe)
=A0= {
@@ -446,6 +451,30 @@
=A0=A0=A0=A0 return 0;
=A0}
=A0
+stat= ic int vp1027_set_voltage(struct dvb_frontend *fe,
+=A0=A0=A0 =A0=A0=A0 = =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 fe_sec_voltage_t voltage)
+{
+=A0=A0=A0 struct cx8802_dev *dev =3D fe->dvb->priv;
+=A0=A0= =A0 struct cx88_core *core =3D dev->core;
+=A0=A0=A0 switch (voltage)= {
+=A0=A0=A0 =A0=A0=A0=A0=A0 case SEC_VOLTAGE_OFF:
+=A0=A0=A0 =A0=A0= =A0 =A0=A0=A0 dprintk(1, "LNB Voltage OFF\n");
+=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 cx_write(MO_GP0_IO, 0x00001230);
+=A0=A0= =A0 =A0=A0=A0 =A0=A0=A0 break;
+=A0=A0=A0 =A0=A0=A0=A0=A0 case SEC_VOLTA= GE_13:
+=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 dprintk(1, "LNB SEC Voltage= =3D13\n");
+=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 cx_write(MO_GP0_IO, 0x000= 01220);
+=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 break;
+=A0=A0=A0 =A0=A0=A0=A0=A0 case SEC_VOLTAGE_18:
+=A0=A0=A0 =A0=A0=A0 =A0= =A0=A0 dprintk(1, "LNB SEC Voltage=3D18\n");
+=A0=A0=A0 =A0=A0= =A0 =A0=A0=A0 cx_write(MO_GP0_IO, 0x00001222);
+=A0=A0=A0 =A0=A0=A0 =A0= =A0=A0 break;
+=A0=A0=A0 }
+=A0=A0=A0 if (core->prev_set_voltage)<= br>+=A0=A0=A0 =A0=A0=A0=A0=A0 return core->prev_set_voltage(fe, voltage)= ;
+=A0=A0=A0 return 0;
+};
+
=A0static struct cx24123_config geniate= ch_dvbs_config =3D {
=A0=A0=A0=A0 .demod_address =3D 0x55,
=A0=A0=A0= =A0 .set_ts_params =3D cx24123_set_ts_param,
@@ -1210,6 +1239,17 @@
= =A0=A0=A0=A0 =A0=A0=A0 }
=A0=A0=A0=A0 =A0=A0=A0 break;
=A0=A0=A0=A0 =A0=A0=A0 }
+=A0=A0=A0 case CX88_BOARD_TWINHAN_VP1027_DVBS:=
+=A0=A0=A0 =A0=A0=A0 dev->ts_gen_cntrl =3D 0x00;
+=A0=A0=A0 =A0= =A0=A0 fe0->dvb.frontend =3D dvb_attach(mb86a16_attach,
+=A0=A0=A0 = =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 &twinhan_vp1027,
+= =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 &core->i= 2c_adap);
+=A0=A0=A0 =A0=A0=A0 if (fe0->dvb.frontend) {
+=A0=A0=A0 =A0=A0=A0 = =A0=A0=A0 core->prev_set_voltage =3D fe0->dvb.frontend->ops.set_vo= ltage;
+=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 fe0->dvb.frontend->ops.set_v= oltage =3D vp1027_set_voltage;
+=A0=A0=A0 =A0=A0=A0 }
+=A0=A0=A0 =A0= =A0=A0=A0=A0=A0=A0 break;
+
=A0=A0=A0=A0 default:
=A0=A0=A0=A0 =A0=A0=A0 printk(KERN_ERR "= %s/2: The frontend of your DVB/ATSC card isn't supported yet\n",=A0=A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0 core->name);
diff -r 2a50= a0a1c951 linux/drivers/media/video/cx88/cx88.h
--- a/linux/drivers/media/video/cx88/cx88.h=A0=A0=A0 Sat Jan 23 00:14:32 20= 10 -0200
+++ b/linux/drivers/media/video/cx88/cx88.h=A0=A0=A0 Sun Jan 24= 15:04:25 2010 +0300
@@ -240,6 +240,7 @@
=A0#define CX88_BOARD_WINFAS= T_DTV1800H=A0=A0=A0=A0=A0=A0=A0 81
=A0#define CX88_BOARD_WINFAST_DTV2000H_J=A0=A0=A0=A0=A0 82
=A0#define CX= 88_BOARD_PROF_7301=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 83
+#define= CX88_BOARD_TWINHAN_VP1027_DVBS=A0=A0=A0=A0 84
=A0
=A0enum cx88_itype= {
=A0=A0=A0=A0 CX88_VMUX_COMPOSITE1 =3D 1,

--00032555415a934489047df96c44-- --===============0537407733== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-dvb users mailing list For V4L/DVB development, please use instead linux-media@vger.kernel.org linux-dvb@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb --===============0537407733==--