[PATCH] em28xx: fix for Dikom DK300 hybrid USB tuner (aka Kworld VS-DVB-T 323UR )

2009-11-22 Thread andrea.amoros...@gmail.com

This patch fix the Dikom DK300 hybrid usb card which is recognized as a
Kworld VS-DVB-T 323UR (card=54).

The patch adds digital tv and solves analogue tv audio bad quality issue.
Moreover it removes the composite and s-video analogue inputs which are 
not present on the board.


Not tested: remote controller
To be done: I attach the usbsnoop obtained some month ago using windows xp.
It seems that with the proposed patch the digital demodulator remains 
activated if the tuner is switched from digital to analogue mode.
Workaorund is to unplug and replug the device when switching from 
digital to analogue.
If someone can explain how to verify the gpio settings using the 
usbsnoop, the above issue perhaps can be resolved.


Signed-off-by: Andrea Amorosi andrea.amoros...@gmail.com

diff -r aba823ecaea6 linux/drivers/media/video/em28xx/em28xx-cards.c
--- a/linux/drivers/media/video/em28xx/em28xx-cards.c	Thu Nov 12 
12:21:05 2009 -0200
+++ b/linux/drivers/media/video/em28xx/em28xx-cards.c	Sun Nov 22 
11:50:29 2009 +0100

@@ -1422,19 +1422,25 @@
.tuner_type   = TUNER_XC2028,
.tuner_gpio   = default_tuner_gpio,
.decoder  = EM28XX_TVP5150,
+.mts_firmware = 1,
+.has_dvb  = 1,
+.dvb_gpio = kworld_330u_digital, 



.input= { {
.type = EM28XX_VMUX_TELEVISION,
.vmux = TVP5150_COMPOSITE0,
.amux = EM28XX_AMUX_VIDEO,
-   }, {
+   .gpio = default_analog,
+   },/* {
.type = EM28XX_VMUX_COMPOSITE1,
.vmux = TVP5150_COMPOSITE1,
.amux = EM28XX_AMUX_LINE_IN,
+   .gpio = kworld_330u_analog,
}, {
.type = EM28XX_VMUX_SVIDEO,
.vmux = TVP5150_SVIDEO,
.amux = EM28XX_AMUX_LINE_IN,
-   } },
+   .gpio = kworld_330u_analog,
+   } */},
},
[EM2882_BOARD_TERRATEC_HYBRID_XS] = {
.name = Terratec Hybrid XS (em2882),
@@ -2143,6 +2149,7 @@
ctl-demod = XC3028_FE_DEFAULT;
break;
case EM2883_BOARD_KWORLD_HYBRID_330U:
+   case EM2882_BOARD_KWORLD_VS_DVBT:
ctl-demod = XC3028_FE_CHINA;
ctl-fname = XC2028_DEFAULT_FIRMWARE;
break;
diff -r aba823ecaea6 linux/drivers/media/video/em28xx/em28xx-dvb.c
--- a/linux/drivers/media/video/em28xx/em28xx-dvb.c	Thu Nov 12 12:21:05 
2009 -0200
+++ b/linux/drivers/media/video/em28xx/em28xx-dvb.c	Sun Nov 22 11:50:29 
2009 +0100

@@ -504,6 +504,7 @@
break;
case EM2880_BOARD_TERRATEC_HYBRID_XS:
case EM2881_BOARD_PINNACLE_HYBRID_PRO:
+   case EM2882_BOARD_KWORLD_VS_DVBT:
dvb-frontend = dvb_attach(zl10353_attach,
   em28xx_zl10353_xc3028_no_i2c_gate,
   dev-i2c_adap);




parsed_UsbSnoop.log.tar.gz
Description: application/gzip


Re: [PATCH] em28xx: fix for Dikom DK300 hybrid USB tuner (aka Kworld VS-DVB-T 323UR ) (digital mode)

2009-11-18 Thread andrea.amoros...@gmail.com

Devin Heitmueller ha scritto:

On Mon, Nov 16, 2009 at 3:49 PM, andrea.amoros...@gmail.com
andrea.amoros...@gmail.com wrote:
  

The usb is the following:
Bus 002 Device 010: ID eb1a:e312 eMPIA Technology, Inc.
(I don't remember what it was previously, but it seems wrong how can I be
sure about that?).
I have put back the driver to the original state, but still it doesn't work.
Did I have to reprogram the eprom? If so, it is possible via usb?
Thank you,
Andrea

PS I've found an old dmesg.
The USB ID is wrong! The old one was eb1a:e323



Ok, so that confirms that indeed the eeprom was corrupted.  I would
suggest you hack the USB_DEVICE() entry in em28xx-cards.c to be
eb1a:e312.  This will allow the driver to load and the i2c device to
be setup.  Then use the eeprom repair script to rewrite the eeprom.
At that point you should be able to remove the hack, because the USB
ID will be back to eb1a:e323.

Devin

  

Ok Devin!
It works again!!!
If you come in Trieste, let me know and I'll pay you a beer :-)
I can also confirm that the digital_defaul gpio does not work so the 
kworld_330u_digital gpio is needed.
In any case I've an usbsnoop of this device but I don't know what I've 
to search in that 125Mb log text file.
I've parsed it with the parse _snifusb2.pl tool and the result is the 
attached files.
Still I don't know what to search to extract the gpio for analog and 
digital tv.
If someone can explain me some basis, maybe I can validate the actual 
assumptions made in the driver as far as the gpio is concerned.
In particular I suspect that the digital demodulator remains active when 
switching from digital to analog tv.


Andrea









parsed_UsbSnoop.log.tar.gz
Description: application/gzip


Re: [PATCH] em28xx: fix for Dikom DK300 hybrid USB tuner (aka Kworld VS-DVB-T 323UR ) (digital mode)

2009-11-16 Thread Devin Heitmueller
On Mon, Nov 16, 2009 at 3:38 PM, andrea.amoros...@gmail.com
andrea.amoros...@gmail.com wrote:
 The usb is the following:
 Bus 002 Device 010: ID eb1a:e312 eMPIA Technology, Inc.
 (I don't remember what it was previously, but it seems wrong how can I be
 sure about that?).
 I have put back the driver to the original state, but still it doesn't work.
 Did I have to reprogram the eprom? If so, it is possible via usb?
 Thank you,
 Andrea

Well, according to em28xx-cards.c, the EM2882_BOARD_KWORLD_VS_DVBT is
eb1a:e323.  You can probably just the USB_DEVICE() entry to say e312,
and that will allow the driver to load (at which point you can then
reprogram the eeprom back to its previous state).

I assume that when you used the eeprom rewrite script, that you used a
copy of *YOUR* dmesg output from before the problem?  You cannot use
someone else's dmesg output, as that may not actually match your
device.

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: [PATCH] em28xx: fix for Dikom DK300 hybrid USB tuner (aka Kworld VS-DVB-T 323UR ) (digital mode)

2009-11-16 Thread Devin Heitmueller
On Mon, Nov 16, 2009 at 3:49 PM, andrea.amoros...@gmail.com
andrea.amoros...@gmail.com wrote:
 The usb is the following:
 Bus 002 Device 010: ID eb1a:e312 eMPIA Technology, Inc.
 (I don't remember what it was previously, but it seems wrong how can I be
 sure about that?).
 I have put back the driver to the original state, but still it doesn't work.
 Did I have to reprogram the eprom? If so, it is possible via usb?
 Thank you,
 Andrea

 PS I've found an old dmesg.
 The USB ID is wrong! The old one was eb1a:e323

Ok, so that confirms that indeed the eeprom was corrupted.  I would
suggest you hack the USB_DEVICE() entry in em28xx-cards.c to be
eb1a:e312.  This will allow the driver to load and the i2c device to
be setup.  Then use the eeprom repair script to rewrite the eeprom.
At that point you should be able to remove the hack, because the USB
ID will be back to eb1a:e323.

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