Commit 95d1544e authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

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: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent a86d6df8
...@@ -17,6 +17,7 @@ LIRC Function Reference ...@@ -17,6 +17,7 @@ LIRC Function Reference
lirc-get-rec-resolution lirc-get-rec-resolution
lirc-set-send-duty-cycle lirc-set-send-duty-cycle
lirc-get-timeout lirc-get-timeout
lirc-get-rec-timeout
lirc-set-rec-timeout lirc-set-rec-timeout
lirc-set-rec-carrier lirc-set-rec-carrier
lirc-set-rec-carrier-range lirc-set-rec-carrier-range
......
.. -*- coding: utf-8; mode: rst -*- .. -*- coding: utf-8; mode: rst -*-
.. _lirc_set_rec_timeout: .. _lirc_set_rec_timeout:
.. _lirc_get_rec_timeout:
************************** ***************************************************
ioctl LIRC_SET_REC_TIMEOUT ioctl LIRC_GET_REC_TIMEOUT and LIRC_SET_REC_TIMEOUT
************************** ***************************************************
Name Name
==== ====
LIRC_SET_REC_TIMEOUT - sets the integer value for IR inactivity timeout. LIRC_GET_REC_TIMEOUT/LIRC_SET_REC_TIMEOUT - Get/set the integer value for IR inactivity timeout.
Synopsis Synopsis
======== ========
.. c:function:: int ioctl( int fd, LIRC_GET_REC_TIMEOUT, __u32 *timeout )
:name: LIRC_GET_REC_TIMEOUT
.. c:function:: int ioctl( int fd, LIRC_SET_REC_TIMEOUT, __u32 *timeout ) .. c:function:: int ioctl( int fd, LIRC_SET_REC_TIMEOUT, __u32 *timeout )
:name: LIRC_SET_REC_TIMEOUT :name: LIRC_SET_REC_TIMEOUT
...@@ -30,7 +34,7 @@ Arguments ...@@ -30,7 +34,7 @@ Arguments
Description Description
=========== ===========
Sets the integer value for IR inactivity timeout. Get and set the integer value for IR inactivity timeout.
If supported by the hardware, setting it to 0 disables all hardware timeouts If supported by the hardware, setting it to 0 disables all hardware timeouts
and data should be reported as soon as possible. If the exact value and data should be reported as soon as possible. If the exact value
......
...@@ -575,6 +575,13 @@ static long ir_lirc_ioctl(struct file *file, unsigned int cmd, ...@@ -575,6 +575,13 @@ static long ir_lirc_ioctl(struct file *file, unsigned int cmd,
} }
break; 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: case LIRC_SET_REC_TIMEOUT_REPORTS:
if (!dev->timeout) if (!dev->timeout)
ret = -ENOTTY; ret = -ENOTTY;
......
...@@ -133,6 +133,12 @@ ...@@ -133,6 +133,12 @@
#define LIRC_SET_WIDEBAND_RECEIVER _IOW('i', 0x00000023, __u32) #define LIRC_SET_WIDEBAND_RECEIVER _IOW('i', 0x00000023, __u32)
/*
* Return the recording timeout, which is either set by
* the ioctl LIRC_SET_REC_TIMEOUT or by the kernel after setting the protocols.
*/
#define LIRC_GET_REC_TIMEOUT _IOR('i', 0x00000024, __u32)
/* /*
* struct lirc_scancode - decoded scancode with protocol for use with * struct lirc_scancode - decoded scancode with protocol for use with
* LIRC_MODE_SCANCODE * LIRC_MODE_SCANCODE
......
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