summaryrefslogtreecommitdiff
path: root/linux/drivers/media/common/ir-functions.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-09-13 11:53:31 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-13 11:53:31 -0300
commit4c691e7dabc47811013c7266fa5f32fe96687c36 (patch)
treea6185d7724be9b53607ab988625fd75052b1a9b2 /linux/drivers/media/common/ir-functions.c
parent8201f56625ffdc9146ad8eb4525c1b50e6194f5a (diff)
parent4198bf24c30e208e3c1a4d833e52ee2330bdb008 (diff)
downloadmediapointer-dvb-s2-4c691e7dabc47811013c7266fa5f32fe96687c36.tar.gz
mediapointer-dvb-s2-4c691e7dabc47811013c7266fa5f32fe96687c36.tar.bz2
merge: http://kernellabs.com/hg/~dheitmueller/em28xx-vbi3
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/common/ir-functions.c')
-rw-r--r--linux/drivers/media/common/ir-functions.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/linux/drivers/media/common/ir-functions.c b/linux/drivers/media/common/ir-functions.c
index ddbd4be99..38e1ee13a 100644
--- a/linux/drivers/media/common/ir-functions.c
+++ b/linux/drivers/media/common/ir-functions.c
@@ -59,13 +59,24 @@ static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir)
/* -------------------------------------------------------------------------- */
void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
- int ir_type, IR_KEYTAB_TYPE *ir_codes)
+ int ir_type, struct ir_scancode_table *ir_codes)
{
int i;
ir->ir_type = ir_type;
+
+ memset(ir->ir_codes, sizeof(ir->ir_codes), 0);
+
+ /*
+ * FIXME: This is a temporary workaround to use the new IR tables
+ * with the old approach. Later patches will replace this to a
+ * proper method
+ */
+
if (ir_codes)
- memcpy(ir->ir_codes, ir_codes, sizeof(ir->ir_codes));
+ for (i = 0; i < ir_codes->size; i++)
+ if (ir_codes->scan[i].scancode < IR_KEYTAB_SIZE)
+ ir->ir_codes[ir_codes->scan[i].scancode] = ir_codes->scan[i].keycode;
dev->keycode = ir->ir_codes;
dev->keycodesize = sizeof(IR_KEYTAB_TYPE);