From a60d64b15c20d178ba3a9bc3a542492b4ddeea70 Mon Sep 17 00:00:00 2001 From: Sean Young Date: Sat, 23 Sep 2017 10:41:13 -0400 Subject: media: lirc: lirc interface should not be a raw decoder The lirc user interface exists as a raw decoder, which does not make much sense for transmit-only devices. In addition, we want to have lirc char devices for devices which do not use raw IR, i.e. scancode only devices. Note that rc-code, lirc_dev, ir-lirc-codec are now calling functions of each other, so they've been merged into one module rc-core to avoid circular dependencies. Since ir-lirc-codec no longer exists as separate codec module, there is no need for RC_DRIVER_IR_RAW_TX type drivers to call ir_raw_event_register(). Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab --- drivers/media/rc/rc-ir-raw.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'drivers/media/rc/rc-ir-raw.c') diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c index 78638d1b73cc..3dabb783a1f0 100644 --- a/drivers/media/rc/rc-ir-raw.c +++ b/drivers/media/rc/rc-ir-raw.c @@ -31,6 +31,7 @@ static int ir_raw_event_thread(void *data) if (raw->dev->enabled_protocols & handler->protocols || !handler->protocols) handler->decode(raw->dev, ev); + ir_lirc_raw_event(raw->dev, ev); raw->prev_ev = ev; } mutex_unlock(&ir_raw_handler_lock); @@ -521,16 +522,9 @@ EXPORT_SYMBOL(ir_raw_encode_carrier); */ int ir_raw_event_prepare(struct rc_dev *dev) { - static bool raw_init; /* 'false' default value, raw decoders loaded? */ - if (!dev) return -EINVAL; - if (!raw_init) { - request_module("ir-lirc-codec"); - raw_init = true; - } - dev->raw = kzalloc(sizeof(*dev->raw), GFP_KERNEL); if (!dev->raw) return -ENOMEM; @@ -548,19 +542,11 @@ int ir_raw_event_register(struct rc_dev *dev) struct ir_raw_handler *handler; struct task_struct *thread; - /* - * raw transmitters do not need any event registration - * because the event is coming from userspace - */ - if (dev->driver_type != RC_DRIVER_IR_RAW_TX) { - thread = kthread_run(ir_raw_event_thread, dev->raw, "rc%u", - dev->minor); + thread = kthread_run(ir_raw_event_thread, dev->raw, "rc%u", dev->minor); + if (IS_ERR(thread)) + return PTR_ERR(thread); - if (IS_ERR(thread)) - return PTR_ERR(thread); - - dev->raw->thread = thread; - } + dev->raw->thread = thread; mutex_lock(&ir_raw_handler_lock); list_add_tail(&dev->raw->list, &ir_raw_client_list); -- cgit v1.2.3