Re: [PATCH] em28xx: add support for Hauppauge WinTV-dualHD DVB tuner

2017-09-08 Thread Brad Love
Hi Mauro,


On 2017-09-07 09:52, Mauro Carvalho Chehab wrote:
> Hi Brad,
>
> Em Wed, 31 May 2017 15:01:00 -0500
> Brad Love  escreveu:
>
>> Christian et al,
>>
>> I am an engineer at Hauppauge. This repo is the staging area for all the
>> patches I am testing, with the intention of getting them upstreamed. I
>> will be inaccessible for the next 18 days however, so I will not be able
>> to put any effort until I get back.
> Any news on such patchset?
>
> On a side note, I took a quick look on some of the patches at the
> git repository at:
>
>   
> https://github.com/b-rad-NDi/Ubuntu-media-tree-kernel-builder/tree/master/patches/ubuntu-zesty-4.10.0/extra
>
> I suspect that some of the patches there could have some side effect on
> existing drivers, like this one that unconditionally changes the size
> of URB:
>
>   
> https://github.com/b-rad-NDi/Ubuntu-media-tree-kernel-builder/blob/master/patches/ubuntu-zesty-4.10.0/extra/0003-em28xx-usb-packet-size-tweaks.patch
>
> So, it would be good to be able to test this set also with older
> em28xx devices that also support bulk transfers.
>
> Thanks,
> Mauro

I apologize for delay of action on my growing patchset, summer has been
quite busy for me. I can find time to work on this now though. There is
an initial cluster of the set that I think are ready, but I agree the
unconditional URB size change should be tested against other em28xx
devices. We've found the size changes optimal, but haven't tested
against anyone else's hardware. I will try and source and source some
bulk models from other manufacturers to verify they still operate with
the modification.

Regards,

Brad



Re: [PATCH] em28xx: add support for Hauppauge WinTV-dualHD DVB tuner

2017-09-07 Thread Mauro Carvalho Chehab
Hi Brad,

Em Wed, 31 May 2017 15:01:00 -0500
Brad Love  escreveu:

> Christian et al,
> 
> I am an engineer at Hauppauge. This repo is the staging area for all the
> patches I am testing, with the intention of getting them upstreamed. I
> will be inaccessible for the next 18 days however, so I will not be able
> to put any effort until I get back.

Any news on such patchset?

On a side note, I took a quick look on some of the patches at the
git repository at:


https://github.com/b-rad-NDi/Ubuntu-media-tree-kernel-builder/tree/master/patches/ubuntu-zesty-4.10.0/extra

I suspect that some of the patches there could have some side effect on
existing drivers, like this one that unconditionally changes the size
of URB:


https://github.com/b-rad-NDi/Ubuntu-media-tree-kernel-builder/blob/master/patches/ubuntu-zesty-4.10.0/extra/0003-em28xx-usb-packet-size-tweaks.patch

So, it would be good to be able to test this set also with older
em28xx devices that also support bulk transfers.

Thanks,
Mauro


Re: Fwd: [PATCH] em28xx: add support for Hauppauge WinTV-dualHD DVB tuner

2017-05-31 Thread Brad Love
Christian et al,

I am an engineer at Hauppauge. This repo is the staging area for all the
patches I am testing, with the intention of getting them upstreamed. I
will be inaccessible for the next 18 days however, so I will not be able
to put any effort until I get back.

Cheers,

Brad



On 2017-05-27 10:38, Christian Steiner wrote:
> Hello,
>
> I have found patches that add support for the second tuner:
> https://github.com/b-rad-NDi/Ubuntu-media-tree-kernel-builder/tree/master/patches/ubuntu-zesty-4.10.0/extra
>
> I can confirm that they also work with the latest kernel (4.12.0-rc2).
> Would it be possible to integrate these patches into mainline?
> Applying 0006-Hauppauge-WinTV-DualHD-DVB-ATSC-second-tuner-support.patch
> is sufficient for the second tuner to appear, but I guess we should
> include all patches.
>
> Best regards,
> Christian
>
>
> On 11.04.2016 11:14, Olli Salonen wrote:
>> Hi Christian,
>>
>> Thanks for reporting back your experience. Certainly there's a chance
>> of supporting the second tuner too. There are still two issues that I
>> have not solved:
>>
>> 1. I haven't gotten the 2nd tuner working yet (alone, without the
>> first tuner), even if I think all the pieces of the puzzle are there.
>> 2. em28xx driver is built with one tuner in mind and needs significant
>> structural changes. If there's anyone very familiar with the em28xx
>> driver here, I'd be happy to hear your idea of what is entailed for
>> this.
>>
>> Cheers,
>> -olli
>>
>> On 10 April 2016 at 18:23, Christian Steiner
>>  wrote:
>>> On 04.04.2016 17:12, Olli Salonen wrote:
 Hauppauge WinTV-dualHD is a USB 2.0 dual DVB-T/T2/C tuner with
 following components:

 USB bridge: Empia EM28274 (chip id is the same as EM28174)
 Demodulator: 2x Silicon Labs Si2168-B40
 Tuner: 2x Silicon Labs Si2157-A30

 This patch adds support only for the first tuner.

 [...]
>>> Thank you very much!
>>> Works fine for me:
>>>
 [  419.413188] em28xx: New device HCW dualHD @ 480 Mbps (2040:0265, 
 interface 0, class 0)
 [  419.413195] em28xx: DVB interface 0 found: isoc
 [  419.413265] em28xx: chip ID is em28174
 [  420.529619] em28174 #0: EEPROM ID = 26 00 01 00, EEPROM hash = 
 0x7addc1c8
 [  420.529626] em28174 #0: EEPROM info:
 [  420.529630] em28174 #0:  microcode start address = 0x0004, boot 
 configuration = 0x01
 [  420.536077] em28174 #0:  AC97 audio (5 sample rates)
 [  420.536084] em28174 #0:  500mA max power
 [  420.536089] em28174 #0:  Table at offset 0x27, strings=0x0e6a, 
 0x1888, 0x087e
 [  420.536188] em28174 #0: Identified as Hauppauge WinTV-dualHD DVB 
 (card=98)
 [  420.537974] tveeprom 8-0050: Hauppauge model 204109, rev B2I6, serial# 
 11XX
 [  420.537981] tveeprom 8-0050: tuner model is SiLabs Si2157 (idx 186, 
 type 4)
 [  420.537986] tveeprom 8-0050: TV standards PAL(B/G) NTSC(M) PAL(I) 
 SECAM(L/L') PAL(D/D1/K) ATSC/DVB Digital (eeprom 0xfc)
 [  420.537989] tveeprom 8-0050: audio processor is None (idx 0)
 [  420.537993] tveeprom 8-0050: has no radio, has IR receiver, has no IR 
 transmitter
 [  420.537997] em28174 #0: dvb set to isoc mode.
 [  420.538056] usbcore: registered new interface driver em28xx
 [  420.541087] em28174 #0: Binding DVB extension
 [  420.544008] i2c i2c-8: Added multiplexed i2c bus 9
 [  420.544016] si2168 8-0064: Silicon Labs Si2168 successfully attached
 [  420.548372] si2157 9-0060: Silicon Labs Si2147/2148/2157/2158 
 successfully attached
 [  420.548389] DVB: registering new adapter (em28174 #0)
 [  420.548396] usb 2-2: DVB: registering adapter 0 frontend 0 (Silicon 
 Labs Si2168)...
 [  420.549737] em28174 #0: DVB extension successfully initialized
 [  420.549743] em28xx: Registered (Em28xx dvb Extension) extension
 [  435.418798] si2168 8-0064: found a 'Silicon Labs Si2168-B40'
 [  435.418823] si2168 8-0064: downloading firmware from file 
 'dvb-demod-si2168-b40-01.fw'
 [  435.617181] si2168 8-0064: firmware version: 4.0.11
 [  435.619791] si2157 9-0060: found a 'Silicon Labs Si2157-A30'
 [  435.642006] si2157 9-0060: firmware version: 3.0.5
>>> (I have replaced the last digits of the serial number with X)
>>>
>>> Is there any chance to add support for the second tuner, too?
>>> This would be awesome.
>>>
>>> Best,
>>> Christian
>>>



Re: Fwd: [PATCH] em28xx: add support for Hauppauge WinTV-dualHD DVB tuner

2017-05-27 Thread Christian Steiner
Hello,

I have found patches that add support for the second tuner:
https://github.com/b-rad-NDi/Ubuntu-media-tree-kernel-builder/tree/master/patches/ubuntu-zesty-4.10.0/extra

I can confirm that they also work with the latest kernel (4.12.0-rc2).
Would it be possible to integrate these patches into mainline?
Applying 0006-Hauppauge-WinTV-DualHD-DVB-ATSC-second-tuner-support.patch
is sufficient for the second tuner to appear, but I guess we should
include all patches.

Best regards,
Christian


On 11.04.2016 11:14, Olli Salonen wrote:
> Hi Christian,
> 
> Thanks for reporting back your experience. Certainly there's a chance
> of supporting the second tuner too. There are still two issues that I
> have not solved:
> 
> 1. I haven't gotten the 2nd tuner working yet (alone, without the
> first tuner), even if I think all the pieces of the puzzle are there.
> 2. em28xx driver is built with one tuner in mind and needs significant
> structural changes. If there's anyone very familiar with the em28xx
> driver here, I'd be happy to hear your idea of what is entailed for
> this.
> 
> Cheers,
> -olli
> 
> On 10 April 2016 at 18:23, Christian Steiner
>  wrote:
>>
>> On 04.04.2016 17:12, Olli Salonen wrote:
>>> Hauppauge WinTV-dualHD is a USB 2.0 dual DVB-T/T2/C tuner with
>>> following components:
>>>
>>> USB bridge: Empia EM28274 (chip id is the same as EM28174)
>>> Demodulator: 2x Silicon Labs Si2168-B40
>>> Tuner: 2x Silicon Labs Si2157-A30
>>>
>>> This patch adds support only for the first tuner.
>>>
>>> [...]
>>
>> Thank you very much!
>> Works fine for me:
>>
>>> [  419.413188] em28xx: New device HCW dualHD @ 480 Mbps (2040:0265, 
>>> interface 0, class 0)
>>> [  419.413195] em28xx: DVB interface 0 found: isoc
>>> [  419.413265] em28xx: chip ID is em28174
>>> [  420.529619] em28174 #0: EEPROM ID = 26 00 01 00, EEPROM hash = 0x7addc1c8
>>> [  420.529626] em28174 #0: EEPROM info:
>>> [  420.529630] em28174 #0:  microcode start address = 0x0004, boot 
>>> configuration = 0x01
>>> [  420.536077] em28174 #0:  AC97 audio (5 sample rates)
>>> [  420.536084] em28174 #0:  500mA max power
>>> [  420.536089] em28174 #0:  Table at offset 0x27, strings=0x0e6a, 
>>> 0x1888, 0x087e
>>> [  420.536188] em28174 #0: Identified as Hauppauge WinTV-dualHD DVB 
>>> (card=98)
>>> [  420.537974] tveeprom 8-0050: Hauppauge model 204109, rev B2I6, serial# 
>>> 11XX
>>> [  420.537981] tveeprom 8-0050: tuner model is SiLabs Si2157 (idx 186, type 
>>> 4)
>>> [  420.537986] tveeprom 8-0050: TV standards PAL(B/G) NTSC(M) PAL(I) 
>>> SECAM(L/L') PAL(D/D1/K) ATSC/DVB Digital (eeprom 0xfc)
>>> [  420.537989] tveeprom 8-0050: audio processor is None (idx 0)
>>> [  420.537993] tveeprom 8-0050: has no radio, has IR receiver, has no IR 
>>> transmitter
>>> [  420.537997] em28174 #0: dvb set to isoc mode.
>>> [  420.538056] usbcore: registered new interface driver em28xx
>>> [  420.541087] em28174 #0: Binding DVB extension
>>> [  420.544008] i2c i2c-8: Added multiplexed i2c bus 9
>>> [  420.544016] si2168 8-0064: Silicon Labs Si2168 successfully attached
>>> [  420.548372] si2157 9-0060: Silicon Labs Si2147/2148/2157/2158 
>>> successfully attached
>>> [  420.548389] DVB: registering new adapter (em28174 #0)
>>> [  420.548396] usb 2-2: DVB: registering adapter 0 frontend 0 (Silicon Labs 
>>> Si2168)...
>>> [  420.549737] em28174 #0: DVB extension successfully initialized
>>> [  420.549743] em28xx: Registered (Em28xx dvb Extension) extension
>>> [  435.418798] si2168 8-0064: found a 'Silicon Labs Si2168-B40'
>>> [  435.418823] si2168 8-0064: downloading firmware from file 
>>> 'dvb-demod-si2168-b40-01.fw'
>>> [  435.617181] si2168 8-0064: firmware version: 4.0.11
>>> [  435.619791] si2157 9-0060: found a 'Silicon Labs Si2157-A30'
>>> [  435.642006] si2157 9-0060: firmware version: 3.0.5
>>
>> (I have replaced the last digits of the serial number with X)
>>
>> Is there any chance to add support for the second tuner, too?
>> This would be awesome.
>>
>> Best,
>> Christian
>>



Fwd: [PATCH] em28xx: add support for Hauppauge WinTV-dualHD DVB tuner

2016-04-11 Thread Olli Salonen
Hi Christian,

Thanks for reporting back your experience. Certainly there's a chance
of supporting the second tuner too. There are still two issues that I
have not solved:

1. I haven't gotten the 2nd tuner working yet (alone, without the
first tuner), even if I think all the pieces of the puzzle are there.
2. em28xx driver is built with one tuner in mind and needs significant
structural changes. If there's anyone very familiar with the em28xx
driver here, I'd be happy to hear your idea of what is entailed for
this.

Cheers,
-olli

On 10 April 2016 at 18:23, Christian Steiner
 wrote:
>
> On 04.04.2016 17:12, Olli Salonen wrote:
> > Hauppauge WinTV-dualHD is a USB 2.0 dual DVB-T/T2/C tuner with
> > following components:
> >
> > USB bridge: Empia EM28274 (chip id is the same as EM28174)
> > Demodulator: 2x Silicon Labs Si2168-B40
> > Tuner: 2x Silicon Labs Si2157-A30
> >
> > This patch adds support only for the first tuner.
> >
> > [...]
>
> Thank you very much!
> Works fine for me:
>
> > [  419.413188] em28xx: New device HCW dualHD @ 480 Mbps (2040:0265, 
> > interface 0, class 0)
> > [  419.413195] em28xx: DVB interface 0 found: isoc
> > [  419.413265] em28xx: chip ID is em28174
> > [  420.529619] em28174 #0: EEPROM ID = 26 00 01 00, EEPROM hash = 0x7addc1c8
> > [  420.529626] em28174 #0: EEPROM info:
> > [  420.529630] em28174 #0:  microcode start address = 0x0004, boot 
> > configuration = 0x01
> > [  420.536077] em28174 #0:  AC97 audio (5 sample rates)
> > [  420.536084] em28174 #0:  500mA max power
> > [  420.536089] em28174 #0:  Table at offset 0x27, strings=0x0e6a, 
> > 0x1888, 0x087e
> > [  420.536188] em28174 #0: Identified as Hauppauge WinTV-dualHD DVB 
> > (card=98)
> > [  420.537974] tveeprom 8-0050: Hauppauge model 204109, rev B2I6, serial# 
> > 11XX
> > [  420.537981] tveeprom 8-0050: tuner model is SiLabs Si2157 (idx 186, type 
> > 4)
> > [  420.537986] tveeprom 8-0050: TV standards PAL(B/G) NTSC(M) PAL(I) 
> > SECAM(L/L') PAL(D/D1/K) ATSC/DVB Digital (eeprom 0xfc)
> > [  420.537989] tveeprom 8-0050: audio processor is None (idx 0)
> > [  420.537993] tveeprom 8-0050: has no radio, has IR receiver, has no IR 
> > transmitter
> > [  420.537997] em28174 #0: dvb set to isoc mode.
> > [  420.538056] usbcore: registered new interface driver em28xx
> > [  420.541087] em28174 #0: Binding DVB extension
> > [  420.544008] i2c i2c-8: Added multiplexed i2c bus 9
> > [  420.544016] si2168 8-0064: Silicon Labs Si2168 successfully attached
> > [  420.548372] si2157 9-0060: Silicon Labs Si2147/2148/2157/2158 
> > successfully attached
> > [  420.548389] DVB: registering new adapter (em28174 #0)
> > [  420.548396] usb 2-2: DVB: registering adapter 0 frontend 0 (Silicon Labs 
> > Si2168)...
> > [  420.549737] em28174 #0: DVB extension successfully initialized
> > [  420.549743] em28xx: Registered (Em28xx dvb Extension) extension
> > [  435.418798] si2168 8-0064: found a 'Silicon Labs Si2168-B40'
> > [  435.418823] si2168 8-0064: downloading firmware from file 
> > 'dvb-demod-si2168-b40-01.fw'
> > [  435.617181] si2168 8-0064: firmware version: 4.0.11
> > [  435.619791] si2157 9-0060: found a 'Silicon Labs Si2157-A30'
> > [  435.642006] si2157 9-0060: firmware version: 3.0.5
>
> (I have replaced the last digits of the serial number with X)
>
> Is there any chance to add support for the second tuner, too?
> This would be awesome.
>
> Best,
> Christian
>
> --
> 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: [PATCH] em28xx: add support for Hauppauge WinTV-dualHD DVB tuner

2016-04-11 Thread Christian Steiner
On 04.04.2016 17:12, Olli Salonen wrote:
> Hauppauge WinTV-dualHD is a USB 2.0 dual DVB-T/T2/C tuner with
> following components:
> 
> USB bridge: Empia EM28274 (chip id is the same as EM28174)
> Demodulator: 2x Silicon Labs Si2168-B40
> Tuner: 2x Silicon Labs Si2157-A30
> 
> This patch adds support only for the first tuner.
> 
> [...]

Thank you very much!
Works fine for me:

> [  419.413188] em28xx: New device HCW dualHD @ 480 Mbps (2040:0265, interface 
> 0, class 0)
> [  419.413195] em28xx: DVB interface 0 found: isoc
> [  419.413265] em28xx: chip ID is em28174
> [  420.529619] em28174 #0: EEPROM ID = 26 00 01 00, EEPROM hash = 0x7addc1c8
> [  420.529626] em28174 #0: EEPROM info:
> [  420.529630] em28174 #0:  microcode start address = 0x0004, boot 
> configuration = 0x01
> [  420.536077] em28174 #0:  AC97 audio (5 sample rates)
> [  420.536084] em28174 #0:  500mA max power
> [  420.536089] em28174 #0:  Table at offset 0x27, strings=0x0e6a, 0x1888, 
> 0x087e
> [  420.536188] em28174 #0: Identified as Hauppauge WinTV-dualHD DVB (card=98)
> [  420.537974] tveeprom 8-0050: Hauppauge model 204109, rev B2I6, serial# 
> 11XX
> [  420.537981] tveeprom 8-0050: tuner model is SiLabs Si2157 (idx 186, type 4)
> [  420.537986] tveeprom 8-0050: TV standards PAL(B/G) NTSC(M) PAL(I) 
> SECAM(L/L') PAL(D/D1/K) ATSC/DVB Digital (eeprom 0xfc)
> [  420.537989] tveeprom 8-0050: audio processor is None (idx 0)
> [  420.537993] tveeprom 8-0050: has no radio, has IR receiver, has no IR 
> transmitter
> [  420.537997] em28174 #0: dvb set to isoc mode.
> [  420.538056] usbcore: registered new interface driver em28xx
> [  420.541087] em28174 #0: Binding DVB extension
> [  420.544008] i2c i2c-8: Added multiplexed i2c bus 9
> [  420.544016] si2168 8-0064: Silicon Labs Si2168 successfully attached
> [  420.548372] si2157 9-0060: Silicon Labs Si2147/2148/2157/2158 successfully 
> attached
> [  420.548389] DVB: registering new adapter (em28174 #0)
> [  420.548396] usb 2-2: DVB: registering adapter 0 frontend 0 (Silicon Labs 
> Si2168)...
> [  420.549737] em28174 #0: DVB extension successfully initialized
> [  420.549743] em28xx: Registered (Em28xx dvb Extension) extension
> [  435.418798] si2168 8-0064: found a 'Silicon Labs Si2168-B40'
> [  435.418823] si2168 8-0064: downloading firmware from file 
> 'dvb-demod-si2168-b40-01.fw'
> [  435.617181] si2168 8-0064: firmware version: 4.0.11
> [  435.619791] si2157 9-0060: found a 'Silicon Labs Si2157-A30'
> [  435.642006] si2157 9-0060: firmware version: 3.0.5

(I have replaced the last digits of the serial number with X)

Is there any chance to add support for the second tuner, too?
This would be awesome.

Best,
Christian

--
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: add support for Hauppauge WinTV-dualHD DVB tuner

2016-04-10 Thread Christian Steiner
On 04.04.2016 17:12, Olli Salonen wrote:
> Hauppauge WinTV-dualHD is a USB 2.0 dual DVB-T/T2/C tuner with
> following components:
> 
> USB bridge: Empia EM28274 (chip id is the same as EM28174)
> Demodulator: 2x Silicon Labs Si2168-B40
> Tuner: 2x Silicon Labs Si2157-A30
> 
> This patch adds support only for the first tuner.
> 
> [...]

Thank you very much!
Works fine for me:

> [  419.413188] em28xx: New device HCW dualHD @ 480 Mbps (2040:0265, interface 
> 0, class 0)
> [  419.413195] em28xx: DVB interface 0 found: isoc
> [  419.413265] em28xx: chip ID is em28174
> [  420.529619] em28174 #0: EEPROM ID = 26 00 01 00, EEPROM hash = 0x7addc1c8
> [  420.529626] em28174 #0: EEPROM info:
> [  420.529630] em28174 #0:  microcode start address = 0x0004, boot 
> configuration = 0x01
> [  420.536077] em28174 #0:  AC97 audio (5 sample rates)
> [  420.536084] em28174 #0:  500mA max power
> [  420.536089] em28174 #0:  Table at offset 0x27, strings=0x0e6a, 0x1888, 
> 0x087e
> [  420.536188] em28174 #0: Identified as Hauppauge WinTV-dualHD DVB (card=98)
> [  420.537974] tveeprom 8-0050: Hauppauge model 204109, rev B2I6, serial# 
> 11XX
> [  420.537981] tveeprom 8-0050: tuner model is SiLabs Si2157 (idx 186, type 4)
> [  420.537986] tveeprom 8-0050: TV standards PAL(B/G) NTSC(M) PAL(I) 
> SECAM(L/L') PAL(D/D1/K) ATSC/DVB Digital (eeprom 0xfc)
> [  420.537989] tveeprom 8-0050: audio processor is None (idx 0)
> [  420.537993] tveeprom 8-0050: has no radio, has IR receiver, has no IR 
> transmitter
> [  420.537997] em28174 #0: dvb set to isoc mode.
> [  420.538056] usbcore: registered new interface driver em28xx
> [  420.541087] em28174 #0: Binding DVB extension
> [  420.544008] i2c i2c-8: Added multiplexed i2c bus 9
> [  420.544016] si2168 8-0064: Silicon Labs Si2168 successfully attached
> [  420.548372] si2157 9-0060: Silicon Labs Si2147/2148/2157/2158 successfully 
> attached
> [  420.548389] DVB: registering new adapter (em28174 #0)
> [  420.548396] usb 2-2: DVB: registering adapter 0 frontend 0 (Silicon Labs 
> Si2168)...
> [  420.549737] em28174 #0: DVB extension successfully initialized
> [  420.549743] em28xx: Registered (Em28xx dvb Extension) extension
> [  435.418798] si2168 8-0064: found a 'Silicon Labs Si2168-B40'
> [  435.418823] si2168 8-0064: downloading firmware from file 
> 'dvb-demod-si2168-b40-01.fw'
> [  435.617181] si2168 8-0064: firmware version: 4.0.11
> [  435.619791] si2157 9-0060: found a 'Silicon Labs Si2157-A30'
> [  435.642006] si2157 9-0060: firmware version: 3.0.5

(I have replaced the last digits of the serial number with X)

Is there any chance to add support for the second tuner, too?
This would be awesome.

Best,
Christian
--
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


[PATCH] em28xx: add support for Hauppauge WinTV-dualHD DVB tuner

2016-04-04 Thread Olli Salonen
Hauppauge WinTV-dualHD is a USB 2.0 dual DVB-T/T2/C tuner with
following components:

USB bridge: Empia EM28274 (chip id is the same as EM28174)
Demodulator: 2x Silicon Labs Si2168-B40
Tuner: 2x Silicon Labs Si2157-A30

This patch adds support only for the first tuner.

The demodulator needs firmware, available for example here:
http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-B40/4.0.11/

The demodulators sit on the same I2C bus and their addresses
are 0x64 and 0x67. The tuners are behind the demodulators and
their addresses are 0x60 and 0x63.

Signed-off-by: Olli Salonen 
---
 Documentation/video4linux/CARDLIST.em28xx |  1 +
 drivers/media/usb/em28xx/em28xx-cards.c   | 54 ++
 drivers/media/usb/em28xx/em28xx-dvb.c | 64 +++
 drivers/media/usb/em28xx/em28xx-reg.h | 13 +++
 drivers/media/usb/em28xx/em28xx.h |  2 +
 5 files changed, 134 insertions(+)

diff --git a/Documentation/video4linux/CARDLIST.em28xx 
b/Documentation/video4linux/CARDLIST.em28xx
index 6720999..09ff940 100644
--- a/Documentation/video4linux/CARDLIST.em28xx
+++ b/Documentation/video4linux/CARDLIST.em28xx
@@ -96,3 +96,4 @@
  95 -> Leadtek VC100(em2861)[0413:6f07]
  96 -> Terratec Cinergy T2 Stick HD (em28178)
  97 -> Elgato EyeTV Hybrid 2008 INT (em2884)[0fd9:0018]
+ 98 -> Hauppauge WinTV-dualHD DVB   (em28174)   [2040:0265]
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c 
b/drivers/media/usb/em28xx/em28xx-cards.c
index 930e3e3..5a57f75 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -492,6 +492,29 @@ static struct em28xx_reg_seq terratec_t2_stick_hd[] = {
{-1, -1,   -1, -1},
 };
 
+/* 2040:0265 Hauppauge WinTV-dualHD DVB
+ * reg 0x80/0x84:
+ * GPIO_0: Yellow LED tuner 1, 0=on, 1=off
+ * GPIO_1: Green LED tuner 1, 0=on, 1=off
+ * GPIO_2: Yellow LED tuner 2, 0=on, 1=off
+ * GPIO_3: Green LED tuner 2, 0=on, 1=off
+ * GPIO_5: Reset #2, 0=active
+ * GPIO_6: Reset #1, 0=active
+ */
+static struct em28xx_reg_seq hauppauge_dualhd_dvb[] = {
+   {EM2874_R80_GPIO_P0_CTRL,  0xff, 0xff,  0},
+   {0x0d, 0xff, 0xff,200},
+   {0x50, 0x04, 0xff,300},
+   {EM2874_R80_GPIO_P0_CTRL,  0xbf, 0xff,100}, /* demod 1 reset */
+   {EM2874_R80_GPIO_P0_CTRL,  0xff, 0xff,100},
+   {EM2874_R80_GPIO_P0_CTRL,  0xdf, 0xff,100}, /* demod 2 reset */
+   {EM2874_R80_GPIO_P0_CTRL,  0xff, 0xff,100},
+   {EM2874_R5F_TS_ENABLE, 0x44, 0xff, 50},
+   {EM2874_R5D_TS1_PKT_SIZE,  0x05, 0xff, 50},
+   {EM2874_R5E_TS2_PKT_SIZE,  0x05, 0xff, 50},
+   {-1, -1,   -1, -1},
+};
+
 /*
  *  Button definitions
  */
@@ -571,6 +594,22 @@ static struct em28xx_led terratec_grabby_leds[] = {
{-1, 0, 0, 0},
 };
 
+static struct em28xx_led hauppauge_dualhd_leds[] = {
+   {
+   .role  = EM28XX_LED_DIGITAL_CAPTURING,
+   .gpio_reg  = EM2874_R80_GPIO_P0_CTRL,
+   .gpio_mask = EM_GPIO_1,
+   .inverted  = 1,
+   },
+   {
+   .role  = EM28XX_LED_DIGITAL_CAPTURING_TS2,
+   .gpio_reg  = EM2874_R80_GPIO_P0_CTRL,
+   .gpio_mask = EM_GPIO_3,
+   .inverted  = 1,
+   },
+   {-1, 0, 0, 0},
+};
+
 /*
  *  Board definitions
  */
@@ -2306,6 +2345,18 @@ struct em28xx_board em28xx_boards[] = {
.has_dvb   = 1,
.ir_codes  = RC_MAP_TERRATEC_SLIM_2,
},
+   /* 2040:0265 Hauppauge WinTV-dualHD (DVB version).
+* Empia EM28274, 2x Silicon Labs Si2168, 2x Silicon Labs Si2157 */
+   [EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB] = {
+   .name  = "Hauppauge WinTV-dualHD DVB",
+   .def_i2c_bus   = 1,
+   .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | 
EM28XX_I2C_FREQ_400_KHZ,
+   .tuner_type= TUNER_ABSENT,
+   .tuner_gpio= hauppauge_dualhd_dvb,
+   .has_dvb   = 1,
+   .ir_codes  = RC_MAP_HAUPPAUGE,
+   .leds  = hauppauge_dualhd_leds,
+   },
 };
 EXPORT_SYMBOL_GPL(em28xx_boards);
 
@@ -2429,6 +2480,8 @@ struct usb_device_id em28xx_id_table[] = {
.driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
{ USB_DEVICE(0x2040, 0x651f),
.driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 },
+   { USB_DEVICE(0x2040, 0x0265),
+   .driver_info = EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB 
},
{ USB_DEVICE(0x0438, 0xb002),
.driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
{ USB_DEVICE(0x2001, 0xf112),
@@ -2861,6 +2914,7 @@ static void em28xx_card_setup(s