Re: [PATCH] Rework the RTL2831 remote control handler to reuse dibusb.

2009-08-16 Thread Antti Palosaari

Moikka Jan

On 08/04/2009 12:27 AM, Jan Hoogenraad wrote:

Antti Palosaari offered help in july to get the includable tree
(front-end / back-end split) up and running. I haven't heard from him
since, so I cc him.


I have been lazy and holidaying.
But yesterday I finally take my devel tree back to desk and got it 
working! Now it is basically split to the USB-bridge, demodulator and 
mt2060 (using Kernel mt2060 driver). There is still a lot of work to 
clean all code and implement correctly. It is now only routine work from 
callback to callback. Will continue.


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] Rework the RTL2831 remote control handler to reuse dibusb.

2009-08-03 Thread Jan Hoogenraad

Alistar:

Thanks a lot for this patch.
I have never included a patch into the HG tree, so it will take a few 
days to get this into the -r2 tree.


Can you also look at the way I set up a command-line switch for 
switching remotes ?

Is there a standard within the other drivers ?
And should I write something in the Wiki ?

Antti Palosaari offered help in july to get the includable tree 
(front-end / back-end split) up and running. I haven't heard from him 
since, so I cc him.


Alistair Buxton wrote:

Hi. This patch is against the rtl2831-r2 tree.

This patch is really just a proof of concept, that the dibusb handler
code can handle the rtl2831 remote codes. I have both types of device
and noticed that the remotes are interchangable, and it turns out the
code tables are too, but for a quirk in the way the rtl driver looks
up the values (it uses the wrong fields in keybuf.)

Is there any progress on getting the rtl2831 driver ready for
inclusion into the mainline?

# HG changeset patch
# User Alistair Buxton a.j.bux...@gmail.com
# Date 1249239142 -3600
# Node ID 83476a81ce48824891f64cebfd293239acafc878
# Parent  1557237aa2ebb25d807e4af251fdf08b182660fb
RTL2831: Rework the RTL2831 remote control code to reuse the dibusb
remote control handler.

1. Add the extra codes of the AzureWave AD-TU800 remote to the dibusb
code table. This remote
uses the same NEC codes as the dibusb remotes, but with extra buttons.
As a bonus, this makes the AzureWave remote work with dibusb devices too.

2. Make rtd2831u_rc_query() use dvb_usb_nec_rc_key_to_event() instead
of it's own slightly
broken implementation.

3. Fix up the Conceptronic keycode table. This is NEC compatible but
uses different codes to
the dibusb_rc_keys[]. The fields are switched around to make the table
compatible with
dvb_usb_nec_rc_key_to_event().

4. Fudge the keybuf when using RC5 table.

5. Fix all the drivers that use dibusb_rc_keys[] with the new length.

diff -r 1557237aa2eb -r 83476a81ce48
linux/drivers/media/dvb/dvb-usb/dibusb-common.c
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-common.c   Tue May 19
22:29:10 2009 +0200
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-common.c   Sun Aug 02
19:52:22 2009 +0100
@@ -351,6 +351,31 @@
{ 0x00, 0x48, KEY_INFO }, /* Preview */
{ 0x00, 0x04, KEY_LIST }, /* RecordList */
{ 0x00, 0x0f, KEY_TEXT }, /* Teletext */
+   /* additional keys for the azurewave remote */
+   { 0x00, 0x4a, KEY_UNKNOWN }, /* Clear */
+   { 0x00, 0x13, KEY_BACK },
+   { 0x00, 0x4b, KEY_UP },
+   { 0x00, 0x51, KEY_DOWN },
+   { 0x00, 0x4e, KEY_LEFT },
+   { 0x00, 0x52, KEY_RIGHT },  
+   { 0x00, 0x4f, KEY_ENTER },
+   { 0x00, 0x4c, KEY_PAUSE },
+   { 0x00, 0x41, KEY_PREVIOUSSONG }, /* | */
+   { 0x00, 0x42, KEY_NEXTSONG }, /* | */
+   { 0x00, 0x54, KEY_CAMERA }, /* capture (has picture of camera on it) */
+   { 0x00, 0x50, KEY_UNKNOWN }, /* SAP */
+   { 0x00, 0x47, KEY_UNKNOWN }, /* PIP */
+   { 0x00, 0x4d, KEY_UNKNOWN }, /* fullscreen */
+   { 0x00, 0x43, KEY_SUBTITLE },
+   { 0x00, 0x49, KEY_UNKNOWN }, /* L/R */
+   { 0x00, 0x07, KEY_POWER2 }, /* hibernate */
+   { 0x00, 0x08, KEY_VIDEO_NEXT },
+   { 0x00, 0x45, KEY_ZOOMIN },
+   { 0x00, 0x46, KEY_ZOOMOUT },
+   { 0x00, 0x18, KEY_RED },
+   { 0x00, 0x53, KEY_GREEN },
+   { 0x00, 0x5e, KEY_YELLOW },
+   { 0x00, 0x5f, KEY_BLUE },
/* Key codes for the KWorld/ADSTech/JetWay remote. */
{ 0x86, 0x12, KEY_POWER },
{ 0x86, 0x0f, KEY_SELECT }, /* source */
diff -r 1557237aa2eb -r 83476a81ce48 linux/drivers/media/dvb/dvb-usb/dibusb-mb.c
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c   Tue May 19 22:29:10 
2009 +0200
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c   Sun Aug 02 19:52:22 
2009 +0100
@@ -213,7 +213,7 @@

.rc_interval  = DEFAULT_RC_INTERVAL,
.rc_key_map   = dibusb_rc_keys,
-   .rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it
to the driver dynamically */
+   .rc_key_map_size  = 135, /* wow, that is ugly ... I want to load it
to the driver dynamically */
.rc_query = dibusb_rc_query,

.i2c_algo = dibusb_i2c_algo,
@@ -297,7 +297,7 @@

.rc_interval  = DEFAULT_RC_INTERVAL,
.rc_key_map   = dibusb_rc_keys,
-   .rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it
to the driver dynamically */
+   .rc_key_map_size  = 135, /* wow, that is ugly ... I want to load it
to the driver dynamically */
.rc_query = dibusb_rc_query,

.i2c_algo = dibusb_i2c_algo,
@@ -361,7 +361,7 @@

.rc_interval  = DEFAULT_RC_INTERVAL,
.rc_key_map   = dibusb_rc_keys,
-   .rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it
to the driver dynamically */
+   .rc_key_map_size  = 135, /* wow, that is ugly ... I want to load it
to the driver dynamically */

[PATCH] Rework the RTL2831 remote control handler to reuse dibusb.

2009-08-02 Thread Alistair Buxton
Hi. This patch is against the rtl2831-r2 tree.

This patch is really just a proof of concept, that the dibusb handler
code can handle the rtl2831 remote codes. I have both types of device
and noticed that the remotes are interchangable, and it turns out the
code tables are too, but for a quirk in the way the rtl driver looks
up the values (it uses the wrong fields in keybuf.)

Is there any progress on getting the rtl2831 driver ready for
inclusion into the mainline?

# HG changeset patch
# User Alistair Buxton a.j.bux...@gmail.com
# Date 1249239142 -3600
# Node ID 83476a81ce48824891f64cebfd293239acafc878
# Parent  1557237aa2ebb25d807e4af251fdf08b182660fb
RTL2831: Rework the RTL2831 remote control code to reuse the dibusb
remote control handler.

1. Add the extra codes of the AzureWave AD-TU800 remote to the dibusb
code table. This remote
uses the same NEC codes as the dibusb remotes, but with extra buttons.
As a bonus, this makes
the AzureWave remote work with dibusb devices too.

2. Make rtd2831u_rc_query() use dvb_usb_nec_rc_key_to_event() instead
of it's own slightly
broken implementation.

3. Fix up the Conceptronic keycode table. This is NEC compatible but
uses different codes to
the dibusb_rc_keys[]. The fields are switched around to make the table
compatible with
dvb_usb_nec_rc_key_to_event().

4. Fudge the keybuf when using RC5 table.

5. Fix all the drivers that use dibusb_rc_keys[] with the new length.

diff -r 1557237aa2eb -r 83476a81ce48
linux/drivers/media/dvb/dvb-usb/dibusb-common.c
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-common.c   Tue May 19
22:29:10 2009 +0200
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-common.c   Sun Aug 02
19:52:22 2009 +0100
@@ -351,6 +351,31 @@
{ 0x00, 0x48, KEY_INFO }, /* Preview */
{ 0x00, 0x04, KEY_LIST }, /* RecordList */
{ 0x00, 0x0f, KEY_TEXT }, /* Teletext */
+   /* additional keys for the azurewave remote */
+   { 0x00, 0x4a, KEY_UNKNOWN }, /* Clear */
+   { 0x00, 0x13, KEY_BACK },
+   { 0x00, 0x4b, KEY_UP },
+   { 0x00, 0x51, KEY_DOWN },
+   { 0x00, 0x4e, KEY_LEFT },
+   { 0x00, 0x52, KEY_RIGHT },  
+   { 0x00, 0x4f, KEY_ENTER },
+   { 0x00, 0x4c, KEY_PAUSE },
+   { 0x00, 0x41, KEY_PREVIOUSSONG }, /* | */
+   { 0x00, 0x42, KEY_NEXTSONG }, /* | */
+   { 0x00, 0x54, KEY_CAMERA }, /* capture (has picture of camera on it) */
+   { 0x00, 0x50, KEY_UNKNOWN }, /* SAP */
+   { 0x00, 0x47, KEY_UNKNOWN }, /* PIP */
+   { 0x00, 0x4d, KEY_UNKNOWN }, /* fullscreen */
+   { 0x00, 0x43, KEY_SUBTITLE },
+   { 0x00, 0x49, KEY_UNKNOWN }, /* L/R */
+   { 0x00, 0x07, KEY_POWER2 }, /* hibernate */
+   { 0x00, 0x08, KEY_VIDEO_NEXT },
+   { 0x00, 0x45, KEY_ZOOMIN },
+   { 0x00, 0x46, KEY_ZOOMOUT },
+   { 0x00, 0x18, KEY_RED },
+   { 0x00, 0x53, KEY_GREEN },
+   { 0x00, 0x5e, KEY_YELLOW },
+   { 0x00, 0x5f, KEY_BLUE },
/* Key codes for the KWorld/ADSTech/JetWay remote. */
{ 0x86, 0x12, KEY_POWER },
{ 0x86, 0x0f, KEY_SELECT }, /* source */
diff -r 1557237aa2eb -r 83476a81ce48 linux/drivers/media/dvb/dvb-usb/dibusb-mb.c
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c   Tue May 19 22:29:10 
2009 +0200
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c   Sun Aug 02 19:52:22 
2009 +0100
@@ -213,7 +213,7 @@

.rc_interval  = DEFAULT_RC_INTERVAL,
.rc_key_map   = dibusb_rc_keys,
-   .rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it
to the driver dynamically */
+   .rc_key_map_size  = 135, /* wow, that is ugly ... I want to load it
to the driver dynamically */
.rc_query = dibusb_rc_query,

.i2c_algo = dibusb_i2c_algo,
@@ -297,7 +297,7 @@

.rc_interval  = DEFAULT_RC_INTERVAL,
.rc_key_map   = dibusb_rc_keys,
-   .rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it
to the driver dynamically */
+   .rc_key_map_size  = 135, /* wow, that is ugly ... I want to load it
to the driver dynamically */
.rc_query = dibusb_rc_query,

.i2c_algo = dibusb_i2c_algo,
@@ -361,7 +361,7 @@

.rc_interval  = DEFAULT_RC_INTERVAL,
.rc_key_map   = dibusb_rc_keys,
-   .rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it
to the driver dynamically */
+   .rc_key_map_size  = 135, /* wow, that is ugly ... I want to load it
to the driver dynamically */
.rc_query = dibusb_rc_query,

.i2c_algo = dibusb_i2c_algo,
@@ -418,7 +418,7 @@

.rc_interval  = DEFAULT_RC_INTERVAL,
.rc_key_map   = dibusb_rc_keys,
-   .rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it
to the driver dynamically */
+   .rc_key_map_size  = 135, /* wow, that is ugly ... I want to load it
to the driver dynamically */
.rc_query = dibusb_rc_query,

.i2c_algo = dibusb_i2c_algo,
diff -r