]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] lirc: advertise LIRC_CAN_GET_REC_RESOLUTION and improve
authorSean Young <sean@mess.org>
Wed, 8 Feb 2017 22:48:17 +0000 (20:48 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 24 Mar 2017 11:23:18 +0000 (08:23 -0300)
This feature was never set. The ioctl should fail if no resolution
is set.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/ir-lirc-codec.c

index 235d74adc3fd1022c53e3d47cd0e473c8aa64168..de85f1d7ce434058390ffeeda813831a511e962a 100644 (file)
@@ -263,6 +263,9 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
                return 0;
 
        case LIRC_GET_REC_RESOLUTION:
+               if (!dev->rx_resolution)
+                       return -ENOTTY;
+
                val = dev->rx_resolution;
                break;
 
@@ -367,8 +370,11 @@ static int ir_lirc_register(struct rc_dev *dev)
        if (rc)
                goto rbuf_init_failed;
 
-       if (dev->driver_type != RC_DRIVER_IR_RAW_TX)
+       if (dev->driver_type != RC_DRIVER_IR_RAW_TX) {
                features |= LIRC_CAN_REC_MODE2;
+               if (dev->rx_resolution)
+                       features |= LIRC_CAN_GET_REC_RESOLUTION;
+       }
        if (dev->tx_ir) {
                features |= LIRC_CAN_SEND_PULSE;
                if (dev->s_tx_mask)