Commit b2aceb73 authored by David Härdeman's avatar David Härdeman Committed by Mauro Carvalho Chehab

[media] rc-core: fix input repeat handling

The call to input_register_device() needs to take place
before the repeat parameters are set or the input subsystem
repeat handling will be disabled (as was already noted in
the comments in that function).

Cc: stable <stable@vger.kernel.org> # v4.11
Signed-off-by: default avatarDavid Härdeman <david@hardeman.nu>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 592ddc9f
...@@ -1703,6 +1703,16 @@ static int rc_setup_rx_device(struct rc_dev *dev) ...@@ -1703,6 +1703,16 @@ static int rc_setup_rx_device(struct rc_dev *dev)
if (dev->close) if (dev->close)
dev->input_dev->close = ir_close; dev->input_dev->close = ir_close;
dev->input_dev->dev.parent = &dev->dev;
memcpy(&dev->input_dev->id, &dev->input_id, sizeof(dev->input_id));
dev->input_dev->phys = dev->input_phys;
dev->input_dev->name = dev->input_name;
/* rc_open will be called here */
rc = input_register_device(dev->input_dev);
if (rc)
goto out_table;
/* /*
* Default delay of 250ms is too short for some protocols, especially * Default delay of 250ms is too short for some protocols, especially
* since the timeout is currently set to 250ms. Increase it to 500ms, * since the timeout is currently set to 250ms. Increase it to 500ms,
...@@ -1718,16 +1728,6 @@ static int rc_setup_rx_device(struct rc_dev *dev) ...@@ -1718,16 +1728,6 @@ static int rc_setup_rx_device(struct rc_dev *dev)
*/ */
dev->input_dev->rep[REP_PERIOD] = 125; dev->input_dev->rep[REP_PERIOD] = 125;
dev->input_dev->dev.parent = &dev->dev;
memcpy(&dev->input_dev->id, &dev->input_id, sizeof(dev->input_id));
dev->input_dev->phys = dev->input_phys;
dev->input_dev->name = dev->input_name;
/* rc_open will be called here */
rc = input_register_device(dev->input_dev);
if (rc)
goto out_table;
return 0; return 0;
out_table: out_table:
......
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