aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common/ir-functions.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-11-29 06:19:59 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:42:21 -0500
commit055cd55601f948675006ca90362fc2bfaae90a86 (patch)
treea878c55c30b0ae30334f3523d8dd67940d32a7f3 /drivers/media/common/ir-functions.c
parent0278155c84af42d78785731263b69fb49f945ea7 (diff)
V4L/DVB (13537): ir: Prepare the code for dynamic keycode table allocation
Currently, the IR table is initialized by calling ir_input_init(). However, this function doesn't return any error code, nor has a function to be called when de-initializing the IR's. Change the return argment to integer and make sure that each driver will handle the error code. Also adds a function to free any resources that may be allocating there: ir_input_free(). 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.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/common/ir-functions.c b/drivers/media/common/ir-functions.c
index 29885c2893d2..b31bd27da374 100644
--- a/drivers/media/common/ir-functions.c
+++ b/drivers/media/common/ir-functions.c
@@ -54,11 +54,13 @@ static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir)
54 54
55/* -------------------------------------------------------------------------- */ 55/* -------------------------------------------------------------------------- */
56 56
57void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, 57int ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
58 int ir_type, struct ir_scancode_table *ir_codes) 58 int ir_type, struct ir_scancode_table *ir_codes)
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 */
63
62 ir_set_keycode_table(dev, ir_codes); 64 ir_set_keycode_table(dev, ir_codes);
63 65
64 clear_bit(0, dev->keybit); 66 clear_bit(0, dev->keybit);
@@ -66,9 +68,17 @@ void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
66 set_bit(EV_KEY, dev->evbit); 68 set_bit(EV_KEY, dev->evbit);
67 if (repeat) 69 if (repeat)
68 set_bit(EV_REP, dev->evbit); 70 set_bit(EV_REP, dev->evbit);
71
72 return 0;
69} 73}
70EXPORT_SYMBOL_GPL(ir_input_init); 74EXPORT_SYMBOL_GPL(ir_input_init);
71 75
76void ir_input_free(struct input_dev *input_dev)
77{
78 /* FIXME: Add the proper code to free allocated resources */
79}
80EXPORT_SYMBOL_GPL(ir_input_free);
81
72void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir) 82void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir)
73{ 83{
74 if (ir->keypressed) { 84 if (ir->keypressed) {