| .. | .. |
|---|
| 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", |
|---|
| 944 | 936 | [KEY_BRIGHTNESS_MIN] = "BrightnessMin", |
|---|
| 945 | 937 | [KEY_BRIGHTNESS_MAX] = "BrightnessMax", |
|---|
| 946 | 938 | [KEY_BRIGHTNESS_AUTO] = "BrightnessAuto", |
|---|
| .. | .. |
|---|
| 1072 | 1064 | return 0; |
|---|
| 1073 | 1065 | } |
|---|
| 1074 | 1066 | |
|---|
| 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 | 1067 | static int hid_debug_events_open(struct inode *inode, struct file *file) |
|---|
| 1081 | 1068 | { |
|---|
| 1082 | 1069 | int err = 0; |
|---|
| .. | .. |
|---|
| 1118 | 1105 | set_current_state(TASK_INTERRUPTIBLE); |
|---|
| 1119 | 1106 | |
|---|
| 1120 | 1107 | while (kfifo_is_empty(&list->hid_debug_fifo)) { |
|---|
| 1121 | | - if (file->f_flags & O_NONBLOCK) { |
|---|
| 1122 | | - ret = -EAGAIN; |
|---|
| 1123 | | - break; |
|---|
| 1124 | | - } |
|---|
| 1125 | | - |
|---|
| 1126 | 1108 | if (signal_pending(current)) { |
|---|
| 1127 | 1109 | ret = -ERESTARTSYS; |
|---|
| 1128 | 1110 | break; |
|---|
| .. | .. |
|---|
| 1137 | 1119 | ret = -EIO; |
|---|
| 1138 | 1120 | set_current_state(TASK_RUNNING); |
|---|
| 1139 | 1121 | goto out; |
|---|
| 1122 | + } |
|---|
| 1123 | + |
|---|
| 1124 | + if (file->f_flags & O_NONBLOCK) { |
|---|
| 1125 | + ret = -EAGAIN; |
|---|
| 1126 | + break; |
|---|
| 1140 | 1127 | } |
|---|
| 1141 | 1128 | |
|---|
| 1142 | 1129 | /* allow O_NONBLOCK from other threads */ |
|---|
| .. | .. |
|---|
| 1191 | 1178 | return 0; |
|---|
| 1192 | 1179 | } |
|---|
| 1193 | 1180 | |
|---|
| 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 | | -}; |
|---|
| 1181 | +DEFINE_SHOW_ATTRIBUTE(hid_debug_rdesc); |
|---|
| 1200 | 1182 | |
|---|
| 1201 | 1183 | static const struct file_operations hid_debug_events_fops = { |
|---|
| 1202 | 1184 | .owner = THIS_MODULE, |
|---|