[PATCH] Fix Hauppauge Nova-T 500 USB disconnects

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

 



This patch fix Hauppauge Nova-T 500 USB disconnects.

Signed-off-by: Jose Alberto Reguero <jareguero@xxxxxxxxxxxxxx>

Jose Alberto
diff -r cdf3d32494a7 linux/drivers/media/dvb/dvb-usb/dib0700.h
--- a/linux/drivers/media/dvb/dvb-usb/dib0700.h	Mon Jul 23 11:34:34 2007 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dib0700.h	Mon Jul 23 20:32:14 2007 +0200
@@ -37,6 +37,8 @@ struct dib0700_state {
 	u16 mt2060_if1[2];
 
 	u8 is_dib7000pc;
+
+	int (*streaming_ctrl)  (struct dvb_usb_adapter *, int);
 };
 
 extern int dib0700_set_gpio(struct dvb_usb_device *, enum dib07x0_gpios gpio, u8 gpio_dir, u8 gpio_val);
diff -r cdf3d32494a7 linux/drivers/media/dvb/dvb-usb/dib0700_devices.c
--- a/linux/drivers/media/dvb/dvb-usb/dib0700_devices.c	Mon Jul 23 11:34:34 2007 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dib0700_devices.c	Mon Jul 23 21:00:58 2007 +0200
@@ -84,6 +84,7 @@ static int bristol_frontend_attach(struc
 		}
 	}
 	st->mt2060_if1[adap->id] = 1220;
+	st->streaming_ctrl = dib0700_streaming_ctrl;
 	return (adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap,
 		(10 + adap->id) << 1, &bristol_dib3000mc_config[adap->id])) == NULL ? -ENODEV : 0;
 }
@@ -307,6 +308,18 @@ MODULE_DEVICE_TABLE(usb, dib0700_usb_id_
 		} \
 	}
 
+#define DIB0700_STREAMING_CONFIG_500(ep) \
+	.stream = { \
+		.type = USB_BULK, \
+		.count = 4, \
+		.endpoint = ep, \
+		.u = { \
+			.bulk = { \
+				.buffersize = 39480, \
+			} \
+		} \
+	}
+
 struct dvb_usb_device_properties dib0700_devices[] = {
 	{
 		DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -356,12 +369,12 @@ struct dvb_usb_device_properties dib0700
 				.frontend_attach  = bristol_frontend_attach,
 				.tuner_attach     = bristol_tuner_attach,
 
-				DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
+				DIB0700_STREAMING_CONFIG_500(0x02),
 			}, {
 				.frontend_attach  = bristol_frontend_attach,
 				.tuner_attach     = bristol_tuner_attach,
 
-				DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
+				DIB0700_STREAMING_CONFIG_500(0x03),
 			}
 		},
 
diff -r cdf3d32494a7 linux/drivers/media/dvb/frontends/dib3000mc.c
--- a/linux/drivers/media/dvb/frontends/dib3000mc.c	Mon Jul 23 11:34:34 2007 -0300
+++ b/linux/drivers/media/dvb/frontends/dib3000mc.c	Mon Jul 23 21:28:52 2007 +0200
@@ -22,9 +22,13 @@
 
 #include "dib3000mc.h"
 
+#include "dib0700.h"
+
 static int debug;
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "turn on debugging (default: 0)");
+
+#undef dprintk
 
 #define dprintk(args...) do { if (debug) { printk(KERN_DEBUG "DiB3000MC/P:"); printk(args); } } while (0)
 
@@ -316,6 +320,8 @@ static int dib3000mc_init(struct dvb_fro
 {
 	struct dib3000mc_state *state = demod->demodulator_priv;
 	struct dibx000_agc_config *agc = state->cfg->agc;
+	struct dvb_usb_adapter *adap = demod->dvb->priv;
+	struct dib0700_state *st = adap->dev->priv;
 
 	// Restart Configuration
 	dib3000mc_write_word(state, 1027, 0x8000);
@@ -429,12 +435,20 @@ static int dib3000mc_init(struct dvb_fro
 	/* close the i2c-gate */
 	dib3000mc_write_word(state, 769, (1 << 7) );
 
+	if (!strcmp (adap->dev->props.devices[0].name, "Hauppauge Nova-T 500 Dual DVB-T"))
+		st->streaming_ctrl(adap,1);
+
 	return 0;
 }
 
 static int dib3000mc_sleep(struct dvb_frontend *demod)
 {
 	struct dib3000mc_state *state = demod->demodulator_priv;
+	struct dvb_usb_adapter *adap = demod->dvb->priv;
+	struct dib0700_state *st = adap->dev->priv;
+
+	if (!strcmp (adap->dev->props.devices[0].name, "Hauppauge Nova-T 500 Dual DVB-T"))
+		st->streaming_ctrl(adap,0);
 
 	dib3000mc_write_word(state, 1031, 0xFFFF);
 	dib3000mc_write_word(state, 1032, 0xFFFF);
_______________________________________________
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