aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/rc-main.c
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2018-03-23 16:47:37 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-04-20 09:14:31 -0400
commita86d6df84ae6eb1fd1ca6cbd03f16637674a6af8 (patch)
tree0d66f7424a12d1c5521f797823be5c24838c3340 /drivers/media/rc/rc-main.c
parented8c34d7ec35b0a265f1b4d9ed6ab75e9f6facd7 (diff)
media: rc: set timeout to smallest value required by enabled protocols
The longer the IR timeout, the longer the rc device waits until delivering the trailing space. So, by reducing this timeout, we reduce the delay for the last scancode to be delivered. Note that the lirc daemon disables all protocols, in which case we revert back to the default value. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/rc/rc-main.c')
-rw-r--r--drivers/media/rc/rc-main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index b67be33bd62f..6a720e9c7aa8 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -1241,6 +1241,9 @@ static ssize_t store_protocols(struct device *device,
1241 if (rc < 0) 1241 if (rc < 0)
1242 goto out; 1242 goto out;
1243 1243
1244 if (dev->driver_type == RC_DRIVER_IR_RAW)
1245 ir_raw_load_modules(&new_protocols);
1246
1244 rc = dev->change_protocol(dev, &new_protocols); 1247 rc = dev->change_protocol(dev, &new_protocols);
1245 if (rc < 0) { 1248 if (rc < 0) {
1246 dev_dbg(&dev->dev, "Error setting protocols to 0x%llx\n", 1249 dev_dbg(&dev->dev, "Error setting protocols to 0x%llx\n",
@@ -1248,9 +1251,6 @@ static ssize_t store_protocols(struct device *device,
1248 goto out; 1251 goto out;
1249 } 1252 }
1250 1253
1251 if (dev->driver_type == RC_DRIVER_IR_RAW)
1252 ir_raw_load_modules(&new_protocols);
1253
1254 if (new_protocols != old_protocols) { 1254 if (new_protocols != old_protocols) {
1255 *current_protocols = new_protocols; 1255 *current_protocols = new_protocols;
1256 dev_dbg(&dev->dev, "Protocols changed to 0x%llx\n", 1256 dev_dbg(&dev->dev, "Protocols changed to 0x%llx\n",
@@ -1735,6 +1735,9 @@ static int rc_prepare_rx_device(struct rc_dev *dev)
1735 if (dev->driver_type == RC_DRIVER_SCANCODE && !dev->change_protocol) 1735 if (dev->driver_type == RC_DRIVER_SCANCODE && !dev->change_protocol)
1736 dev->enabled_protocols = dev->allowed_protocols; 1736 dev->enabled_protocols = dev->allowed_protocols;
1737 1737
1738 if (dev->driver_type == RC_DRIVER_IR_RAW)
1739 ir_raw_load_modules(&rc_proto);
1740
1738 if (dev->change_protocol) { 1741 if (dev->change_protocol) {
1739 rc = dev->change_protocol(dev, &rc_proto); 1742 rc = dev->change_protocol(dev, &rc_proto);
1740 if (rc < 0) 1743 if (rc < 0)
@@ -1742,9 +1745,6 @@ static int rc_prepare_rx_device(struct rc_dev *dev)
1742 dev->enabled_protocols = rc_proto; 1745 dev->enabled_protocols = rc_proto;
1743 } 1746 }
1744 1747
1745 if (dev->driver_type == RC_DRIVER_IR_RAW)
1746 ir_raw_load_modules(&rc_proto);
1747
1748 set_bit(EV_KEY, dev->input_dev->evbit); 1748 set_bit(EV_KEY, dev->input_dev->evbit);
1749 set_bit(EV_REP, dev->input_dev->evbit); 1749 set_bit(EV_REP, dev->input_dev->evbit);
1750 set_bit(EV_MSC, dev->input_dev->evbit); 1750 set_bit(EV_MSC, dev->input_dev->evbit);