hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/rc/keymaps/rc-cec.c
....@@ -1,11 +1,17 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* Keytable for the CEC remote control
23 *
3
- * Copyright (c) 2015 by Kamil Debski
4
+ * This keymap is unusual in that it can't be built as a module,
5
+ * instead it is registered directly in rc-main.c if CONFIG_MEDIA_CEC_RC
6
+ * is set. This is because it can be called from drm_dp_cec_set_edid() via
7
+ * cec_register_adapter() in an asynchronous context, and it is not
8
+ * allowed to use request_module() to load rc-cec.ko in that case.
49 *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * (at your option) any later version.
10
+ * Since this keymap is only used if CONFIG_MEDIA_CEC_RC is set, we
11
+ * just compile this keymap into the rc-core module and never as a
12
+ * separate module.
13
+ *
14
+ * Copyright (c) 2015 by Kamil Debski
915 */
1016
1117 #include <media/rc-map.h>
....@@ -156,7 +162,7 @@
156162 /* 0x77-0xff: Reserved */
157163 };
158164
159
-static struct rc_map_list cec_map = {
165
+struct rc_map_list cec_map = {
160166 .map = {
161167 .scan = cec,
162168 .size = ARRAY_SIZE(cec),
....@@ -164,19 +170,3 @@
164170 .name = RC_MAP_CEC,
165171 }
166172 };
167
-
168
-static int __init init_rc_map_cec(void)
169
-{
170
- return rc_map_register(&cec_map);
171
-}
172
-
173
-static void __exit exit_rc_map_cec(void)
174
-{
175
- rc_map_unregister(&cec_map);
176
-}
177
-
178
-module_init(init_rc_map_cec);
179
-module_exit(exit_rc_map_cec);
180
-
181
-MODULE_LICENSE("GPL");
182
-MODULE_AUTHOR("Kamil Debski");