hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/hid/hid-debug.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * (c) 1999 Andreas Gal <gal@cs.uni-magdeburg.de>
34 * (c) 2000-2001 Vojtech Pavlik <vojtech@ucw.cz>
....@@ -7,19 +8,6 @@
78 */
89
910 /*
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
2311 *
2412 * Should you need to contact me, the author, you can do so either by
2513 * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
....@@ -835,7 +823,9 @@
835823 [KEY_F22] = "F22", [KEY_F23] = "F23",
836824 [KEY_F24] = "F24", [KEY_PLAYCD] = "PlayCD",
837825 [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",
839829 [KEY_CLOSE] = "Close", [KEY_PLAY] = "Play",
840830 [KEY_FASTFORWARD] = "FastForward", [KEY_BASSBOOST] = "BassBoost",
841831 [KEY_PRINT] = "Print", [KEY_HP] = "HP",
....@@ -941,6 +931,9 @@
941931 [KEY_APPSELECT] = "AppSelect",
942932 [KEY_SCREENSAVER] = "ScreenSaver",
943933 [KEY_VOICECOMMAND] = "VoiceCommand",
934
+ [KEY_EMOJI_PICKER] = "EmojiPicker",
935
+ [KEY_DICTATE] = "Dictate",
936
+ [KEY_MICMUTE] = "MicrophoneMute",
944937 [KEY_BRIGHTNESS_MIN] = "BrightnessMin",
945938 [KEY_BRIGHTNESS_MAX] = "BrightnessMax",
946939 [KEY_BRIGHTNESS_AUTO] = "BrightnessAuto",
....@@ -1072,11 +1065,6 @@
10721065 return 0;
10731066 }
10741067
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
-
10801068 static int hid_debug_events_open(struct inode *inode, struct file *file)
10811069 {
10821070 int err = 0;
....@@ -1118,11 +1106,6 @@
11181106 set_current_state(TASK_INTERRUPTIBLE);
11191107
11201108 while (kfifo_is_empty(&list->hid_debug_fifo)) {
1121
- if (file->f_flags & O_NONBLOCK) {
1122
- ret = -EAGAIN;
1123
- break;
1124
- }
1125
-
11261109 if (signal_pending(current)) {
11271110 ret = -ERESTARTSYS;
11281111 break;
....@@ -1137,6 +1120,11 @@
11371120 ret = -EIO;
11381121 set_current_state(TASK_RUNNING);
11391122 goto out;
1123
+ }
1124
+
1125
+ if (file->f_flags & O_NONBLOCK) {
1126
+ ret = -EAGAIN;
1127
+ break;
11401128 }
11411129
11421130 /* allow O_NONBLOCK from other threads */
....@@ -1191,12 +1179,7 @@
11911179 return 0;
11921180 }
11931181
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);
12001183
12011184 static const struct file_operations hid_debug_events_fops = {
12021185 .owner = THIS_MODULE,