Re: m920x device: Genius TVGo DVB-T02Q (working driver v 0.0.1 ; -)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello List,

Here they are. The last m920x patch, together with the last firmware I
dumped, for supporting the Genius/KYE TVGo T02Q, V2.0 (Please note
this is not the same device as the T02Q-MCE, nor as the T02Pro).
The patch contains some code intended to make the remote controller
work, but it's still useless (apart from turning that disturbing blue
light on ;-). Neither do work hardware pids. But nonetheless, it's
possible to watch TV.

For newbies, these are the installation steps:
------

# install hg (debian/ubuntu: as root, "aptitude install mercurial")
# and get the last repository code:
hg clone http://linuxtv.org/hg/v4l-dvb

# apply the patch, compile and install
cd v4l-dvb
hg patch "<path to file>"/dvb_guay_20080424.diff
make rmmod    # (as root)
make
make install    # (as root)

# install firmware file (as root) (destination path may vary)
cp "<path to file>"/dvb-usb-tvgo-t02qv2-03.fw  /lib/firmware/$(uname -r)/

------
And then plug the device in and test it (dmesg, tzap, scan, mplayer,
xine, klear, etc.).



Regards,

-- 

 Román

Attachment: dvb-usb-tvgo-t02qv2-03.fw
Description: Binary data

diff -r 6aa6656852cb linux/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-ids.h	Wed Apr 16 13:13:15 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-ids.h	Thu Apr 24 22:45:53 2008 +0200
@@ -83,6 +83,7 @@
 #define USB_PID_DPOSH_M9206_COLD			0x9206
 #define USB_PID_DPOSH_M9206_WARM			0xa090
 #define USB_PID_UNIWILL_STK7700P			0x6003
+#define USB_PID_GENIUS_DVBT_TVGO_T02Q			0x702b
 #define USB_PID_GRANDTEC_DVBT_USB_COLD			0x0fa0
 #define USB_PID_GRANDTEC_DVBT_USB_WARM			0x0fa1
 #define USB_PID_KWORLD_VSTREAM_COLD			0x17de
diff -r 6aa6656852cb linux/drivers/media/dvb/dvb-usb/m920x.c
--- a/linux/drivers/media/dvb/dvb-usb/m920x.c	Wed Apr 16 13:13:15 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/m920x.c	Thu Apr 24 22:45:53 2008 +0200
@@ -11,11 +11,13 @@
 
 #include "m920x.h"
 
+#include "mt2060.h"
 #include "mt352.h"
 #include "mt352_priv.h"
 #include "qt1010.h"
 #include "tda1004x.h"
 #include "tda827x.h"
+#include "zl10353.h"
 
 /* debug */
 static int dvb_usb_m920x_debug;
@@ -471,9 +473,22 @@ static struct tda1004x_config m920x_tda1
 	.request_firmware = NULL, /* uses firmware EEPROM */
 };
 
+static struct zl10353_config m920x_tvgot02q_zl10353_config = {
+	.demod_address = 0x0f,
+	//.adc_clock = 22528,
+	//.if2 = 361667,
+	.no_tuner = 1,
+	//.parallel_ts = 1,
+};
+
 /* tuner configurations */
 static struct qt1010_config m920x_qt1010_config = {
 	.i2c_address = 0x62
+};
+
+static struct mt2060_config m920x_tvgot02q_mt2060_config = {
+	.clock_out = 1,
+	.i2c_address = 0x60,
 };
 
 /* Callbacks for DVB USB */
@@ -513,6 +528,18 @@ static int m920x_tda10046_0b_frontend_at
 	return 0;
 }
 
+static int m920x_tvgot02q_frontend_attach(struct dvb_usb_adapter *adap)
+{
+	deb("%s\n",__func__);
+
+	if ((adap->fe = dvb_attach(zl10353_attach,
+				   &m920x_tvgot02q_zl10353_config,
+				   &adap->dev->i2c_adap)) == NULL)
+		return -EIO;
+
+	return 0;
+}
+
 static int m920x_qt1010_tuner_attach(struct dvb_usb_adapter *adap)
 {
 	deb("%s\n",__func__);
@@ -538,6 +565,17 @@ static int m920x_tda8275_61_tuner_attach
 	deb("%s\n",__func__);
 
 	if (dvb_attach(tda827x_attach, adap->fe, 0x61, &adap->dev->i2c_adap, NULL) == NULL)
+		return -ENODEV;
+
+	return 0;
+}
+
+static int m920x_mt2060_tuner_attach(struct dvb_usb_adapter *adap)
+{
+	const static int if1 = 1220;
+	deb("%s\n",__func__);
+
+	if (dvb_attach(mt2060_attach, adap->fe, &adap->dev->i2c_adap, &m920x_tvgot02q_mt2060_config, if1) == NULL)
 		return -ENODEV;
 
 	return 0;
@@ -556,6 +594,31 @@ static struct m920x_inits tvwalkertwin_r
 	{ 0xff28,         0x00 },
 	{ 0xff23,         0x00 },
 	{ 0xff21,         0x30 },
+	{ } /* terminating entry */
+};
+
+static struct m920x_inits tvgot02q_rc_init [] = {
+//	{ M9206_RC_INIT2, 0xa8 }, // ff54
+//	{ M9206_RC_INIT1, 0x51 }, // ff55
+
+//	{ 0xff85,         0xff },
+//	{ 0xff84,         0xff },
+//	{ 0xff28,         0x00 },
+//	{ 0xff23,         0x00 },
+//	{ 0xff22,         0x00 },
+//	{ 0xff20,         0x30 },
+//	{ 0xff21,         0x70 },
+
+//	{ 0xff85,         0xf5 },
+//	{ 0xff84,         0x83 },
+	{ 0xff54,         0xff },
+	{ 0xff55,         0xff },
+	{ 0xff28,         0x00 },
+	{ 0xff23,         0x00 },
+	{ 0xff23,         0x00 },
+	{ 0xff21,         0x70 },
+//	{ 0xff22,         0x00 },
+//	{ 0xff20,         0x30 },
 	{ } /* terminating entry */
 };
 
@@ -599,11 +662,34 @@ static struct dvb_usb_rc_key tvwalkertwi
 	{ 0x0, 0x1e, KEY_VOLUMEUP },
 };
 
+static struct dvb_usb_rc_key tvgot02q_rc_keys [] = {
+	{ 0x0, 0x01, KEY_ZOOM }, /* Full Screen */
+	{ 0x0, 0x02, KEY_CAMERA }, /* snapshot */
+	{ 0x0, 0x03, KEY_MUTE },
+	{ 0x0, 0x04, KEY_REWIND },
+	{ 0x0, 0x05, KEY_PLAYPAUSE }, /* Play/Pause */
+	{ 0x0, 0x06, KEY_FASTFORWARD },
+	{ 0x0, 0x07, KEY_RECORD },
+	{ 0x0, 0x08, KEY_STOP },
+	{ 0x0, 0x09, KEY_TIME }, /* Timeshift */
+	{ 0x0, 0x0c, KEY_COFFEE }, /* Recall */
+	{ 0x0, 0x0e, KEY_CHANNELUP },
+	{ 0x0, 0x12, KEY_POWER },
+	{ 0x0, 0x15, KEY_MENU }, /* source */
+	{ 0x0, 0x18, KEY_CYCLEWINDOWS }, /* TWIN PIP */
+	{ 0x0, 0x1a, KEY_CHANNELDOWN },
+	{ 0x0, 0x1b, KEY_VOLUMEDOWN },
+	{ 0x0, 0x1e, KEY_VOLUMEUP },
+
+//	{ 0x0, 0x04, KEY_REWIND },
+};
+
 /* DVB USB Driver stuff */
 static struct dvb_usb_device_properties megasky_properties;
 static struct dvb_usb_device_properties digivox_mini_ii_properties;
 static struct dvb_usb_device_properties tvwalkertwin_properties;
 static struct dvb_usb_device_properties dposh_properties;
+static struct dvb_usb_device_properties tvgot02q_properties;
 
 static int m920x_probe(struct usb_interface *intf,
 		       const struct usb_device_id *id)
@@ -646,6 +732,13 @@ static int m920x_probe(struct usb_interf
 					  THIS_MODULE, &d, adapter_nr);
 		if (ret == 0) {
 			/* Remote controller not supported yet. */
+			goto found;
+		}
+
+		ret = dvb_usb_device_init(intf, &tvgot02q_properties,
+					  THIS_MODULE, &d, adapter_nr);
+		if (ret == 0) {
+			rc_init_seq = tvgot02q_rc_init;
 			goto found;
 		}
 
@@ -679,6 +772,7 @@ static struct usb_device_id m920x_table 
 			     USB_PID_LIFEVIEW_TV_WALKER_TWIN_WARM) },
 		{ USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_COLD) },
 		{ USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_WARM) },
+		{ USB_DEVICE(USB_VID_KYE, USB_PID_GENIUS_DVBT_TVGO_T02Q) },
 		{ }		/* Terminating entry */
 };
 MODULE_DEVICE_TABLE (usb, m920x_table);
@@ -892,6 +986,57 @@ static struct dvb_usb_device_properties 
 	 }
 };
 
+static struct dvb_usb_device_properties tvgot02q_properties = {
+	.caps = DVB_USB_IS_AN_I2C_ADAPTER,
+
+	.usb_ctrl = DEVICE_SPECIFIC,
+	.firmware = "dvb-usb-tvgo-t02qv2-03.fw",
+	.download_firmware = m920x_firmware_download,
+
+	.rc_interval      = 100,
+	.rc_key_map       = tvgot02q_rc_keys,
+	.rc_key_map_size  = ARRAY_SIZE(tvgot02q_rc_keys),
+	.rc_query         = m920x_rc_query,
+
+	.size_of_priv	 = sizeof(struct m920x_state),
+
+	.identify_state   = m920x_identify_state,
+	.num_adapters = 1,
+	.adapter = {{
+	/* PID FILTERS DON'T WORK WITH CURRENT FW/CONFIG/WHATEVER' */
+	/*
+		.caps =  DVB_USB_ADAP_HAS_PID_FILTER |
+			 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
+
+		.pid_filter_count = 8,
+		.pid_filter	  = m920x_pid_filter,
+		.pid_filter_ctrl  = m920x_pid_filter_ctrl,
+	*/
+		.frontend_attach  = m920x_tvgot02q_frontend_attach,
+		.tuner_attach	  = m920x_mt2060_tuner_attach,
+
+		.stream = {
+			.type = USB_BULK,
+			.count = 8,
+			.endpoint = 0x81,
+			.u = {
+				 .bulk = {
+					 .buffersize = 512,
+				 }
+			}
+		},
+	}},
+	.i2c_algo	 = &m920x_i2c_algo,
+
+	.num_device_descs = 1,
+	.devices = {
+		{ "Genius TVGo DVB-T02Q",
+		     { &m920x_table[6], NULL },
+		     { NULL },
+		},
+	}
+};
+
 static struct usb_driver m920x_driver = {
 #if LINUX_VERSION_CODE <=  KERNEL_VERSION(2,6,15)
 	.owner		= THIS_MODULE,
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux