public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [linux-dvb] DPosh m9206 USB DVB-T stick with MT2060
@ 2008-10-02 20:33 Andrew Websdale
  2008-10-02 23:12 ` Antti Palosaari
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Websdale @ 2008-10-02 20:33 UTC (permalink / raw)
  To: linux-dvb

[-- Attachment #1: Type: text/plain, Size: 1165 bytes --]

     Some time ago I had a brief correspondence on here with Antii
about adding support for the MT2060 tuner to the DPosh driver( there's
recently been a load of these on sale in several places for 10 GBP
ish). I had a go at hacking something together, which although
definitely poorly written, did appear to work. However, my signal at
home is currently just not quite good enough to test it properly, so I
let the matter rest for the moment.
     Then I was contacted by a guy who'd bought the same stick & been
following my posts - he tried it & is definitely receiving TV
stations(with plenty of room for improvement), so it seems that its
worth going further with it.
      I've attached a diff of m920x.c -  I'd like some help with a)the
correct mechanism for detecting which tuner chip is present (i.e.
QT1010/MT2060) , b) what to tweak to improve output quality & c)
whether my whole approach is wrong or what?- I have no experience of
driver programming or C, though I know a little about C++ app
development. Hugh (the guy with another DPosh stick) will be able to
test any changes as will I (if I can improve my Freeview signal).
Regards Andrew Websdale

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: m920x.diff --]
[-- Type: text/x-patch; name=m920x.diff, Size: 3691 bytes --]

--- ../v4l-dvb.orig/linux/drivers/media/dvb/dvb-usb/m920x.c	2008-09-24 23:36:47.000000000 +0100
+++ linux/drivers/media/dvb/dvb-usb/m920x.c	2008-07-04 23:17:19.000000000 +0100
@@ -10,7 +10,7 @@
  */
 
 #include "m920x.h"
-
+#include "mt2060.h"
 #include "mt352.h"
 #include "mt352_priv.h"
 #include "qt1010.h"
@@ -20,6 +20,7 @@
 
 /* debug */
 static int dvb_usb_m920x_debug;
+static bool bdposh_warm = false;
 module_param_named(debug,dvb_usb_m920x_debug, int, 0644);
 MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
 
@@ -477,6 +478,10 @@
 	.i2c_address = 0x62
 };
 
+static struct mt2060_config m920x_mt2060_config = {
+	.i2c_address = 0x60          
+};
+
 /* Callbacks for DVB USB */
 static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap)
 {
@@ -544,6 +549,19 @@
 	return 0;
 }
 
+static int m920x_mt2060_tuner_attach(struct dvb_usb_adapter *adap)
+{
+	u16 if1;
+	
+	deb("%s\n",__func__);
+	
+	if1 = 1220;
+	
+	if (dvb_attach(mt2060_attach, adap->fe, &adap->dev->i2c_adap, &m920x_mt2060_config, if1) == NULL)
+		return -ENODEV;
+
+	return 0;
+}
 /* device-specific initialization */
 static struct m920x_inits megasky_rc_init [] = {
 	{ M9206_RC_INIT2, 0xa8 },
@@ -604,7 +622,8 @@
 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 dposh_properties;//qt1010
+static struct dvb_usb_device_properties dposh_mt_properties;//for mt2060
 
 static int m920x_probe(struct usb_interface *intf,
 		       const struct usb_device_id *id)
@@ -642,13 +661,25 @@
 			rc_init_seq = tvwalkertwin_rc_init;
 			goto found;
 		}
-
-		ret = dvb_usb_device_init(intf, &dposh_properties,
+		
+		ret = dvb_usb_device_init(intf, &dposh_mt_properties,
 					  THIS_MODULE, &d, adapter_nr);
 		if (ret == 0) {
 			/* Remote controller not supported yet. */
+			bdposh_warm = true;			
 			goto found;
 		}
+		
+		if (bdposh_warm != true){ 		
+			ret = dvb_usb_device_init(intf, &dposh_properties,
+					  THIS_MODULE, &d, adapter_nr);
+			if (ret == 0) {
+			/* Remote controller not supported yet. */
+				goto found;
+			}
+		}
+
+
 
 		return ret;
 	} else {
@@ -886,14 +917,59 @@
 
 	.num_device_descs = 1,
 	.devices = {
-		 {   .name = "Dposh DVB-T USB2.0",
+		 {   .name = "Dposh(qt1010 tuner) DVB-T USB2.0",
+		     .cold_ids = { &m920x_table[4], NULL },
+		     .warm_ids = { &m920x_table[5], NULL },
+		 },
+	 }
+};
+
+
+static struct dvb_usb_device_properties dposh_mt_properties = {
+	.caps = DVB_USB_IS_AN_I2C_ADAPTER,
+
+	.usb_ctrl = DEVICE_SPECIFIC,
+	.firmware = "dvb-usb-dposh-01.fw",
+	.download_firmware = m920x_firmware_download,
+
+	.size_of_priv     = sizeof(struct m920x_state),
+
+	.identify_state   = m920x_identify_state,
+	.num_adapters = 1,
+	.adapter = {{
+
+		.frontend_attach  = m920x_mt352_frontend_attach,
+		.tuner_attach     = m920x_mt2060_tuner_attach,
+
+		.stream = {
+			.type = USB_BULK,
+			.count = 7,
+			.endpoint = 0x81,
+			.u = {
+				 .bulk = {
+					 .buffersize = 512,
+				 }
+			}
+		},
+	}},
+	.i2c_algo         = &m920x_i2c_algo,
+
+	.num_device_descs = 1,
+	.devices = {
+		 {   .name = "Dposh(mt2060 tuner) DVB-T USB2.0",
 		     .cold_ids = { &m920x_table[4], NULL },
 		     .warm_ids = { &m920x_table[5], NULL },
 		 },
 	 }
+
+
 };
 
+
 static struct usb_driver m920x_driver = {
+#if LINUX_VERSION_CODE <=  KERNEL_VERSION(2,6,15)
+	.owner		= THIS_MODULE,
+#endif
 	.name		= "dvb_usb_m920x",
 	.probe		= m920x_probe,
 	.disconnect	= dvb_usb_device_exit,

[-- Attachment #3: Type: text/plain, Size: 150 bytes --]

_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-dvb] DPosh m9206 USB DVB-T stick with MT2060
  2008-10-02 20:33 [linux-dvb] DPosh m9206 USB DVB-T stick with MT2060 Andrew Websdale
@ 2008-10-02 23:12 ` Antti Palosaari
  0 siblings, 0 replies; 2+ messages in thread
From: Antti Palosaari @ 2008-10-02 23:12 UTC (permalink / raw)
  To: Andrew Websdale; +Cc: linux-dvb

hello
Andrew Websdale wrote:
>      Some time ago I had a brief correspondence on here with Antii
> about adding support for the MT2060 tuner to the DPosh driver( there's
> recently been a load of these on sale in several places for 10 GBP
> ish). I had a go at hacking something together, which although
> definitely poorly written, did appear to work. However, my signal at
> home is currently just not quite good enough to test it properly, so I
> let the matter rest for the moment.
>      Then I was contacted by a guy who'd bought the same stick & been
> following my posts - he tried it & is definitely receiving TV
> stations(with plenty of room for improvement), so it seems that its
> worth going further with it.
>       I've attached a diff of m920x.c -  I'd like some help with a)the
> correct mechanism for detecting which tuner chip is present (i.e.
> QT1010/MT2060) , b) what to tweak to improve output quality & c)
> whether my whole approach is wrong or what?- I have no experience of
> driver programming or C, though I know a little about C++ app
> development. Hugh (the guy with another DPosh stick) will be able to
> test any changes as will I (if I can improve my Freeview signal).
> Regards Andrew Websdale

You can first try to attach qt1010 tuner and if it fails (it will fail 
if there is no qt1010) you can secondly try to attach mt2060 tuner. 
There is some examples in current drivers how to do that. Look anysee.c 
for example.

regards
Antti
-- 
http://palosaari.fi/

_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-02 23:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-02 20:33 [linux-dvb] DPosh m9206 USB DVB-T stick with MT2060 Andrew Websdale
2008-10-02 23:12 ` Antti Palosaari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox