xref: /linux/Documentation/userspace-api/media/rc/lirc-get-rec-mode.rst (revision a4eb44a6435d6d8f9e642407a4a06f65eb90ca04)
1.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
2.. c:namespace:: RC
3
4.. _lirc_get_rec_mode:
5.. _lirc_set_rec_mode:
6
7**********************************************
8ioctls LIRC_GET_REC_MODE and LIRC_SET_REC_MODE
9**********************************************
10
11Name
12====
13
14LIRC_GET_REC_MODE/LIRC_SET_REC_MODE - Get/set current receive mode.
15
16Synopsis
17========
18
19.. c:macro:: LIRC_GET_REC_MODE
20
21``int ioctl(int fd, LIRC_GET_REC_MODE, __u32 *mode)``
22
23.. c:macro:: LIRC_SET_REC_MODE
24
25``int ioctl(int fd, LIRC_SET_REC_MODE, __u32 *mode)``
26
27Arguments
28=========
29
30``fd``
31    File descriptor returned by open().
32
33``mode``
34    Mode used for receive.
35
36Description
37===========
38
39Get and set the current receive mode. Only
40:ref:`LIRC_MODE_MODE2 <lirc-mode-mode2>` and
41:ref:`LIRC_MODE_SCANCODE <lirc-mode-scancode>` are supported.
42Use :ref:`lirc_get_features` to find out which modes the driver supports.
43
44Return Value
45============
46
47.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
48
49.. flat-table::
50    :header-rows:  0
51    :stub-columns: 0
52
53    -  .. row 1
54
55       -  ``ENODEV``
56
57       -  Device not available.
58
59    -  .. row 2
60
61       -  ``ENOTTY``
62
63       -  Device does not support receiving.
64
65    -  .. row 3
66
67       -  ``EINVAL``
68
69       -  Invalid mode or invalid mode for this device.
70