Commit 0d39ab0b authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

media: rc: auto load encoder if necessary

When sending scancodes, load the encoder if we need it.
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent cdfaa01c
...@@ -261,6 +261,7 @@ void ir_raw_event_free(struct rc_dev *dev); ...@@ -261,6 +261,7 @@ void ir_raw_event_free(struct rc_dev *dev);
void ir_raw_event_unregister(struct rc_dev *dev); void ir_raw_event_unregister(struct rc_dev *dev);
int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler); int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler);
void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler); void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler);
void ir_raw_load_modules(u64 *protocols);
void ir_raw_init(void); void ir_raw_init(void);
/* /*
......
...@@ -448,6 +448,8 @@ int ir_raw_encode_scancode(enum rc_proto protocol, u32 scancode, ...@@ -448,6 +448,8 @@ int ir_raw_encode_scancode(enum rc_proto protocol, u32 scancode,
int ret = -EINVAL; int ret = -EINVAL;
u64 mask = 1ULL << protocol; u64 mask = 1ULL << protocol;
ir_raw_load_modules(&mask);
mutex_lock(&ir_raw_handler_lock); mutex_lock(&ir_raw_handler_lock);
list_for_each_entry(handler, &ir_raw_handler_list, list) { list_for_each_entry(handler, &ir_raw_handler_list, list) {
if (handler->protocols & mask && handler->encode) { if (handler->protocols & mask && handler->encode) {
......
...@@ -1082,7 +1082,7 @@ static int parse_protocol_change(u64 *protocols, const char *buf) ...@@ -1082,7 +1082,7 @@ static int parse_protocol_change(u64 *protocols, const char *buf)
return count; return count;
} }
static void ir_raw_load_modules(u64 *protocols) void ir_raw_load_modules(u64 *protocols)
{ {
u64 available; u64 available;
int i, ret; int i, ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment