aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-04-04 19:38:46 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-04-04 19:48:54 (GMT)
commita500c7f35da96e4d87d5527f3ffa986db0c5d0b9 (patch)
treec56903815daa2d953807df668db6dfecc09da8ad
parentd38f4ed1e7e45793f20d0ac8092f254910b69d3c (diff)
Fix compilation with kernels older than 2.6.36
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--backports/v2.6.31_series1
-rw-r--r--backports/v2.6.32_series1
-rw-r--r--backports/v2.6.33_input_handlers_are_int.patch19
-rw-r--r--backports/v2.6.33_series1
-rw-r--r--backports/v2.6.34_series1
-rw-r--r--backports/v2.6.35_series1
-rw-r--r--backports/v2.6.36_dvb_usb_input_getkeycode.patch145
-rw-r--r--backports/v2.6.36_series1
8 files changed, 160 insertions, 10 deletions
diff --git a/backports/v2.6.31_series b/backports/v2.6.31_series
index 5d7067d..2ed1390 100644
--- a/backports/v2.6.31_series
+++ b/backports/v2.6.31_series
@@ -1,5 +1,6 @@
v2.6.37_dont_use_alloc_ordered_workqueue.patch
v2.6.36_input_getkeycode.patch
+v2.6.36_dvb_usb_input_getkeycode.patch
v2.6.35_vm_prev.patch
v2.6.35_firedtv_handle_fcp.patch
v2.6.35_i2c_new_probed_device.patch
diff --git a/backports/v2.6.32_series b/backports/v2.6.32_series
index 88c9f6f..d20e517 100644
--- a/backports/v2.6.32_series
+++ b/backports/v2.6.32_series
@@ -1,5 +1,6 @@
v2.6.37_dont_use_alloc_ordered_workqueue.patch
v2.6.36_input_getkeycode.patch
+v2.6.36_dvb_usb_input_getkeycode.patch
v2.6.35_vm_prev.patch
v2.6.35_firedtv_handle_fcp.patch
v2.6.35_i2c_new_probed_device.patch
diff --git a/backports/v2.6.33_input_handlers_are_int.patch b/backports/v2.6.33_input_handlers_are_int.patch
index 2c4f15a..a2db6d7 100644
--- a/backports/v2.6.33_input_handlers_are_int.patch
+++ b/backports/v2.6.33_input_handlers_are_int.patch
@@ -1,7 +1,7 @@
---
- drivers/media/dvb/dvb-usb/dvb-usb-remote.c | 5 ++---
+ drivers/media/dvb/dvb-usb/dvb-usb-remote.c | 4 ++--
drivers/media/rc/rc-main.c | 4 ++--
- 2 files changed, 4 insertions(+), 5 deletions(-)
+ 2 files changed, 4 insertions(+), 4 deletions(-)
--- linux.orig/drivers/media/rc/rc-main.c
+++ linux/drivers/media/rc/rc-main.c
@@ -25,22 +25,21 @@
struct rc_map *rc_map = &rdev->rc_map;
--- linux.orig/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
+++ linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
-@@ -42,7 +42,7 @@ legacy_dvb_usb_get_keymap_index(const st
- }
+@@ -9,7 +9,7 @@
+ #include <linux/usb/input.h>
static int legacy_dvb_usb_getkeycode(struct input_dev *dev,
-- struct input_keymap_entry *ke)
+- unsigned int scancode, unsigned int *keycode)
+ int scancode, int *keycode)
{
struct dvb_usb_device *d = input_get_drvdata(dev);
- struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table;
-@@ -64,8 +64,7 @@ static int legacy_dvb_usb_getkeycode(str
+
+@@ -39,7 +39,7 @@ static int legacy_dvb_usb_getkeycode(str
}
static int legacy_dvb_usb_setkeycode(struct input_dev *dev,
-- const struct input_keymap_entry *ke,
-- unsigned int *old_keycode)
+- unsigned int scancode, unsigned int keycode)
+ int scancode, int keycode)
{
struct dvb_usb_device *d = input_get_drvdata(dev);
- struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table;
+
diff --git a/backports/v2.6.33_series b/backports/v2.6.33_series
index 9706b57..cfbd00b 100644
--- a/backports/v2.6.33_series
+++ b/backports/v2.6.33_series
@@ -1,5 +1,6 @@
v2.6.37_dont_use_alloc_ordered_workqueue.patch
v2.6.36_input_getkeycode.patch
+v2.6.36_dvb_usb_input_getkeycode.patch
v2.6.35_vm_prev.patch
v2.6.35_firedtv_handle_fcp.patch
v2.6.35_i2c_new_probed_device.patch
diff --git a/backports/v2.6.34_series b/backports/v2.6.34_series
index 2e269dd..f9ecd77 100644
--- a/backports/v2.6.34_series
+++ b/backports/v2.6.34_series
@@ -1,5 +1,6 @@
v2.6.37_dont_use_alloc_ordered_workqueue.patch
v2.6.36_input_getkeycode.patch
+v2.6.36_dvb_usb_input_getkeycode.patch
v2.6.35_vm_prev.patch
v2.6.35_firedtv_handle_fcp.patch
v2.6.35_i2c_new_probed_device.patch
diff --git a/backports/v2.6.35_series b/backports/v2.6.35_series
index d8646a2..50b3237 100644
--- a/backports/v2.6.35_series
+++ b/backports/v2.6.35_series
@@ -1,5 +1,6 @@
v2.6.37_dont_use_alloc_ordered_workqueue.patch
v2.6.36_input_getkeycode.patch
+v2.6.36_dvb_usb_input_getkeycode.patch
v2.6.35_vm_prev.patch
v2.6.35_firedtv_handle_fcp.patch
v2.6.35_i2c_new_probed_device.patch
diff --git a/backports/v2.6.36_dvb_usb_input_getkeycode.patch b/backports/v2.6.36_dvb_usb_input_getkeycode.patch
new file mode 100644
index 0000000..9ef469c
--- /dev/null
+++ b/backports/v2.6.36_dvb_usb_input_getkeycode.patch
@@ -0,0 +1,145 @@
+---
+ drivers/media/dvb/dvb-usb/dvb-usb-remote.c | 111 ++++++++++-------------------
+ 1 file changed, 42 insertions(+), 69 deletions(-)
+
+--- linux.orig/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
++++ linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
+@@ -8,71 +8,60 @@
+ #include "dvb-usb-common.h"
+ #include <linux/usb/input.h>
+
+-static unsigned int
+-legacy_dvb_usb_get_keymap_index(const struct input_keymap_entry *ke,
+- struct rc_map_table *keymap,
+- unsigned int keymap_size)
+-{
+- unsigned int index;
+- unsigned int scancode;
+-
+- if (ke->flags & INPUT_KEYMAP_BY_INDEX) {
+- index = ke->index;
+- } else {
+- if (input_scancode_to_scalar(ke, &scancode))
+- return keymap_size;
+-
+- /* See if we can match the raw key code. */
+- for (index = 0; index < keymap_size; index++)
+- if (keymap[index].scancode == scancode)
+- break;
+-
+- /* See if there is an unused hole in the map */
+- if (index >= keymap_size) {
+- for (index = 0; index < keymap_size; index++) {
+- if (keymap[index].keycode == KEY_RESERVED ||
+- keymap[index].keycode == KEY_UNKNOWN) {
+- break;
+- }
+- }
+- }
+- }
+-
+- return index;
+-}
+-
+ static int legacy_dvb_usb_getkeycode(struct input_dev *dev,
+- struct input_keymap_entry *ke)
++ unsigned int scancode, unsigned int *keycode)
+ {
+ struct dvb_usb_device *d = input_get_drvdata(dev);
++
+ struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table;
+- unsigned int keymap_size = d->props.rc.legacy.rc_map_size;
+- unsigned int index;
++ int i;
+
+- index = legacy_dvb_usb_get_keymap_index(ke, keymap, keymap_size);
+- if (index >= keymap_size)
+- return -EINVAL;
+-
+- ke->keycode = keymap[index].keycode;
+- if (ke->keycode == KEY_UNKNOWN)
+- ke->keycode = KEY_RESERVED;
+- ke->len = sizeof(keymap[index].scancode);
+- memcpy(&ke->scancode, &keymap[index].scancode, ke->len);
+- ke->index = index;
++ /* See if we can match the raw key code. */
++ for (i = 0; i < d->props.rc.legacy.rc_map_size; i++)
++ if (keymap[i].scancode == scancode) {
++ *keycode = keymap[i].keycode;
++ return 0;
++ }
+
+- return 0;
++ /*
++ * If is there extra space, returns KEY_RESERVED,
++ * otherwise, input core won't let legacy_dvb_usb_setkeycode
++ * to work
++ */
++ for (i = 0; i < d->props.rc.legacy.rc_map_size; i++)
++ if (keymap[i].keycode == KEY_RESERVED ||
++ keymap[i].keycode == KEY_UNKNOWN) {
++ *keycode = KEY_RESERVED;
++ return 0;
++ }
++
++ return -EINVAL;
+ }
+
+ static int legacy_dvb_usb_setkeycode(struct input_dev *dev,
+- const struct input_keymap_entry *ke,
+- unsigned int *old_keycode)
++ unsigned int scancode, unsigned int keycode)
+ {
+ struct dvb_usb_device *d = input_get_drvdata(dev);
++
+ struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table;
+- unsigned int keymap_size = d->props.rc.legacy.rc_map_size;
+- unsigned int index;
++ int i;
++
++ /* Search if it is replacing an existing keycode */
++ for (i = 0; i < d->props.rc.legacy.rc_map_size; i++)
++ if (keymap[i].scancode == scancode) {
++ keymap[i].keycode = keycode;
++ return 0;
++ }
++
++ /* Search if is there a clean entry. If so, use it */
++ for (i = 0; i < d->props.rc.legacy.rc_map_size; i++)
++ if (keymap[i].keycode == KEY_RESERVED ||
++ keymap[i].keycode == KEY_UNKNOWN) {
++ keymap[i].scancode = scancode;
++ keymap[i].keycode = keycode;
++ return 0;
++ }
+
+- index = legacy_dvb_usb_get_keymap_index(ke, keymap, keymap_size);
+ /*
+ * FIXME: Currently, it is not possible to increase the size of
+ * scancode table. For it to happen, one possibility
+@@ -80,24 +69,8 @@ static int legacy_dvb_usb_setkeycode(str
+ * copying data, appending the new key on it, and freeing
+ * the old one - or maybe just allocating some spare space
+ */
+- if (index >= keymap_size)
+- return -EINVAL;
+
+- *old_keycode = keymap[index].keycode;
+- keymap->keycode = ke->keycode;
+- __set_bit(ke->keycode, dev->keybit);
+-
+- if (*old_keycode != KEY_RESERVED) {
+- __clear_bit(*old_keycode, dev->keybit);
+- for (index = 0; index < keymap_size; index++) {
+- if (keymap[index].keycode == *old_keycode) {
+- __set_bit(*old_keycode, dev->keybit);
+- break;
+- }
+- }
+- }
+-
+- return 0;
++ return -EINVAL;
+ }
+
+ /* Remote-control poll function - called every dib->rc_query_interval ms to see
diff --git a/backports/v2.6.36_series b/backports/v2.6.36_series
index 393d578..34814e9 100644
--- a/backports/v2.6.36_series
+++ b/backports/v2.6.36_series
@@ -1,2 +1,3 @@
v2.6.37_dont_use_alloc_ordered_workqueue.patch
v2.6.36_input_getkeycode.patch
+v2.6.36_dvb_usb_input_getkeycode.patch

Privacy Policy