diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-03-24 19:47:53 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-17 23:52:59 -0400 |
commit | 995187bed30c0545e8da88372e9807da0a85911e (patch) | |
tree | e3e28eff10f8f01f1bfd7ff865a29076bf6700dc /include/media | |
parent | 9f1547829a6f39fe6b2da22653dff40502f3d568 (diff) |
V4L/DVB: ir-core: dynamically load the compiled IR protocols
Instead of hardcoding the protocols into ir-core, add a register interface
for the IR protocol decoders, and convert ir-nec-decoder into a client of
ir-core.
With this approach, it is possible to dynamically load the needed IR protocols,
and to add a RAW IR interface module, registered as one IR raw protocol decoder.
This patch opens a way to register a lirc_dev interface to work as an userspace
IR protocol decoder.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/ir-core.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/include/media/ir-core.h b/include/media/ir-core.h index 8d8ed7e06cd..c377bf47a05 100644 --- a/include/media/ir-core.h +++ b/include/media/ir-core.h | |||
@@ -1,6 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * Remote Controller core header | 2 | * Remote Controller core header |
3 | * | 3 | * |
4 | * Copyright (C) 2009-2010 by Mauro Carvalho Chehab <mchehab@redhat.com> | ||
5 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
6 | * the Free Software Foundation version 2 of the License. | 8 | * the Free Software Foundation version 2 of the License. |
@@ -80,6 +82,14 @@ struct ir_input_dev { | |||
80 | int keypressed; /* current state */ | 82 | int keypressed; /* current state */ |
81 | }; | 83 | }; |
82 | 84 | ||
85 | struct ir_raw_handler { | ||
86 | struct list_head list; | ||
87 | |||
88 | int (*decode)(struct input_dev *input_dev, | ||
89 | struct ir_raw_event *evs, | ||
90 | int len); | ||
91 | }; | ||
92 | |||
83 | #define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr) | 93 | #define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr) |
84 | 94 | ||
85 | /* Routines from ir-keytable.c */ | 95 | /* Routines from ir-keytable.c */ |
@@ -104,11 +114,20 @@ int ir_raw_event_register(struct input_dev *input_dev); | |||
104 | void ir_raw_event_unregister(struct input_dev *input_dev); | 114 | void ir_raw_event_unregister(struct input_dev *input_dev); |
105 | int ir_raw_event_store(struct input_dev *input_dev, enum raw_event_type type); | 115 | int ir_raw_event_store(struct input_dev *input_dev, enum raw_event_type type); |
106 | int ir_raw_event_handle(struct input_dev *input_dev); | 116 | int ir_raw_event_handle(struct input_dev *input_dev); |
117 | int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler); | ||
118 | void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler); | ||
107 | 119 | ||
108 | /* from ir-nec-decoder.c */ | 120 | #ifdef MODULE |
109 | int ir_nec_decode(struct input_dev *input_dev, | 121 | void ir_raw_init(void); |
110 | struct ir_raw_event *evs, | 122 | #else |
111 | int len); | 123 | #define ir_raw_init() 0 |
112 | 124 | #endif | |
113 | 125 | ||
126 | /* from ir-nec-decoder.c */ | ||
127 | #ifdef CONFIG_IR_NEC_DECODER_MODULE | ||
128 | #define load_nec_decode() request_module("ir-nec-decoder") | ||
129 | #else | ||
130 | #define load_nec_decode() 0 | ||
114 | #endif | 131 | #endif |
132 | |||
133 | #endif /* _IR_CORE */ | ||