diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-11-29 09:08:02 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:42:21 -0500 |
commit | f6fc50494027e913ff0159e43c593cd75f35ec7a (patch) | |
tree | e9337bfa7c65fb9d35db726003b84907c9b9ac61 /drivers/media/common/ir-functions.c | |
parent | 055cd55601f948675006ca90362fc2bfaae90a86 (diff) |
V4L/DVB (13538): ir-common: Use a dynamic keycode table
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/ir-functions.c')
-rw-r--r-- | drivers/media/common/ir-functions.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/media/common/ir-functions.c b/drivers/media/common/ir-functions.c index b31bd27da374..e616f624ceaa 100644 --- a/drivers/media/common/ir-functions.c +++ b/drivers/media/common/ir-functions.c | |||
@@ -59,12 +59,20 @@ int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | |||
59 | { | 59 | { |
60 | ir->ir_type = ir_type; | 60 | ir->ir_type = ir_type; |
61 | 61 | ||
62 | /* FIXME: Add the proper code to dynamically allocate IR table */ | 62 | ir->keytable.size = ir_roundup_tablesize(ir_codes->size); |
63 | ir->keytable.scan = kzalloc(ir->keytable.size * | ||
64 | sizeof(struct ir_scancode), GFP_KERNEL); | ||
65 | if (!ir->keytable.scan) | ||
66 | return -ENOMEM; | ||
63 | 67 | ||
64 | ir_set_keycode_table(dev, ir_codes); | 68 | IR_dprintk(1, "Allocated space for %d keycode entries (%zd bytes)\n", |
69 | ir->keytable.size, | ||
70 | ir->keytable.size * sizeof(ir->keytable.scan)); | ||
65 | 71 | ||
66 | clear_bit(0, dev->keybit); | 72 | ir_copy_table(&ir->keytable, ir_codes); |
73 | ir_set_keycode_table(dev, &ir->keytable); | ||
67 | 74 | ||
75 | clear_bit(0, dev->keybit); | ||
68 | set_bit(EV_KEY, dev->evbit); | 76 | set_bit(EV_KEY, dev->evbit); |
69 | if (repeat) | 77 | if (repeat) |
70 | set_bit(EV_REP, dev->evbit); | 78 | set_bit(EV_REP, dev->evbit); |
@@ -73,11 +81,6 @@ int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | |||
73 | } | 81 | } |
74 | EXPORT_SYMBOL_GPL(ir_input_init); | 82 | EXPORT_SYMBOL_GPL(ir_input_init); |
75 | 83 | ||
76 | void ir_input_free(struct input_dev *input_dev) | ||
77 | { | ||
78 | /* FIXME: Add the proper code to free allocated resources */ | ||
79 | } | ||
80 | EXPORT_SYMBOL_GPL(ir_input_free); | ||
81 | 84 | ||
82 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir) | 85 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir) |
83 | { | 86 | { |