Re: Terratec Cinergy Hybrid XE (TM6010 Mediachip)

2010-01-31 Thread Stefan Ringel
Am 27.01.2010 21:47, schrieb Mauro Carvalho Chehab:
 Stefan Ringel wrote:
   
 Hi,

 I have a problem with usb bulk transfer. After a while, as I scan digital 
 channel (it found a few channel), it wrote this in the log:

 Jan 26 21:58:35 linux-v5dy kernel: [  548.756585] tm6000: status != 0

 I updated the tm6000_urb_received function so that I can read the Error code 
 and it logged:

 Jan 27 17:41:28 linux-v5dy kernel: [ 3121.892793] tm6000: status = 0xffb5
 
 Probablt it is this error:
 #define EOVERFLOW   75  /* Value too large for defined data type */

 It would be good to make it display the error as a signed int.

 the tm6000-video error handler has some common causes for those status.
 In this particular case:

 case -EOVERFLOW:
 errmsg = Babble (bad cable?);
 break;

 This looks the same kind of errors I was receiving during the development of 
 the driver:
 a large amount of frames are got broken, even if the device is programmed 
 with the exact
 values used on the original driver. On my tests, changing the URB size were 
 changing
 the position where such errors were occurring.

   
 Can you help me? Who I can calculate urb size?
 
 Take a look on tm6000-video:

 size = usb_maxpacket(dev-udev, pipe, usb_pipeout(pipe));

 if (size  dev-max_isoc_in)
 size = dev-max_isoc_in;

 It depends on the alternate interface used. The driver should select an 
 alternate
 interface that is capable of receiving the entire size of a message. Maybe 
 the tm6000
 driver is missing the code that selects this size. Take a look on 
 em28xx-core, at
 em28xx_set_alternate() code for an example on how this should work.

 The calculated size there assumes that each pixel has 16 bits, and has some 
 magic that
 were experimentally tested on that device.

 Cheers,
 Mauro.

   
I know why it's going to overflow. It's not usb pipe calculating, it's
numbers of feeds that it's used. But then I cannot use more than one
filter! It's bad!!

Cheers

Stefan Ringel

-- 
Stefan Ringel stefan.rin...@arcor.de

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Terratec Cinergy Hybrid XE (TM6010 Mediachip)

2010-01-27 Thread Mauro Carvalho Chehab
Stefan Ringel wrote:
 Hi,
 
 I have a problem with usb bulk transfer. After a while, as I scan digital 
 channel (it found a few channel), it wrote this in the log:
 
 Jan 26 21:58:35 linux-v5dy kernel: [  548.756585] tm6000: status != 0
 
 I updated the tm6000_urb_received function so that I can read the Error code 
 and it logged:
 
 Jan 27 17:41:28 linux-v5dy kernel: [ 3121.892793] tm6000: status = 0xffb5

Probablt it is this error:
#define EOVERFLOW   75  /* Value too large for defined data type */

It would be good to make it display the error as a signed int.

the tm6000-video error handler has some common causes for those status.
In this particular case:

case -EOVERFLOW:
errmsg = Babble (bad cable?);
break;

This looks the same kind of errors I was receiving during the development of 
the driver:
a large amount of frames are got broken, even if the device is programmed with 
the exact
values used on the original driver. On my tests, changing the URB size were 
changing
the position where such errors were occurring.

 
 Can you help me? Who I can calculate urb size?

Take a look on tm6000-video:

size = usb_maxpacket(dev-udev, pipe, usb_pipeout(pipe));

if (size  dev-max_isoc_in)
size = dev-max_isoc_in;

It depends on the alternate interface used. The driver should select an 
alternate
interface that is capable of receiving the entire size of a message. Maybe the 
tm6000
driver is missing the code that selects this size. Take a look on em28xx-core, 
at
em28xx_set_alternate() code for an example on how this should work.

The calculated size there assumes that each pixel has 16 bits, and has some 
magic that
were experimentally tested on that device.

Cheers,
Mauro.

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Terratec Cinergy Hybrid XE (TM6010 Mediachip)

2010-01-25 Thread Mauro Carvalho Chehab
Stefan Ringel wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
  
 Hi Davin,
 I have a question. How are loaded the base firmware into xc3028, in
 once or in a split ? It's importent for TM6010, the USB-Analyzer said
 that it load it in once and then send a quitting reqeuest.

The way the original driver for tm6000/tm6010 does varies from firmware
version to firmware version. That part of the driver works fine for
both tm6000 and tm6010, with the devices I used here, with firmwares 1.e 
and 2.7. However, on tm6000, it sends the firmware on packages with
up to 12 or 13 bytes, and it requires a delay before sending the next
packet, otherwise the tm6000 hangs.

Another problem is that the firmware load may fail (due to the bad
implementation of the i2c on tm6000/tm6010). So, the code should ideally
check if the firmware were loaded, by reading the firmware version at the
end. However, reading from i2c is very problematic, since it sometimes
read from the wrong place. On the tests I did here, the original drivers
weren't reading back the firmware version, probably due to this bug.

Cheers,
Mauro.

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v2.0.12 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
  
 iQEcBAEBAgAGBQJLVH6/AAoJEDX/lZlmjdJlA/0H/jkn4I3kELEWPeDDYJvv/+Z0
 LsSLzmDJmQ0WgASjtJQ2QZvsDeuCsbzV9mTHGvI0dOGtOLqcBuMX58ZFTerZodrG
 b/KdwZa2OV0MWXc+5hf2+3wEC1icfMATKiwsT3gLdvP9En4MtUP8ImaXFWwW7ekL
 aH5TD666nGewj4+Ef5eVY0G+FypqzNcs4F04uY5ydBaVDh5XTONhXPaLz/R5JF0K
 ivKT4WL7n8A7bq8iAn6SoMJRV/RbEpGF40m4aApVDd+JdizFIH7xrTGQ4waQO6IN
 mplAcxIhq6bEHhwZRfbbnTNMTWUVPShqqqxC5Z0TxCiUR0RH6JdXagQtw/1/UX0=
 =Qqmr
 -END PGP SIGNATURE-
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Terratec Cinergy Hybrid XE (TM6010 Mediachip)

2010-01-25 Thread Stefan Ringel
Am 25.01.2010 15:35, schrieb Mauro Carvalho Chehab:
 Stefan Ringel wrote:
   
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
  
 Hi Davin,
 I have a question. How are loaded the base firmware into xc3028, in
 once or in a split ? It's importent for TM6010, the USB-Analyzer said
 that it load it in once and then send a quitting reqeuest.
 
 The way the original driver for tm6000/tm6010 does varies from firmware
 version to firmware version. That part of the driver works fine for
 both tm6000 and tm6010, with the devices I used here, with firmwares 1.e 
 and 2.7. However, on tm6000, it sends the firmware on packages with
 up to 12 or 13 bytes, and it requires a delay before sending the next
 packet, otherwise the tm6000 hangs.

 Another problem is that the firmware load may fail (due to the bad
 implementation of the i2c on tm6000/tm6010). So, the code should ideally
 check if the firmware were loaded, by reading the firmware version at the
 end. However, reading from i2c is very problematic, since it sometimes
 read from the wrong place. On the tests I did here, the original drivers
 weren't reading back the firmware version, probably due to this bug.
   
My hybrid-stick with tm6010 chip use a special request ( requests 0x32 +
0x33) for quitting i2c transfer. so it can write correct the firmware
and can read tuner number and versions. Actually I tested next patch for
sync between tuner and demodulator and I have data by scanning digital
channels (one time), but  other test dos not data. I've test firmware
load 13, 64  and 3500 bytes and all works.

Cheers,

Stefan Ringel

-- 
Stefan Ringel stefan.rin...@arcor.de

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Terratec Cinergy Hybrid XE (TM6010 Mediachip)

2010-01-25 Thread Stefan Ringel
Am 25.01.2010 20:55, schrieb Mauro Carvalho Chehab:
 Stefan Ringel wrote:
   
 Am 25.01.2010 20:29, schrieb Mauro Carvalho Chehab:
 
 Stefan Ringel wrote:
   
   
 Am 25.01.2010 15:35, schrieb Mauro Carvalho Chehab:
 
 
 Stefan Ringel wrote:
   
   
   
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
  
 Hi Davin,
 I have a question. How are loaded the base firmware into xc3028, in
 once or in a split ? It's importent for TM6010, the USB-Analyzer said
 that it load it in once and then send a quitting reqeuest.
 
 
 
 The way the original driver for tm6000/tm6010 does varies from firmware
 version to firmware version. That part of the driver works fine for
 both tm6000 and tm6010, with the devices I used here, with firmwares 1.e 
 and 2.7. However, on tm6000, it sends the firmware on packages with
 up to 12 or 13 bytes, and it requires a delay before sending the next
 packet, otherwise the tm6000 hangs.

 Another problem is that the firmware load may fail (due to the bad
 implementation of the i2c on tm6000/tm6010). So, the code should ideally
 check if the firmware were loaded, by reading the firmware version at the
 end. However, reading from i2c is very problematic, since it sometimes
 read from the wrong place. On the tests I did here, the original drivers
 weren't reading back the firmware version, probably due to this bug.
   
   
   
 My hybrid-stick with tm6010 chip use a special request ( requests 0x32 +
 0x33) for quitting i2c transfer.
 
 
 Someone once commented that there are some procedures to reset I2C bank
 on tm6010. Maybe that's the meaning for the requests to 0x32/0x33.

   
   
 so it can write correct the firmware
 and can read tuner number and versions. Actually I tested next patch for
 sync between tuner and demodulator and I have data by scanning digital
 channels (one time), but  other test dos not data. I've test firmware
 load 13, 64  and 3500 bytes and all works.
 
 
 3500? That's weird! the maximum allowed size for URB control transfer is 80.
   
   
 from xc3028 send max 3500 byte and then in i2c_xfer function it split to
 80 byte.
 for example

 xc3028 -- 3500 byte  -- quit (base firmware subaddresse 0x2a 3411 byte)
 tm6000_i2c_xfer -- 80 byte 80 byte  80 byte --- quit
 
 Well, the better is to limit the size at xc3028 level, just like the other 
 drivers.
 I'm afraid that letting it pass 3500 bytes will cause kernel hangups on some
 drivers that aren't prepared for it.

 Cheers,
 Mauro.
   
Hi,

I found digital channel second time today, Last Saturday I found first
time. But it has over hack demodulator.

Cheers

Stefan Ringel



-- 
Stefan Ringel stefan.rin...@arcor.de

linux-v5dy:/usr/src/src/tm6000/v4l-dvb # scan /usr/share/dvb/dvb-t/de-Berlin 
scanning /usr/share/dvb/dvb-t/de-Berlin  
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'   
initial transponder 17750 1 3 9 1 2 4 0  
initial transponder 19150 1 2 9 1 2 4 0  
initial transponder 50600 0 2 9 1 2 4 0  
initial transponder 52200 0 2 9 1 2 4 0  
initial transponder 57000 0 2 9 1 2 4 0  
initial transponder 61800 0 2 9 3 2 4 0  
initial transponder 65800 0 2 9 1 2 4 0  
initial transponder 75400 0 2 9 1 2 4 0  
initial transponder 77800 0 2 9 1 2 4 0  
initial transponder 61800 0 1 9 1 2 4 0  
 tune to: 
 17750:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_16:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_NONE
WARNING: filter timeout pid 0x0011  
   
WARNING: filter timeout pid 0x  
   
WARNING: filter timeout pid 0x0010  
   
 tune to: 
 19150:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_2_3:FEC_AUTO:QAM_16:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_NONE
WARNING: filter timeout pid 0x0011  
   
WARNING: filter timeout pid 0x  
   
WARNING: filter timeout pid 0x0010  
   
 tune to: 
 50600:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_16:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_NONE

Re: Terratec Cinergy Hybrid XE (TM6010 Mediachip)

2010-01-18 Thread Stefan Ringel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Hi Davin,
I have a question. How are loaded the base firmware into xc3028, in
once or in a split ? It's importent for TM6010, the USB-Analyzer said
that it load it in once and then send a quitting reqeuest.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iQEcBAEBAgAGBQJLVH6/AAoJEDX/lZlmjdJlA/0H/jkn4I3kELEWPeDDYJvv/+Z0
LsSLzmDJmQ0WgASjtJQ2QZvsDeuCsbzV9mTHGvI0dOGtOLqcBuMX58ZFTerZodrG
b/KdwZa2OV0MWXc+5hf2+3wEC1icfMATKiwsT3gLdvP9En4MtUP8ImaXFWwW7ekL
aH5TD666nGewj4+Ef5eVY0G+FypqzNcs4F04uY5ydBaVDh5XTONhXPaLz/R5JF0K
ivKT4WL7n8A7bq8iAn6SoMJRV/RbEpGF40m4aApVDd+JdizFIH7xrTGQ4waQO6IN
mplAcxIhq6bEHhwZRfbbnTNMTWUVPShqqqxC5Z0TxCiUR0RH6JdXagQtw/1/UX0=
=Qqmr
-END PGP SIGNATURE-

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Terratec Cinergy Hybrid XE (TM6010 Mediachip)

2010-01-18 Thread Devin Heitmueller
On Mon, Jan 18, 2010 at 10:31 AM, Stefan Ringel stefan.rin...@arcor.de wrote:
 I have a question. How are loaded the base firmware into xc3028, in
 once or in a split ? It's importent for TM6010, the USB-Analyzer said
 that it load it in once and then send a quitting reqeuest.

In most drivers, the xc3028 firmware gets broken down and sent in 64
byte chunks.  The size of the chunks is controlled by the max_len
field in the xc2028_ctrl structure.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Terratec Cinergy Hybrid XE (TM6010 Mediachip)

2010-01-17 Thread Stefan Ringel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Hi Mauro,

have you read my thread?
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iQEcBAEBAgAGBQJLU1GGAAoJEDX/lZlmjdJl8E0H/R3uhrjOuGT+6HcRWwE7p6aY
fL9luyYWG79Vx4/VfBWubt7fAqE9TZ/M8+CRCri5rEPr3x4HtOqW3hrN+pmIfabH
5llg7NcZUzekjFZMRb7zhKOX8ErP4p2H5FxbFTxd8EU7AwlHvYuMXnGbaCncj7mT
OOdel4QgkMVFnvaegiQALXT4+hmobjYkMZ6KyPUVsLM5gMVFM0BCQDTXCFN1HSUi
cwkflFfaUKanNriGuzc1fsuN8VtMUiH19Nl44rS9+y6eim72ORKn24UECq4unedb
LslFASNYe5ATe/o2YA1MdoQWhR7xA6J6rO2EmOtU5y8w6XlytKHvQWm31iSvqqQ=
=TWl6
-END PGP SIGNATURE-

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Terratec Cinergy Hybrid XE (TM6010 Mediachip)

2010-01-15 Thread Stefan Ringel
I have bug-fix (tm6000.patch) my first problem, so that it loads the
tuner and demodulator (message). But I cannot find digital channels. It
was wrong with the tuner (xc3028) or demodulator (zl10353)? Under
windows xp it found digital channels (region Germany Berlin).


-- 
Stefan Ringel stefan.rin...@arcor.de

diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c
index 59fb505..334dea9 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -32,7 +32,7 @@
 #include tm6000.h
 #include tm6000-regs.h
 #include tuner-xc2028.h
-#include tuner-xc5000.h
+#include xc5000.h
 
 #define TM6000_BOARD_UNKNOWN			0
 #define TM5600_BOARD_GENERIC			1
@@ -44,6 +44,10 @@
 #define TM6000_BOARD_FREECOM_AND_SIMILAR	7
 #define TM6000_BOARD_ADSTECH_MINI_DUAL_TV	8
 #define TM6010_BOARD_HAUPPAUGE_900H		9
+#define TM6010_BOARD_BEHOLD_WANDER		10
+#define TM6010_BOARD_BEHOLD_VOYAGER		11
+#define TM6010_BOARD_TERRATEC_CINERGY_HYBRID_XE	12
+
 
 #define TM6000_MAXBOARDS16
 static unsigned int card[] = {[0 ... (TM6000_MAXBOARDS - 1)] = UNSET };
@@ -208,7 +212,21 @@ struct tm6000_board tm6000_boards[] = {
 		},
 		.gpio_addr_tun_reset = TM6000_GPIO_2,
 	},
-
+	[TM6010_BOARD_TERRATEC_CINERGY_HYBRID_XE] = {
+		.name = Terratec Cinergy Hybrid XE,
+		.tuner_type   = TUNER_XC2028, /* has a XC3028 */
+		.tuner_addr   = 0xc2  1,
+		.demod_addr   = 0x1e  1,
+		.type = TM6010,
+		.caps = {
+			.has_tuner= 1,
+			.has_dvb  = 1,
+			.has_zl10353  = 1,
+			.has_eeprom   = 1,
+			.has_remote   = 1,
+		},
+		.gpio_addr_tun_reset = TM6000_GPIO_2,
+	}
 };
 
 /* table of devices that work with this driver */
@@ -221,6 +239,7 @@ struct usb_device_id tm6000_id_table [] = {
 	{ USB_DEVICE(0x2040, 0x6600), .driver_info = TM6010_BOARD_HAUPPAUGE_900H },
 	{ USB_DEVICE(0x6000, 0xdec0), .driver_info = TM6010_BOARD_BEHOLD_WANDER },
 	{ USB_DEVICE(0x6000, 0xdec1), .driver_info = TM6010_BOARD_BEHOLD_VOYAGER },
+	{ USB_DEVICE(0x0ccd, 0x0086), .driver_info = TM6010_BOARD_TERRATEC_CINERGY_HYBRID_XE },
 	{ },
 };
 
@@ -305,12 +324,14 @@ static void tm6000_config_tuner (struct tm6000_core *dev)
 		ctl.mts   = 1;
 		ctl.read_not_reliable = 1;
 		ctl.msleep = 10;
-
+		ctl.demod = XC3028_FE_ZARLINK456;
+		
 		xc2028_cfg.tuner = TUNER_XC2028;
 		xc2028_cfg.priv  = ctl;
 
 		switch(dev-model) {
 		case TM6010_BOARD_HAUPPAUGE_900H:
+		case TM6010_BOARD_TERRATEC_CINERGY_HYBRID_XE:
 			ctl.fname = xc3028L-v36.fw;
 			break;
 		default:
@@ -402,6 +423,7 @@ static int tm6000_init_dev(struct tm6000_core *dev)
 		}
 #endif
 	}
+	return 0;
 
 err2:
 	v4l2_device_unregister(dev-v4l2_dev);
@@ -465,7 +487,7 @@ static int tm6000_usb_probe(struct usb_interface *interface,
 	}
 
 	/* Create and initialize dev struct */
-	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+	dev = kzalloc(sizeof(*(dev)), GFP_KERNEL);
 	if (dev == NULL) {
 		printk (tm6000 : out of memory!\n);
 		usb_put_dev(usbdev);
diff --git a/drivers/staging/tm6000/tm6000-core.c b/drivers/staging/tm6000/tm6000-core.c
index d41af1d..74f9348 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -394,7 +394,15 @@ struct reg_init tm6010_init_tab[] = {
 	{ REQ_07_SET_GET_AVREG, 0x3f, 0x00 },
 
 	{ REQ_05_SET_GET_USBREG, 0x18, 0x00 },
-
+	
+	/* additional from Terratec Cinergy Hybrid XE */
+	{ REQ_07_SET_GET_AVREG, 0xdc, 0xaa },
+	{ REQ_07_SET_GET_AVREG, 0xdd, 0x30 },
+	{ REQ_07_SET_GET_AVREG, 0xde, 0x20 },
+	{ REQ_07_SET_GET_AVREG, 0xdf, 0xd0 },
+	{ REQ_04_EN_DISABLE_MCU_INT, 0x02, 0x00 },
+	{ REQ_07_SET_GET_AVREG, 0xd8, 0x2f },
+	
 	/* set remote wakeup key:any key wakeup */
 	{ REQ_07_SET_GET_AVREG,  0xe5,  0xfe },
 	{ REQ_07_SET_GET_AVREG,  0xda,  0xff },
@@ -404,6 +412,7 @@ int tm6000_init (struct tm6000_core *dev)
 {
 	int board, rc=0, i, size;
 	struct reg_init *tab;
+	u8 buf[40];
 
 	if (dev-dev_type == TM6010) {
 		tab = tm6010_init_tab;
@@ -424,61 +433,129 @@ int tm6000_init (struct tm6000_core *dev)
 		}
 	}
 
-	msleep(5); /* Just to be conservative */
-
-	/* Check board version - maybe 10Moons specific */
-	board=tm6000_get_reg16 (dev, 0x40, 0, 0);
-	if (board =0) {
-		printk (KERN_INFO Board version = 0x%04x\n,board);
-	} else {
-		printk (KERN_ERR Error %i while retrieving board version\n,board);
-	}
-
+	/* hack */
 	if (dev-dev_type == TM6010) {
-		/* Turn xceive 3028 on */
-		tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, TM6010_GPIO_3, 0x01);
-		msleep(11);
-	}
-
-	/* Reset GPIO1 and GPIO4. */
-	for (i=0; i 2; i++) {
-		rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
-	dev-tuner_reset_gpio, 0x00);
-		if (rc0) {
-			printk (KERN_ERR Error %i doing GPIO1 reset\n,rc);
-			return rc;
-		}
-
-		msleep(10); /* Just to be conservative */
-		rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
-	dev-tuner_reset_gpio, 0x01);
-		if (rc0) {
-			printk (KERN_ERR Error %i doing GPIO1 reset\n,rc);
-			return rc;
-		}
-
-		msleep(10);
-		rc=tm6000_set_reg (dev, 

Terratec Cinergy Hybrid XE (TM6010 Mediachip)

2010-01-13 Thread Stefan Ringel
I found a bug in tm6000 module.

-- 
Stefan Ringel stefan.rin...@arcor.de

Jan 13 20:23:22 linux-v5dy kernel: [  186.452166] BUG: unable to handle kernel 
NULL pointer dereference at (null)
Jan 13 20:23:22 linux-v5dy kernel: [  186.452189] IP: [a1720c62] 
tm6000_read_write_usb+0x92/0x490 [tm6000]
Jan 13 20:23:22 linux-v5dy kernel: [  186.452212] PGD 55136067 PUD 55392067 PMD 
0 
Jan 13 20:23:22 linux-v5dy kernel: [  186.452223] Oops:  [#1] PREEMPT SMP 
Jan 13 20:23:22 linux-v5dy kernel: [  186.452232] last sysfs file: 
/sys/devices/system/cpu/cpu1/cache/index2/shared_cpu_map
Jan 13 20:23:22 linux-v5dy kernel: [  186.452244] CPU 0 
Jan 13 20:23:22 linux-v5dy kernel: [  186.452249] Modules linked in: mxb 
hexium_orion gspca_sunplus ov7670 tm6000 gspca_jeilinj gspca_sq905 
gspca_sn9c20x gspca_spca561 vivi radio_maestro tuner gspca_stk014 
dvb_usb_umt_010 gspca_benq dvb_usb_nova_t_usb2 au0828 tda9875 gspca_etoms 
vpx3220 radio_gemtek_pci cpia_usb saa6588 vp27smpx konicawc gspca_spca505 
upd64031a tvaudio radio_mr800 bt819 saa7110 gspca_conex gspca_mars 
gspca_finepix quickcam_messenger cs53l32a dvb_usb_dibusb_mc tvp5150 cx2341x 
gspca_stv0680 cx88xx usbvision mantis ths7303 m52790 gspca_spca506 
gspca_spca501 gspca_ov534 w9968cf saa7185 dvb_ttpci ks0127 cpia2 
dvb_usb_dibusb_mb zr36067 hdpvr radio_si4713 tvp514x budget_av cx231xx 
gspca_sonixj gspca_ov519 saa6752hs cs5345 cafe_ccic saa5249 upd64083 ultracam 
mt9v011 radio_maxiradio gspca_spca500 gspca_pac7311 saa7115 dsbr100 au8522 
saa7134 cpia_pp wm8775 dvb_usb_a800 si4713_i2c tda9840 bttv gspca_stv06xx 
tlv320aic23b saa717x ovcamchip hexium_gemini ibmcam tef6862 radio_usb_si470x 
adv7343 saa7127 msp3400 em2
Jan 13 20:23:22 linux-v5dy kernel: 8xx saa7191 bt866 gspca_tv8532 tea6420 
gspca_pac7302 gspca_zc3xx gspca_pac207 gspca_vc032x gspca_mr97310a adv7180 
gspca_gl860 saa5246a tda7432 dvb_usb_ec168 budget_patch ov511 dvb_usb_dw2102 
stradis snd_tea575x_tuner se401 dvb_usb_anysee pwc bw_qcam uvcvideo stv680 
b2c2_flexcop_usb dvb_usb_cinergyT2 dvb_usb_au6610 dvb_usb_m920x dvb_usb_dib0700 
dvb_usb_vp702x et61x251 v4l2_common zc0301 stkwebcam dvb_usb_cxusb mantis_core 
dm1105 dvb_usb_opera c_qcam dvb_usb_dtv5100 zr364xx saa7146_vv dvb_usb_vp7045 
vicam dvb_usb_gl861 dvb_usb_dtt200u dvb_usb_digitv dvb_usb_friio budget 
usbvideo soc_camera_platform radio_tea5764 budget_ci dvb_usb_gp8psk gspca_main 
ir_kbd_i2c dvb_usb_ce6230 meye b2c2_flexcop_pci cpia dvb_usb_af9005 
dvb_usb_af9015 sn9c102 s2255drv dvb_usb_ttusb2 dvb_usb_dibusb_common w9966 
lgdt3305 budget_core stv0299 pluto2 dib7000m dib7000p tcm825x b2c2_flexcop 
smssdio ir_common zr36050 lgdt330x zr36016 smsusb videobuf_vmalloc or51132 
videodev ttusb_dec zr36060 smsdvb saa7164 dib3000mc 
Jan 13 20:23:22 linux-v5dy kernel: dib8000 tuner_simple dvb_usb videobuf_dma_sg 
dvb_ttusb_budget or51211 firedtv videobuf_dvb videobuf_dma_contig earth_pt1 
stv0288 stb0899 sp887x v4l2_compat_ioctl32 s5h1409 mt2266 soc_mediabus ds3000 
tuner_types tda10023 tua6100 mt20xx btcx_risc tda18271 cx22702 videocodec 
tda10086 tea5767 mt312 s921 max2165 dvb_dummy_fe tda8261 qt1010 af9013 
cx88_vp3054_i2c tda1004x tda665x nxt200x ves1820 bcm3510 isl6423 zl10036 
mxl5007t drx397xD sp8870 cx24113 tda8290 l64781 cx24110 tda827x dabusb saa7146 
ttpci_eeprom stb6100 tda10048 tda826x ttusbdecfe s5h1411 lgdt3304 ves1x93 
stv0297 dib3000mb tda8083 lnbp21 zl10039 dibx000_common snd_bt87x ir_core 
tda9887 isl6421 mt2060 mb86a16 zl10353 tda10021 dvb_usb_af9005_remote cx22700 
lgs8gxx s5h1420 mt352 v4l1_compat dvb_core isl6405 xc5000 ec100 tea5761 
stv6110x mxl5005s dvb_pll dib0090 stb6000 v4l2_int_device mt2131 videobuf_core 
tveeprom stv0900 lgs8gl5 atbm8830 stv6110 mc44s803 cx24116 cx24123 stv090x 
dib0070 si21xx tuner_xc2028 nxt6000 itd1000 smsmdtv
Jan 13 20:23:22 linux-v5dy kernel: sony_laptop rfkill mmc_core i2c_algo_bit 
ip6t_LOG xt_tcpudp xt_pkttype ipt_LOG xt_limit snd_pcm_oss snd_mixer_oss 
snd_seq snd_seq_device edd vmnet ppdev parport_pc parport vmblock vsock vmci 
vmmon af_packet ip6t_REJECT nf_conntrack_ipv6 ip6table_raw xt_NOTRACK 
ipt_REJECT xt_state iptable_raw iptable_filter ip6table_mangle 
nf_conntrack_netbios_ns nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 ip_tables 
ip6table_filter cpufreq_conservative cpufreq_userspace ip6_tables 
cpufreq_powersave x_tables powernow_k8 fuse nls_iso8859_1 nls_cp437 vfat fat 
loop dm_mod snd_hda_codec_intelhdmi snd_hda_codec_analog amd64_edac_mod 
snd_hda_intel ohci1394 snd_hda_codec edac_core sg sr_mod snd_hwdep ieee1394 
edac_mce_amd nvidia(P) cdrom snd_pcm k8temp snd_timer serio_raw forcedeth 
i2c_nforce2 snd snd_page_alloc asus_atk0110 pcspkr button ext4 jbd2 crc16 fan 
processor ide_pci_generic amd74xx ide_core ata_generic thermal thermal_sys 
pata_amd sata_nv
Jan 13 20:23:22 linux-v5dy kernel: [  186.453006] Pid: 5751, comm: v4l_id 
Tainted: P   2.6.32-41.6-desktop #1 System Product Name
Jan 13 20:23:22 linux-v5dy kernel: [  186.453006] RIP: 
0010:[a1720c62] 

Terratec Cinergy Hybrid XE (TM6010 Mediachip)

2010-01-10 Thread Stefan Ringel
hello linuxtv.org developers,

I have the TerraTec Cinergy Hybrid XE. (idVendor=0x0ccd, idProduct=0x0086).

lsusb:

Bus 001 Device 004: ID 0ccd:0086 TerraTec Electronic GmbH 
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0 
  bDeviceProtocol 0 
  bMaxPacketSize064
  idVendor   0x0ccd TerraTec Electronic GmbH
  idProduct  0x0086 
  bcdDevice0.01
  iManufacturer  16 
  iProduct   32 
  iSerial64 0008CA123456
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength  129
bNumInterfaces  1
bConfigurationValue 1
iConfiguration 48 2.0
bmAttributes 0xa0
  (Bus Powered)
  Remote Wakeup
MaxPower  500mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   3
  bInterfaceClass   255 Vendor Specific Class
  bInterfaceSubClass  0 
  bInterfaceProtocol255 
  iInterface  0 
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes1
  Transfer TypeIsochronous
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x  1x 0 bytes
bInterval   1
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82  EP 2 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83  EP 3 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x  1x 0 bytes
bInterval   1
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   1
  bNumEndpoints   3
  bInterfaceClass   255 Vendor Specific Class
  bInterfaceSubClass  0 
  bInterfaceProtocol255 
  iInterface  0 
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes1
  Transfer TypeIsochronous
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x1400  3x 1024 bytes
bInterval   1
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82  EP 2 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83  EP 3 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0004  1x 4 bytes
bInterval   1
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   2
  bNumEndpoints   3
  bInterfaceClass   255 Vendor Specific Class
  bInterfaceSubClass  0 
  bInterfaceProtocol255 
  iInterface  0 
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes1
  Transfer TypeIsochronous
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x  1x 0 bytes
bInterval   1
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82  EP 2 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval