Re: Driver for KWorld UB435Q Version 3 (ATSC) USB id: 1b80:e34c

2014-03-03 Thread Mauro Carvalho Chehab
Em Fri, 07 Feb 2014 12:23:36 -0600
The Bit Pit  escreveu:

> Last May I started writing a driver for a KWorld UB435Q Version 3
> tuner.  I was able to make the kernel recognize the device, light it's
> LED, and try to enable the decoder and tuner.
> 
> I was unable to locate any information for the tda18272 tuner chip until
> last week.  I received an email at another address with a pointer to a
> GPL driver that used a tda18272 in a pcie based tuner.  It appears that
> a bit of refactoring has been done to v4l2 since it was written.  I want
> to try to incorporate it into the kernel tree properly while making the
> KWorld UB435Q Version 3 usable under linux.
> 
> Would the tda18271 be a good model?
> 
> The tda18271 organized with part in tuners and part in dvb-frontends. 
> What is the dvb-frontends stuff used for?
> 
> The tda18271 files in kernel are:
> 
> ./media/tuners/tda18271-maps.c
> ./media/tuners/tda18271-fe.c
> ./media/tuners/tda18271.h
> ./media/tuners/tda18271-priv.h
> ./media/tuners/tda18271-common.c
> ./media/dvb-frontends/tda18271c2dd.c
> ./media/dvb-frontends/tda18271c2dd.h
> ./media/dvb-frontends/tda18271c2dd_maps.h
> 
> The tda18272 files I located are:
> 
> ./media/dvb/frontends/tda18272_reg.h
> ./media/dvb/frontends/tda18272.h
> ./media/dvb/frontends/tda18272.c
> 
> The tuner is only used in digital mode with KWorld UB435Q Version 3. 
> The tda18272 supports both digital and analog.  Should I include the
> analog support in the tda18272 files without testing it?

tda18272 is a variant of tda18212. Adding support for ATSC there is as
trivial as:

http://git.linuxtv.org/mchehab/experimental.git/commitdiff/14d276136221f98e2351841adb841cd420665090

Anyway, I just added support for ub435q v3 on my experimental tree:
 
http://git.linuxtv.org/mchehab/experimental.git/shortlog/refs/heads/ub435q_v3

For now, I tested only 8VSB modulation. I'll test later for ClearQAM.

Regards,
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: Driver for KWorld UB435Q Version 3 (ATSC) USB id: 1b80:e34c

2014-02-07 Thread Steven Toth
> Thanks steve,

You are very welcome.

>
> Found it.  Its the same files I found at a different place.  I don't
> understand the way to do things.
> Last time I simply edited the kernel tree and supplied patches to get my
> changes in.  The source for  tda18272 is not in the kernel tree I 'git'
> following the instructions at linuxtv.org.  It is in Manu's tree, but
> the directory structure is slightly different.

That's ok. Anything that gets submitted for upstream merge (by manu
for example) would be moved into the correct directories by the
developer. It's not unusual to see personal development trees with odd
file placements.

>
> I don't understand the current development process.  Are the
> instructions at linuxtv.org out of date?

No, last I checked they were correct.

>
> In which tree should I edit the following and supply patches against:
> usb/em28xx/em28xx-cards.c
> usb/em28xx/em28xx-dvb.c
> usb/em28xx/em28xx.h

http://git.linuxtv.org/media_tree.git

- Steve

-- 
Steven Toth - 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: Driver for KWorld UB435Q Version 3 (ATSC) USB id: 1b80:e34c

2014-02-07 Thread Steven Toth
> If you need, I can push the 7231 tree up as well for upstream merge.

That would be great Manu! Yes please.

-- 
Steven Toth - 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: Driver for KWorld UB435Q Version 3 (ATSC) USB id: 1b80:e34c

2014-02-07 Thread Manu Abraham
On Sat, Feb 8, 2014 at 12:09 AM, Steven Toth  wrote:
> On Fri, Feb 7, 2014 at 1:23 PM, The Bit Pit  wrote:
>> Last May I started writing a driver for a KWorld UB435Q Version 3
>> tuner.  I was able to make the kernel recognize the device, light it's
>> LED, and try to enable the decoder and tuner.
>
> Slightly related I added support for the KWorld UB445-U2
> ATSC/Analog stick the other day. It uses the cx231xx bridge, LG3305
> and TDA18272 tuner. It was fairly simple to get running. Analog and
> digital TV work OK, the baseband inputs and alsa are running. No great
> shakes.
>
> Manu has a TDA18272 Linux tree if you google a little.


If you need, I can push the 7231 tree up as well for upstream merge.
--
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: Driver for KWorld UB435Q Version 3 (ATSC) USB id: 1b80:e34c

2014-02-07 Thread The Bit Pit
Thanks steve,

Found it.  Its the same files I found at a different place.  I don't
understand the way to do things.
Last time I simply edited the kernel tree and supplied patches to get my
changes in.  The source for  tda18272 is not in the kernel tree I 'git'
following the instructions at linuxtv.org.  It is in Manu's tree, but
the directory structure is slightly different.

I don't understand the current development process.  Are the
instructions at linuxtv.org out of date?

In which tree should I edit the following and supply patches against:
usb/em28xx/em28xx-cards.c
usb/em28xx/em28xx-dvb.c
usb/em28xx/em28xx.h

On 02/07/2014 12:39 PM, Steven Toth wrote:
> On Fri, Feb 7, 2014 at 1:23 PM, The Bit Pit  wrote:
>> Last May I started writing a driver for a KWorld UB435Q Version 3
>> tuner.  I was able to make the kernel recognize the device, light it's
>> LED, and try to enable the decoder and tuner.
> Slightly related I added support for the KWorld UB445-U2
> ATSC/Analog stick the other day. It uses the cx231xx bridge, LG3305
> and TDA18272 tuner. It was fairly simple to get running. Analog and
> digital TV work OK, the baseband inputs and alsa are running. No great
> shakes.
>
> Manu has a TDA18272 Linux tree if you google a little.
>
> - Steve
>

--
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: Driver for KWorld UB435Q Version 3 (ATSC) USB id: 1b80:e34c

2014-02-07 Thread Steven Toth
On Fri, Feb 7, 2014 at 1:23 PM, The Bit Pit  wrote:
> Last May I started writing a driver for a KWorld UB435Q Version 3
> tuner.  I was able to make the kernel recognize the device, light it's
> LED, and try to enable the decoder and tuner.

Slightly related I added support for the KWorld UB445-U2
ATSC/Analog stick the other day. It uses the cx231xx bridge, LG3305
and TDA18272 tuner. It was fairly simple to get running. Analog and
digital TV work OK, the baseband inputs and alsa are running. No great
shakes.

Manu has a TDA18272 Linux tree if you google a little.

- Steve

-- 
Steven Toth - 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


Driver for KWorld UB435Q Version 3 (ATSC) USB id: 1b80:e34c

2014-02-07 Thread The Bit Pit
Last May I started writing a driver for a KWorld UB435Q Version 3
tuner.  I was able to make the kernel recognize the device, light it's
LED, and try to enable the decoder and tuner.

I was unable to locate any information for the tda18272 tuner chip until
last week.  I received an email at another address with a pointer to a
GPL driver that used a tda18272 in a pcie based tuner.  It appears that
a bit of refactoring has been done to v4l2 since it was written.  I want
to try to incorporate it into the kernel tree properly while making the
KWorld UB435Q Version 3 usable under linux.

Would the tda18271 be a good model?

The tda18271 organized with part in tuners and part in dvb-frontends. 
What is the dvb-frontends stuff used for?

The tda18271 files in kernel are:

./media/tuners/tda18271-maps.c
./media/tuners/tda18271-fe.c
./media/tuners/tda18271.h
./media/tuners/tda18271-priv.h
./media/tuners/tda18271-common.c
./media/dvb-frontends/tda18271c2dd.c
./media/dvb-frontends/tda18271c2dd.h
./media/dvb-frontends/tda18271c2dd_maps.h

The tda18272 files I located are:

./media/dvb/frontends/tda18272_reg.h
./media/dvb/frontends/tda18272.h
./media/dvb/frontends/tda18272.c

The tuner is only used in digital mode with KWorld UB435Q Version 3. 
The tda18272 supports both digital and analog.  Should I include the
analog support in the tda18272 files without testing it?


--
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: Driver for KWorld UB435Q Version 3 (ATSC) USB id: 1b80:e34c

2013-05-06 Thread The Bit Pit
On 05/03/2013 04:29 PM, Devin Heitmueller wrote:
> The lgdt3305 is probably on the second i2c bus -- typical for em2874
> based devices. The tuner is probably gated behind the 3305. It's also
> likely that the 3305 is being held in reset by default. You'll
> probably need to tweak a GPIO to take it out of reset before it will
> answer i2c. 
Thanks, I found it on the second i2c bus. I tweaked the GPIO to get is
going. It attached OK.
> One is probably the eeprom.
Right!  It is the eeprom at 0x50 on bus 0.  After I figured out how to
access bus 1, it reports:
[39839.472893] em2874 #0: found i2c device @ 0xc0 on bus 1 [tuner (analog)]
This I assume is the tda18272.

The next challenge is a driver for the tuner tda18272.  There is a
driver for tda18271.  The 10 page product data sheet block diagrams are
different for the tda18271 and tda18272.

I tried to attach the tda18272 as a tda18271 and got:

[39839.510613] tda18271 10-0060: creating new instance
[39839.510615]435 em2874 #0 at em28xx_i2c_xfer: write nonstop addr=c0
len=1: 00
[39839.510992] em2874 #0 at em28xx_i2c_xfer: read stop addr=c0 len=16:
c7 60 11 52 00 02 0c 00 20 80 00 00 c9 0f 3f 35
[39839.512636] Unknown device (199) detected @ 10-0060, device not
supported.
[39839.512640] tda18271_attach: [10-0060|M] error -22 on line 1285
[39839.512642] tda18271 10-0060: destroying instance

There are a few references to 18272 in usb/dvb-usb-v2/rtl28xxu.c  - All
I could see is code to detect the tda18272. I don't understand this code
yet.

If they are similar enough maybe 18271 driver could be modified to
handle the 18272.

Can anyone send me register specs for the tda18272 and tda18271 so I can
figure out how they could be merged. Better yet, maybe someone has
already done this.

Thank you,
Wilson Michaels
--
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: Driver for KWorld UB435Q Version 3 (ATSC) USB id: 1b80:e34c

2013-05-03 Thread Devin Heitmueller
On Fri, May 3, 2013 at 3:50 PM, The Bit Pit  wrote:
> I am Wilson Michaels, please let me introduce myself:
>
> Eight years ago I contributed a driver for the DViCO FusionHDTV 3 & 5
> PCI TV tuner cards (see lgdt330x.c).  The code is still in linux today.
>  One of my tuners is starting to fail so a purchased a KWorld UB435Q
> Version 3 (ATSC) from Newegg.  It's not supported so I started working
> on a driver. Is anyone else working on a driver for the  KWorld UB435Q V-3?
>
> I opened the case easily as it just snaps together with a plastic clip.
> It is not glued :-) I verified that it contains:
> EM2874B
> NXP TDA18272/M
> lgdt3305
>
> I git the latest media_build tree and added entries to make it recognize
> the KWorld USB id: 1b80:e34c.  The added code is like the KWorld UB435Q
> Version 2 code with lgdt3304 replaced by lgdt3305 and no .dvb_gpio or
> .tuner_gpio. It reports finding an em2874 chip using bulk transfer mode
> as expected.

No bulk support currently for em28xx dvb.  I never got around to it
because the only sticks I ever came across them that use them is that
particular KWorld model, and from everything I've heard it's a piece
of garbage (unreliable, prone to failure even under WIndows).

That said, a bulk endpoint driver isn't rocket science to add support for.  :-)

> There appears to be code in the em28xx driver to handle
> bulk transfer.  It does not recognize the lgdt3305.

The lgdt3305 is probably on the second i2c bus -- typical for em2874
based devices.  The tuner is probably gated behind the 3305.

It's also likely that the 3305 is being held in reset by default.
You'll probably need to tweak a GPIO to take it out of reset before it
will answer i2c.

> I discovered (brute force scan) that there are two i2c addresses 0x50
> and 0xd0. The lgdt3305 detection code is able to read something from
> either i2c address, but is is always 0.

One is probably the eeprom.

> Does the eeprom data below have anything to help writing a driver for
> the KWorld UB435Q?

Almost certainly not.

> I suspect some initialization needs to be done, but I don't know what to
> try.  Does anyone have any information about how the hardware is
> configured or information captured from the Windows driver?
>
> Does anyone know where I can get a copy of the programming spec for the
> lgdt3305?  The em2874 spec would be useful too.

I have them both, but under NDA (neither are publicly available).  You
probably don't need either though.  Aside from the bulk support, the
em2874 implementation is pretty complete.  Same goes for the 3305.

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


Driver for KWorld UB435Q Version 3 (ATSC) USB id: 1b80:e34c

2013-05-03 Thread The Bit Pit
I am Wilson Michaels, please let me introduce myself:

Eight years ago I contributed a driver for the DViCO FusionHDTV 3 & 5
PCI TV tuner cards (see lgdt330x.c).  The code is still in linux today.
 One of my tuners is starting to fail so a purchased a KWorld UB435Q
Version 3 (ATSC) from Newegg.  It's not supported so I started working
on a driver. Is anyone else working on a driver for the  KWorld UB435Q V-3?

I opened the case easily as it just snaps together with a plastic clip.
It is not glued :-) I verified that it contains:
EM2874B
NXP TDA18272/M
lgdt3305

I git the latest media_build tree and added entries to make it recognize
the KWorld USB id: 1b80:e34c.  The added code is like the KWorld UB435Q
Version 2 code with lgdt3304 replaced by lgdt3305 and no .dvb_gpio or
.tuner_gpio. It reports finding an em2874 chip using bulk transfer mode
as expected.  There appears to be code in the em28xx driver to handle
bulk transfer.  It does not recognize the lgdt3305.

I discovered (brute force scan) that there are two i2c addresses 0x50
and 0xd0. The lgdt3305 detection code is able to read something from
either i2c address, but is is always 0.

Does the eeprom data below have anything to help writing a driver for
the KWorld UB435Q?

I suspect some initialization needs to be done, but I don't know what to
try.  Does anyone have any information about how the hardware is
configured or information captured from the Windows driver?

Does anyone know where I can get a copy of the programming spec for the
lgdt3305?  The em2874 spec would be useful too.

Here is the dmsg after plugging in the KWorld UB435Q v-3:

[  566.649812] hub 1-1:1.0: state 7 ports 6 chg  evt 0010
[  566.650257] hub 1-1:1.0: port 4, status 0101, change 0001, 12 Mb/s
[  566.753819] hub 1-1:1.0: debounce: port 4: total 100ms stable 100ms
status 0x101
[  566.764810] hub 1-1:1.0: port 4 not reset yet, waiting 10ms
[  566.826760] usb 1-1.4: new high-speed USB device number 4 using ehci_hcd
[  566.837765] hub 1-1:1.0: port 4 not reset yet, waiting 10ms
[  566.912465] usb 1-1.4: default language 0x0409
[  566.912830] usb 1-1.4: udev 4, busnum 1, minor = 3
[  566.912836] usb 1-1.4: New USB device found, idVendor=1b80,
idProduct=e34c
[  566.912838] usb 1-1.4: New USB device strings: Mfr=0, Product=1,
SerialNumber=2
[  566.912841] usb 1-1.4: Product: USB 2875 Device
[  566.912844] usb 1-1.4: SerialNumber: 1
[  566.912930] usb 1-1.4: usb_probe_device
[  566.912932] usb 1-1.4: configuration #1 chosen from 1 choice
[  566.913034] usb 1-1.4: adding 1-1.4:1.0 (config #1, interface 0)
[  566.962815] em28xx 1-1.4:1.0: usb_probe_interface
[  566.962818] em28xx 1-1.4:1.0: usb_probe_interface - got id
[  566.962822] em28xx: New device  USB 2875 Device @ 480 Mbps
(1b80:e34c, interface 0, class 0)
[  566.962823] em28xx: DVB interface 0 found: bulk
[  566.962916] em28xx: chip ID is em2874
[  567.037248] em2874 #0: i2c eeprom : 26 00 01 00 02 09 0f e5 f5 64
01 60 09 e5 f5 64
[  567.037260] em2874 #0: i2c eeprom 0010: 09 60 03 c2 c6 22 e5 f7 b4 03
13 e5 f6 b4 87 03
[  567.037269] em2874 #0: i2c eeprom 0020: 02 08 a3 e5 f6 b4 93 03 02 07
58 c2 c6 22 c2 c6
[  567.037278] em2874 #0: i2c eeprom 0030: 22 00 60 00 ef 70 08 85 3a 82
85 39 83 93 ff ef
[  567.037288] em2874 #0: i2c eeprom 0040: 60 19 85 3a 82 85 39 83 e4 93
12 06 67 12 08 f5
[  567.037297] em2874 #0: i2c eeprom 0050: 05 3a e5 3a 70 02 05 39 1f 80
e4 22 12 08 fd 02
[  567.037306] em2874 #0: i2c eeprom 0060: 06 02 02 00 1a eb 67 95 80 1b
4c e3 d0 13 6c 00
[  567.037315] em2874 #0: i2c eeprom 0070: 6a 20 8a 04 00 00 24 57 00 5c
39 00 00 00 00 00
[  567.037330] em2874 #0: i2c eeprom 0080: 00 00 00 00 44 00 00 00 f0 10
44 00 00 00 00 00
[  567.037334] em2874 #0: i2c eeprom 0090: 5b 1c c0 00 00 00 20 40 20 80
02 20 01 01 00 00
[  567.037338] em2874 #0: i2c eeprom 00a0: 00 00 00 00 00 00 00 04 00 00
00 00 00 00 00 00
[  567.037342] em2874 #0: i2c eeprom 00b0: c6 40 00 00 00 00 87 00 00 80
00 00 00 00 00 00
[  567.037346] em2874 #0: i2c eeprom 00c0: 00 00 00 00 00 00 00 00 00 00
00 00 00 00 20 03
[  567.037349] em2874 #0: i2c eeprom 00d0: 55 00 53 00 42 00 20 00 32 00
38 00 37 00 35 00
[  567.037353] em2874 #0: i2c eeprom 00e0: 20 00 44 00 65 00 76 00 69 00
63 00 65 00 04 03
[  567.037357] em2874 #0: i2c eeprom 00f0: 31 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
[  567.037361] em2874 #0: i2c eeprom 0100: ... (skipped)
[  567.037363] em2874 #0: EEPROM ID = 26 00 01 00, EEPROM hash = 0x5d3e97ab
[  567.037363] em2874 #0: EEPROM info:
[  567.037364] em2874 #0:   microcode start address = 0x0004, boot
configuration = 0x01
[  567.061606] em2874 #0:   No audio on board.
[  567.061610] em2874 #0:   500mA max power
[  567.061612] em2874 #0:   Table at offset 0x00, strings=0x,
0x, 0x
[  567.061615] em2874 #0: Identified as KWorld UB435-Q v-3 (ATSC) (card=89)
[  567.061618] em2874 #0: v4l2 driver version 0.2.0
[  567.066790] em2874 #0: V4L2 video device registered as video2
[  567.066792] em2874