media: rc: add ioctl to get the current timeout

Since the kernel now modifies the timeout, make it possible to retrieve
the current value.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
Sean Young
2018-03-23 16:59:52 -04:00
committed by Mauro Carvalho Chehab
parent a86d6df84a
commit 95d1544eb6
4 changed files with 23 additions and 5 deletions

View File

@@ -575,6 +575,13 @@ static long ir_lirc_ioctl(struct file *file, unsigned int cmd,
}
break;
case LIRC_GET_REC_TIMEOUT:
if (!dev->timeout)
ret = -ENOTTY;
else
val = DIV_ROUND_UP(dev->timeout, 1000);
break;
case LIRC_SET_REC_TIMEOUT_REPORTS:
if (!dev->timeout)
ret = -ENOTTY;