diff options
author | Sean Young <sean@mess.org> | 2017-02-09 01:48:17 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-03-24 14:23:18 +0300 |
commit | e8f4818895b3d7f34b3e5852bce77b3257a27ecc (patch) | |
tree | b23c618fd76be5dea287069d979ee915971faaf0 /drivers/media/rc | |
parent | 7dc2df1476092e65d765a5a7f077ed4b85897f18 (diff) | |
download | linux-e8f4818895b3d7f34b3e5852bce77b3257a27ecc.tar.xz |
[media] lirc: advertise LIRC_CAN_GET_REC_RESOLUTION and improve
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>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r-- | drivers/media/rc/ir-lirc-codec.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c index 235d74adc3fd..de85f1d7ce43 100644 --- a/drivers/media/rc/ir-lirc-codec.c +++ b/drivers/media/rc/ir-lirc-codec.c @@ -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) |