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

[media] rc: raw decoder for keymap protocol is not loaded on register

When the protocol is set via the sysfs protocols attribute, the
decoder is loaded. However, when it is not when a device is first
plugged in or registered.

Fixes: acc1c3c6 ("[media] media: rc: load decoder modules on-demand")
Signed-off-by: default avatarSean Young <sean@mess.org>
Cc: <stable@vger.kernel.org> # v4.5+
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent c1305a40
...@@ -1663,6 +1663,7 @@ static int rc_setup_rx_device(struct rc_dev *dev) ...@@ -1663,6 +1663,7 @@ static int rc_setup_rx_device(struct rc_dev *dev)
{ {
int rc; int rc;
struct rc_map *rc_map; struct rc_map *rc_map;
u64 rc_type;
if (!dev->map_name) if (!dev->map_name)
return -EINVAL; return -EINVAL;
...@@ -1677,15 +1678,18 @@ static int rc_setup_rx_device(struct rc_dev *dev) ...@@ -1677,15 +1678,18 @@ static int rc_setup_rx_device(struct rc_dev *dev)
if (rc) if (rc)
return rc; return rc;
if (dev->change_protocol) { rc_type = BIT_ULL(rc_map->rc_type);
u64 rc_type = (1ll << rc_map->rc_type);
if (dev->change_protocol) {
rc = dev->change_protocol(dev, &rc_type); rc = dev->change_protocol(dev, &rc_type);
if (rc < 0) if (rc < 0)
goto out_table; goto out_table;
dev->enabled_protocols = rc_type; dev->enabled_protocols = rc_type;
} }
if (dev->driver_type == RC_DRIVER_IR_RAW)
ir_raw_load_modules(&rc_type);
set_bit(EV_KEY, dev->input_dev->evbit); set_bit(EV_KEY, dev->input_dev->evbit);
set_bit(EV_REP, dev->input_dev->evbit); set_bit(EV_REP, dev->input_dev->evbit);
set_bit(EV_MSC, dev->input_dev->evbit); set_bit(EV_MSC, dev->input_dev->evbit);
......
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