diff options
Diffstat (limited to 'drivers/media/common/ir-functions.c')
-rw-r--r-- | drivers/media/common/ir-functions.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/media/common/ir-functions.c b/drivers/media/common/ir-functions.c index 16792a68a449..655474b29e21 100644 --- a/drivers/media/common/ir-functions.c +++ b/drivers/media/common/ir-functions.c | |||
@@ -58,13 +58,24 @@ static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir) | |||
58 | /* -------------------------------------------------------------------------- */ | 58 | /* -------------------------------------------------------------------------- */ |
59 | 59 | ||
60 | void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | 60 | void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, |
61 | int ir_type, IR_KEYTAB_TYPE *ir_codes) | 61 | int ir_type, struct ir_scancode_table *ir_codes) |
62 | { | 62 | { |
63 | int i; | 63 | int i; |
64 | 64 | ||
65 | ir->ir_type = ir_type; | 65 | ir->ir_type = ir_type; |
66 | |||
67 | memset(ir->ir_codes, sizeof(ir->ir_codes), 0); | ||
68 | |||
69 | /* | ||
70 | * FIXME: This is a temporary workaround to use the new IR tables | ||
71 | * with the old approach. Later patches will replace this to a | ||
72 | * proper method | ||
73 | */ | ||
74 | |||
66 | if (ir_codes) | 75 | if (ir_codes) |
67 | memcpy(ir->ir_codes, ir_codes, sizeof(ir->ir_codes)); | 76 | for (i = 0; i < ir_codes->size; i++) |
77 | if (ir_codes->scan[i].scancode < IR_KEYTAB_SIZE) | ||
78 | ir->ir_codes[ir_codes->scan[i].scancode] = ir_codes->scan[i].keycode; | ||
68 | 79 | ||
69 | dev->keycode = ir->ir_codes; | 80 | dev->keycode = ir->ir_codes; |
70 | dev->keycodesize = sizeof(IR_KEYTAB_TYPE); | 81 | dev->keycodesize = sizeof(IR_KEYTAB_TYPE); |