NEC 32 bits RC codes - was: Re: [PATCH 1/2] v180 - DM04/QQBOX added support for BS2F7HZ0194 versions

2011-03-23 Thread Mauro Carvalho Chehab
Em 23-03-2011 05:41, Antti Palosaari escreveu:
> On 03/23/2011 01:00 AM, Mauro Carvalho Chehab wrote:
>> Em 22-03-2011 19:12, Malcolm Priestley escreveu:
>>> On Tue, 2011-03-22 at 02:43 +0200, Antti Palosaari wrote:
> 
 Anyhow, my opinion is still that we *should* make all NEC remotes as 32
 bit and leave handling of NEC 16, NEC 24, NEC 32 to NEC decoder. For
 example AF9015 current NEC handling is too complex for that reason... I
 don't like how it is implemented currently.
>>>
>>> One of the reasons for using 32 bit was interference from other consumer
>>> remotes.  It appears, these near identical bubble remotes originate from
>>> a Chinese factory and supplied with the same product with completely
>>> different key mapping.
>>>
>>> I am not sure how many of these remotes are common to other devices.
>>
>> Drivers should get the 32 bit codes form NEC when hardware provides it.
>> What we currently do is to identify if the code has 16, 24 or 32 bits,
>> but it is probably better to always handle them as if they have 32 bits.
> 
> That's how af9015 driver handles it currently.
> 
> if (buf[14] == (u8) ~buf[15]) {
> if (buf[12] == (u8) ~buf[13]) {
> /* 16 bit NEC standard */
> priv->rc_keycode = buf[12] << 8 | buf[14];
> } else {
> /* 24 bit NEC extended*/
> priv->rc_keycode = buf[12] << 16 | buf[13] << 8 | buf[14];
> }
> } else {
> /* 32 bit NEC full scancode */
> priv->rc_keycode = buf[12] << 24 | buf[13] << 16 | buf[14] << 8 | buf[15];
> }
> 
> I think there is no any better currently.

RC core does the same. I talked with Jarod, and we're thinking on just use 32 
bits
for everything. There are two issues however:
1) All NEC tables will need to be replaced. This affects userspace. Not 
sure
how to workaround it there, to allow userspace to do the right thing. New 
protocol type?
2) Some hardware decoders only provide 16 bits for NEC.

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: [PATCH 1/2] v180 - DM04/QQBOX added support for BS2F7HZ0194 versions

2011-03-23 Thread Antti Palosaari

On 03/23/2011 01:00 AM, Mauro Carvalho Chehab wrote:

Em 22-03-2011 19:12, Malcolm Priestley escreveu:

On Tue, 2011-03-22 at 02:43 +0200, Antti Palosaari wrote:



Anyhow, my opinion is still that we *should* make all NEC remotes as 32
bit and leave handling of NEC 16, NEC 24, NEC 32 to NEC decoder. For
example AF9015 current NEC handling is too complex for that reason... I
don't like how it is implemented currently.


One of the reasons for using 32 bit was interference from other consumer
remotes.  It appears, these near identical bubble remotes originate from
a Chinese factory and supplied with the same product with completely
different key mapping.

I am not sure how many of these remotes are common to other devices.


Drivers should get the 32 bit codes form NEC when hardware provides it.
What we currently do is to identify if the code has 16, 24 or 32 bits,
but it is probably better to always handle them as if they have 32 bits.


That's how af9015 driver handles it currently.

if (buf[14] == (u8) ~buf[15]) {
if (buf[12] == (u8) ~buf[13]) {
/* 16 bit NEC standard */
priv->rc_keycode = buf[12] << 8 | buf[14];
} else {
/* 24 bit NEC extended*/
priv->rc_keycode = buf[12] << 16 | buf[13] << 8 | buf[14];
}
} else {
/* 32 bit NEC full scancode */
priv->rc_keycode = buf[12] << 24 | buf[13] << 16 | buf[14] << 8 | 
buf[15];

}

I think there is no any better currently.

Antti
--
http://palosaari.fi/
--
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 1/2] v180 - DM04/QQBOX added support for BS2F7HZ0194 versions

2011-03-22 Thread Mauro Carvalho Chehab
Em 22-03-2011 19:12, Malcolm Priestley escreveu:
> On Tue, 2011-03-22 at 02:43 +0200, Antti Palosaari wrote:
>> On 03/22/2011 02:32 AM, Malcolm Priestley wrote:
>>> On Mon, 2011-03-21 at 21:17 -0300, Mauro Carvalho Chehab wrote:
 Em 12-02-2011 23:35, Malcolm Priestley escreveu:
> Old versions of these boxes have the BS2F7HZ0194 tuner module on
> both the LME2510 and LME2510C.
>
> Firmware dvb-usb-lme2510-s0194.fw  and/or dvb-usb-lme2510c-s0194.fw
> files are required.
>
> See Documentation/dvb/lmedm04.txt
>
> Patch 535181 is also required.
>
> Signed-off-by: Malcolm Priestley
> ---

> @@ -1110,5 +1220,5 @@ module_exit(lme2510_module_exit);
>
>   MODULE_AUTHOR("Malcolm Priestley");
>   MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0");
> -MODULE_VERSION("1.76");
> +MODULE_VERSION("1.80");
>   MODULE_LICENSE("GPL");


 There were a merge conflict on this patch. The version we have was 1.75.

 Maybe some patch got missed?
>>>
>>> 1.76 relates to remote control patches.
>>>
>>> https://patchwork.kernel.org/patch/499391/
>>> https://patchwork.kernel.org/patch/499401/
>>
>> Those are NEC extended remotes. You are now setting it as 32 bit NEC, in 
>> my understanding it should be defined as 24 bit NEC extended.
>>
>> Anyhow, my opinion is still that we *should* make all NEC remotes as 32 
>> bit and leave handling of NEC 16, NEC 24, NEC 32 to NEC decoder. For 
>> example AF9015 current NEC handling is too complex for that reason... I 
>> don't like how it is implemented currently.
> 
> One of the reasons for using 32 bit was interference from other consumer
> remotes.  It appears, these near identical bubble remotes originate from
> a Chinese factory and supplied with the same product with completely
> different key mapping.
> 
> I am not sure how many of these remotes are common to other devices.

Drivers should get the 32 bit codes form NEC when hardware provides it.
What we currently do is to identify if the code has 16, 24 or 32 bits,
but it is probably better to always handle them as if they have 32 bits.
> 
> Regards
> 
> 
> Malcolm
> 
> 
> --
> 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 1/2] v180 - DM04/QQBOX added support for BS2F7HZ0194 versions

2011-03-22 Thread Mauro Carvalho Chehab
Em 22-03-2011 18:34, Malcolm Priestley escreveu:
> On Mon, 2011-03-21 at 21:40 -0300, Mauro Carvalho Chehab wrote:
>> Em 21-03-2011 21:32, Malcolm Priestley escreveu:
>>> On Mon, 2011-03-21 at 21:17 -0300, Mauro Carvalho Chehab wrote:
 Em 12-02-2011 23:35, Malcolm Priestley escreveu:
> Old versions of these boxes have the BS2F7HZ0194 tuner module on
> both the LME2510 and LME2510C.
>
> Firmware dvb-usb-lme2510-s0194.fw  and/or dvb-usb-lme2510c-s0194.fw
> files are required.
>
> See Documentation/dvb/lmedm04.txt
>
> Patch 535181 is also required.
>
> Signed-off-by: Malcolm Priestley 
> ---

> @@ -1110,5 +1220,5 @@ module_exit(lme2510_module_exit);
>  
>  MODULE_AUTHOR("Malcolm Priestley ");
>  MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0");
> -MODULE_VERSION("1.76");
> +MODULE_VERSION("1.80");
>  MODULE_LICENSE("GPL");


 There were a merge conflict on this patch. The version we have was 1.75.

 Maybe some patch got missed?
>>>
>>> 1.76 relates to remote control patches.
>>>
>>> https://patchwork.kernel.org/patch/499391/
>>> https://patchwork.kernel.org/patch/499401/
>>
>> Ah! Ok, I'll be applying them. Btw, please, move the keycode tables to the
>> proper place and use the RC core stuff. The idea is to remove all those 
>> keytables
>> from kernel in a near future, and use the userspace tool to load it via udev.
> 
> For some reason patch to 1.81(552551) was also missing from the
> Patchwork list earlier, although it is there now.
> 
> https://patchwork.kernel.org/patch/553551/

It where on my list of broken patches (due to the module_version change). 
Applied.

> 
> I will put the RC on the TODO list and hope to complete in the near
> future.

OK, thanks!
> 
> Regards
> 
> 
> Malcolm
> 
> 
> --
> 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 1/2] v180 - DM04/QQBOX added support for BS2F7HZ0194 versions

2011-03-22 Thread Malcolm Priestley
On Tue, 2011-03-22 at 02:43 +0200, Antti Palosaari wrote:
> On 03/22/2011 02:32 AM, Malcolm Priestley wrote:
> > On Mon, 2011-03-21 at 21:17 -0300, Mauro Carvalho Chehab wrote:
> >> Em 12-02-2011 23:35, Malcolm Priestley escreveu:
> >>> Old versions of these boxes have the BS2F7HZ0194 tuner module on
> >>> both the LME2510 and LME2510C.
> >>>
> >>> Firmware dvb-usb-lme2510-s0194.fw  and/or dvb-usb-lme2510c-s0194.fw
> >>> files are required.
> >>>
> >>> See Documentation/dvb/lmedm04.txt
> >>>
> >>> Patch 535181 is also required.
> >>>
> >>> Signed-off-by: Malcolm Priestley
> >>> ---
> >>
> >>> @@ -1110,5 +1220,5 @@ module_exit(lme2510_module_exit);
> >>>
> >>>   MODULE_AUTHOR("Malcolm Priestley");
> >>>   MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0");
> >>> -MODULE_VERSION("1.76");
> >>> +MODULE_VERSION("1.80");
> >>>   MODULE_LICENSE("GPL");
> >>
> >>
> >> There were a merge conflict on this patch. The version we have was 1.75.
> >>
> >> Maybe some patch got missed?
> >
> > 1.76 relates to remote control patches.
> >
> > https://patchwork.kernel.org/patch/499391/
> > https://patchwork.kernel.org/patch/499401/
> 
> Those are NEC extended remotes. You are now setting it as 32 bit NEC, in 
> my understanding it should be defined as 24 bit NEC extended.
> 
> Anyhow, my opinion is still that we *should* make all NEC remotes as 32 
> bit and leave handling of NEC 16, NEC 24, NEC 32 to NEC decoder. For 
> example AF9015 current NEC handling is too complex for that reason... I 
> don't like how it is implemented currently.

One of the reasons for using 32 bit was interference from other consumer
remotes.  It appears, these near identical bubble remotes originate from
a Chinese factory and supplied with the same product with completely
different key mapping.

I am not sure how many of these remotes are common to other devices.

Regards


Malcolm


--
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 1/2] v180 - DM04/QQBOX added support for BS2F7HZ0194 versions

2011-03-22 Thread Malcolm Priestley
On Mon, 2011-03-21 at 21:40 -0300, Mauro Carvalho Chehab wrote:
> Em 21-03-2011 21:32, Malcolm Priestley escreveu:
> > On Mon, 2011-03-21 at 21:17 -0300, Mauro Carvalho Chehab wrote:
> >> Em 12-02-2011 23:35, Malcolm Priestley escreveu:
> >>> Old versions of these boxes have the BS2F7HZ0194 tuner module on
> >>> both the LME2510 and LME2510C.
> >>>
> >>> Firmware dvb-usb-lme2510-s0194.fw  and/or dvb-usb-lme2510c-s0194.fw
> >>> files are required.
> >>>
> >>> See Documentation/dvb/lmedm04.txt
> >>>
> >>> Patch 535181 is also required.
> >>>
> >>> Signed-off-by: Malcolm Priestley 
> >>> ---
> >>
> >>> @@ -1110,5 +1220,5 @@ module_exit(lme2510_module_exit);
> >>>  
> >>>  MODULE_AUTHOR("Malcolm Priestley ");
> >>>  MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0");
> >>> -MODULE_VERSION("1.76");
> >>> +MODULE_VERSION("1.80");
> >>>  MODULE_LICENSE("GPL");
> >>
> >>
> >> There were a merge conflict on this patch. The version we have was 1.75.
> >>
> >> Maybe some patch got missed?
> > 
> > 1.76 relates to remote control patches.
> > 
> > https://patchwork.kernel.org/patch/499391/
> > https://patchwork.kernel.org/patch/499401/
> 
> Ah! Ok, I'll be applying them. Btw, please, move the keycode tables to the
> proper place and use the RC core stuff. The idea is to remove all those 
> keytables
> from kernel in a near future, and use the userspace tool to load it via udev.

For some reason patch to 1.81(552551) was also missing from the
Patchwork list earlier, although it is there now.

https://patchwork.kernel.org/patch/553551/

I will put the RC on the TODO list and hope to complete in the near
future.

Regards


Malcolm


--
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 1/2] v180 - DM04/QQBOX added support for BS2F7HZ0194 versions

2011-03-21 Thread Antti Palosaari

On 03/22/2011 02:32 AM, Malcolm Priestley wrote:

On Mon, 2011-03-21 at 21:17 -0300, Mauro Carvalho Chehab wrote:

Em 12-02-2011 23:35, Malcolm Priestley escreveu:

Old versions of these boxes have the BS2F7HZ0194 tuner module on
both the LME2510 and LME2510C.

Firmware dvb-usb-lme2510-s0194.fw  and/or dvb-usb-lme2510c-s0194.fw
files are required.

See Documentation/dvb/lmedm04.txt

Patch 535181 is also required.

Signed-off-by: Malcolm Priestley
---



@@ -1110,5 +1220,5 @@ module_exit(lme2510_module_exit);

  MODULE_AUTHOR("Malcolm Priestley");
  MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0");
-MODULE_VERSION("1.76");
+MODULE_VERSION("1.80");
  MODULE_LICENSE("GPL");



There were a merge conflict on this patch. The version we have was 1.75.

Maybe some patch got missed?


1.76 relates to remote control patches.

https://patchwork.kernel.org/patch/499391/
https://patchwork.kernel.org/patch/499401/


Those are NEC extended remotes. You are now setting it as 32 bit NEC, in 
my understanding it should be defined as 24 bit NEC extended.


Anyhow, my opinion is still that we *should* make all NEC remotes as 32 
bit and leave handling of NEC 16, NEC 24, NEC 32 to NEC decoder. For 
example AF9015 current NEC handling is too complex for that reason... I 
don't like how it is implemented currently.


Antti


--
http://palosaari.fi/
--
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 1/2] v180 - DM04/QQBOX added support for BS2F7HZ0194 versions

2011-03-21 Thread Mauro Carvalho Chehab
Em 21-03-2011 21:32, Malcolm Priestley escreveu:
> On Mon, 2011-03-21 at 21:17 -0300, Mauro Carvalho Chehab wrote:
>> Em 12-02-2011 23:35, Malcolm Priestley escreveu:
>>> Old versions of these boxes have the BS2F7HZ0194 tuner module on
>>> both the LME2510 and LME2510C.
>>>
>>> Firmware dvb-usb-lme2510-s0194.fw  and/or dvb-usb-lme2510c-s0194.fw
>>> files are required.
>>>
>>> See Documentation/dvb/lmedm04.txt
>>>
>>> Patch 535181 is also required.
>>>
>>> Signed-off-by: Malcolm Priestley 
>>> ---
>>
>>> @@ -1110,5 +1220,5 @@ module_exit(lme2510_module_exit);
>>>  
>>>  MODULE_AUTHOR("Malcolm Priestley ");
>>>  MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0");
>>> -MODULE_VERSION("1.76");
>>> +MODULE_VERSION("1.80");
>>>  MODULE_LICENSE("GPL");
>>
>>
>> There were a merge conflict on this patch. The version we have was 1.75.
>>
>> Maybe some patch got missed?
> 
> 1.76 relates to remote control patches.
> 
> https://patchwork.kernel.org/patch/499391/
> https://patchwork.kernel.org/patch/499401/

Ah! Ok, I'll be applying them. Btw, please, move the keycode tables to the
proper place and use the RC core stuff. The idea is to remove all those 
keytables
from kernel in a near future, and use the userspace tool to load it via udev.

Thanks!
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: [PATCH 1/2] v180 - DM04/QQBOX added support for BS2F7HZ0194 versions

2011-03-21 Thread Malcolm Priestley
On Mon, 2011-03-21 at 21:17 -0300, Mauro Carvalho Chehab wrote:
> Em 12-02-2011 23:35, Malcolm Priestley escreveu:
> > Old versions of these boxes have the BS2F7HZ0194 tuner module on
> > both the LME2510 and LME2510C.
> > 
> > Firmware dvb-usb-lme2510-s0194.fw  and/or dvb-usb-lme2510c-s0194.fw
> > files are required.
> > 
> > See Documentation/dvb/lmedm04.txt
> > 
> > Patch 535181 is also required.
> > 
> > Signed-off-by: Malcolm Priestley 
> > ---
> 
> > @@ -1110,5 +1220,5 @@ module_exit(lme2510_module_exit);
> >  
> >  MODULE_AUTHOR("Malcolm Priestley ");
> >  MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0");
> > -MODULE_VERSION("1.76");
> > +MODULE_VERSION("1.80");
> >  MODULE_LICENSE("GPL");
> 
> 
> There were a merge conflict on this patch. The version we have was 1.75.
> 
> Maybe some patch got missed?

1.76 relates to remote control patches.

https://patchwork.kernel.org/patch/499391/
https://patchwork.kernel.org/patch/499401/

Regards

Malcolm


--
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 1/2] v180 - DM04/QQBOX added support for BS2F7HZ0194 versions

2011-03-21 Thread Mauro Carvalho Chehab
Em 12-02-2011 23:35, Malcolm Priestley escreveu:
> Old versions of these boxes have the BS2F7HZ0194 tuner module on
> both the LME2510 and LME2510C.
> 
> Firmware dvb-usb-lme2510-s0194.fw  and/or dvb-usb-lme2510c-s0194.fw
> files are required.
> 
> See Documentation/dvb/lmedm04.txt
> 
> Patch 535181 is also required.
> 
> Signed-off-by: Malcolm Priestley 
> ---

> @@ -1110,5 +1220,5 @@ module_exit(lme2510_module_exit);
>  
>  MODULE_AUTHOR("Malcolm Priestley ");
>  MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0");
> -MODULE_VERSION("1.76");
> +MODULE_VERSION("1.80");
>  MODULE_LICENSE("GPL");


There were a merge conflict on this patch. The version we have was 1.75.

Maybe some patch got missed?

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


[PATCH 1/2] v180 - DM04/QQBOX added support for BS2F7HZ0194 versions

2011-02-12 Thread Malcolm Priestley
Old versions of these boxes have the BS2F7HZ0194 tuner module on
both the LME2510 and LME2510C.

Firmware dvb-usb-lme2510-s0194.fw  and/or dvb-usb-lme2510c-s0194.fw
files are required.

See Documentation/dvb/lmedm04.txt

Patch 535181 is also required.

Signed-off-by: Malcolm Priestley 
---
 drivers/media/dvb/dvb-usb/lmedm04.c |  230 ++-
 1 files changed, 170 insertions(+), 60 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/lmedm04.c 
b/drivers/media/dvb/dvb-usb/lmedm04.c
index c58d3fc..cd26e7c 100644
--- a/drivers/media/dvb/dvb-usb/lmedm04.c
+++ b/drivers/media/dvb/dvb-usb/lmedm04.c
@@ -2,7 +2,9 @@
  *
  * DM04/QQBOX DVB-S USB BOXLME2510C + SHARP:BS2F7HZ7395
  * LME2510C + LG TDQY-P001F
+ * LME2510C + BS2F7HZ0194
  * LME2510 + LG TDQY-P001F
+ * LME2510 + BS2F7HZ0194
  *
  * MVB7395 (LME2510C+SHARP:BS2F7HZ7395)
  * SHARP:BS2F7HZ7395 = (STV0288+Sharp IX2505V)
@@ -12,20 +14,22 @@
  *
  * MVB0001F (LME2510C+LGTDQT-P001F)
  *
+ * MV0194 (LME2510+SHARP:BS2F7HZ0194)
+ * SHARP:BS2F7HZ0194 = (STV0299+IX2410)
+ *
+ * MVB0194 (LME2510C+SHARP0194)
+ *
  * For firmware see Documentation/dvb/lmedm04.txt
  *
  * I2C addresses:
  * 0xd0 - STV0288  - Demodulator
  * 0xc0 - Sharp IX2505V- Tuner
- * --or--
+ * --
  * 0x1c - TDA10086   - Demodulator
  * 0xc0 - TDA8263- Tuner
- *
- * ***Please Note***
- * There are other variants of the DM04
- * ***NOT SUPPORTED***
- * MV0194 (LME2510+SHARP0194)
- * MVB0194 (LME2510C+SHARP0194)
+ * --
+ * 0xd0 - STV0299  - Demodulator
+ * 0xc0 - IX2410   - Tuner
  *
  *
  * VID = 3344  PID LME2510=1122 LME2510C=1120
@@ -55,6 +59,9 @@
  *
  * QQbox suffers from noise on LNB voltage.
  *
+ * LME2510: SHARP:BS2F7HZ0194(MV0194) cannot cold reset and share system
+ * with other tuners. After a cold reset streaming will not start.
+ *
  * PID functions have been removed from this driver version due to
  * problems with different firmware and application versions.
  */
@@ -69,6 +76,9 @@
 #include "tda10086.h"
 #include "stv0288.h"
 #include "ix2505v.h"
+#include "stv0299.h"
+#include "dvb-pll.h"
+#include "z0194a.h"
 
 
 
@@ -96,8 +106,11 @@ MODULE_PARM_DESC(firmware, "set default firmware 
0=Sharp7395 1=LG");
 
 
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
+#define TUNER_DEFAULT  0x0
 #define TUNER_LG   0x1
 #define TUNER_S73950x2
+#define TUNER_S01940x3
 
 struct lme2510_state {
u8 id;
@@ -250,6 +263,7 @@ static void lme2510_int_response(struct urb *lme_urb)
st->time_key = ibuf[7];
break;
case TUNER_S7395:
+   case TUNER_S0194:
/* Tweak for earlier firmware*/
if (ibuf[1] == 0x03) {
if (ibuf[2] > 1)
@@ -365,6 +379,18 @@ static int lme2510_msg(struct dvb_usb_device *d,
msleep(5);
}
break;
+   case TUNER_S0194:
+   if (wbuf[2] == 0xd0) {
+   if (wbuf[3] == 0x1b) {
+   st->signal_lock = rbuf[1];
+   if ((st->stream_on & 1) &&
+   (st->signal_lock & 0x8)) {
+   lme2510_stream_restart(d);
+   st->i2c_talk_onoff = 0;
+   }
+   }
+   }
+   break;
default:
break;
}
@@ -424,6 +450,34 @@ static int lme2510_msg(struct dvb_usb_device *d,
break;
}
break;
+   case TUNER_S0194:
+   switch (wbuf[3]) {
+   case 0x18:
+   rbuf[0] = 0x55;
+   rbuf[1] = (st->signal_level & 0x80)
+   ? 0 : (st->signal_level * 2);
+   break;
+   case 0x24:
+   rbuf[0] = 0x55;
+   rbuf[1] = st->signal_sn;
+   break;
+   case 0x1b:
+   rbuf[0] = 0x55;
+   rbuf[1] = st->signal_lock;
+   break;
+   case 0x19:
+   case 0x25:
+   case 0x1e:
+   case 0x1d:
+   rbuf[0] = 0x55;
+   rbuf[1] = 0x