.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * (c) 1999 Andreas Gal <gal@cs.uni-magdeburg.de> |
---|
3 | 4 | * (c) 2000-2001 Vojtech Pavlik <vojtech@ucw.cz> |
---|
.. | .. |
---|
7 | 8 | */ |
---|
8 | 9 | |
---|
9 | 10 | /* |
---|
10 | | - * This program is free software; you can redistribute it and/or modify |
---|
11 | | - * it under the terms of the GNU General Public License as published by |
---|
12 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
13 | | - * (at your option) any later version. |
---|
14 | | - * |
---|
15 | | - * This program is distributed in the hope that it will be useful, |
---|
16 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
17 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
18 | | - * GNU General Public License for more details. |
---|
19 | | - * |
---|
20 | | - * You should have received a copy of the GNU General Public License |
---|
21 | | - * along with this program; if not, write to the Free Software |
---|
22 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
23 | 11 | * |
---|
24 | 12 | * Should you need to contact me, the author, you can do so either by |
---|
25 | 13 | * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail: |
---|
.. | .. |
---|
835 | 823 | [KEY_F22] = "F22", [KEY_F23] = "F23", |
---|
836 | 824 | [KEY_F24] = "F24", [KEY_PLAYCD] = "PlayCD", |
---|
837 | 825 | [KEY_PAUSECD] = "PauseCD", [KEY_PROG3] = "Prog3", |
---|
838 | | - [KEY_PROG4] = "Prog4", [KEY_SUSPEND] = "Suspend", |
---|
| 826 | + [KEY_PROG4] = "Prog4", |
---|
| 827 | + [KEY_ALL_APPLICATIONS] = "AllApplications", |
---|
| 828 | + [KEY_SUSPEND] = "Suspend", |
---|
839 | 829 | [KEY_CLOSE] = "Close", [KEY_PLAY] = "Play", |
---|
840 | 830 | [KEY_FASTFORWARD] = "FastForward", [KEY_BASSBOOST] = "BassBoost", |
---|
841 | 831 | [KEY_PRINT] = "Print", [KEY_HP] = "HP", |
---|
.. | .. |
---|
941 | 931 | [KEY_APPSELECT] = "AppSelect", |
---|
942 | 932 | [KEY_SCREENSAVER] = "ScreenSaver", |
---|
943 | 933 | [KEY_VOICECOMMAND] = "VoiceCommand", |
---|
| 934 | + [KEY_EMOJI_PICKER] = "EmojiPicker", |
---|
| 935 | + [KEY_DICTATE] = "Dictate", |
---|
| 936 | + [KEY_MICMUTE] = "MicrophoneMute", |
---|
944 | 937 | [KEY_BRIGHTNESS_MIN] = "BrightnessMin", |
---|
945 | 938 | [KEY_BRIGHTNESS_MAX] = "BrightnessMax", |
---|
946 | 939 | [KEY_BRIGHTNESS_AUTO] = "BrightnessAuto", |
---|
.. | .. |
---|
1072 | 1065 | return 0; |
---|
1073 | 1066 | } |
---|
1074 | 1067 | |
---|
1075 | | -static int hid_debug_rdesc_open(struct inode *inode, struct file *file) |
---|
1076 | | -{ |
---|
1077 | | - return single_open(file, hid_debug_rdesc_show, inode->i_private); |
---|
1078 | | -} |
---|
1079 | | - |
---|
1080 | 1068 | static int hid_debug_events_open(struct inode *inode, struct file *file) |
---|
1081 | 1069 | { |
---|
1082 | 1070 | int err = 0; |
---|
.. | .. |
---|
1118 | 1106 | set_current_state(TASK_INTERRUPTIBLE); |
---|
1119 | 1107 | |
---|
1120 | 1108 | while (kfifo_is_empty(&list->hid_debug_fifo)) { |
---|
1121 | | - if (file->f_flags & O_NONBLOCK) { |
---|
1122 | | - ret = -EAGAIN; |
---|
1123 | | - break; |
---|
1124 | | - } |
---|
1125 | | - |
---|
1126 | 1109 | if (signal_pending(current)) { |
---|
1127 | 1110 | ret = -ERESTARTSYS; |
---|
1128 | 1111 | break; |
---|
.. | .. |
---|
1137 | 1120 | ret = -EIO; |
---|
1138 | 1121 | set_current_state(TASK_RUNNING); |
---|
1139 | 1122 | goto out; |
---|
| 1123 | + } |
---|
| 1124 | + |
---|
| 1125 | + if (file->f_flags & O_NONBLOCK) { |
---|
| 1126 | + ret = -EAGAIN; |
---|
| 1127 | + break; |
---|
1140 | 1128 | } |
---|
1141 | 1129 | |
---|
1142 | 1130 | /* allow O_NONBLOCK from other threads */ |
---|
.. | .. |
---|
1191 | 1179 | return 0; |
---|
1192 | 1180 | } |
---|
1193 | 1181 | |
---|
1194 | | -static const struct file_operations hid_debug_rdesc_fops = { |
---|
1195 | | - .open = hid_debug_rdesc_open, |
---|
1196 | | - .read = seq_read, |
---|
1197 | | - .llseek = seq_lseek, |
---|
1198 | | - .release = single_release, |
---|
1199 | | -}; |
---|
| 1182 | +DEFINE_SHOW_ATTRIBUTE(hid_debug_rdesc); |
---|
1200 | 1183 | |
---|
1201 | 1184 | static const struct file_operations hid_debug_events_fops = { |
---|
1202 | 1185 | .owner = THIS_MODULE, |
---|