Skip to content

Commit

Permalink
[media] rc: raw decoder for keymap protocol is not loaded on register
Browse files Browse the repository at this point in the history
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: acc1c3c ("[media] media: rc: load decoder modules on-demand")

Signed-off-by: Sean Young <sean@mess.org>
Cc: <stable@vger.kernel.org> # v4.5+
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
  • Loading branch information
Sean Young authored and Mauro Carvalho Chehab committed Mar 3, 2017
1 parent c1305a4 commit 4138086
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/media/rc/rc-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,7 @@ static int rc_setup_rx_device(struct rc_dev *dev)
{
int rc;
struct rc_map *rc_map;
u64 rc_type;

if (!dev->map_name)
return -EINVAL;
Expand All @@ -1677,15 +1678,18 @@ static int rc_setup_rx_device(struct rc_dev *dev)
if (rc)
return rc;

if (dev->change_protocol) {
u64 rc_type = (1ll << rc_map->rc_type);
rc_type = BIT_ULL(rc_map->rc_type);

if (dev->change_protocol) {
rc = dev->change_protocol(dev, &rc_type);
if (rc < 0)
goto out_table;
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_REP, dev->input_dev->evbit);
set_bit(EV_MSC, dev->input_dev->evbit);
Expand Down

0 comments on commit 4138086

Please sign in to comment.