| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* Keytable for the CEC remote control |
|---|
| 2 | 3 | * |
|---|
| 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. |
|---|
| 4 | 9 | * |
|---|
| 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 |
|---|
| 9 | 15 | */ |
|---|
| 10 | 16 | |
|---|
| 11 | 17 | #include <media/rc-map.h> |
|---|
| .. | .. |
|---|
| 156 | 162 | /* 0x77-0xff: Reserved */ |
|---|
| 157 | 163 | }; |
|---|
| 158 | 164 | |
|---|
| 159 | | -static struct rc_map_list cec_map = { |
|---|
| 165 | +struct rc_map_list cec_map = { |
|---|
| 160 | 166 | .map = { |
|---|
| 161 | 167 | .scan = cec, |
|---|
| 162 | 168 | .size = ARRAY_SIZE(cec), |
|---|
| .. | .. |
|---|
| 164 | 170 | .name = RC_MAP_CEC, |
|---|
| 165 | 171 | } |
|---|
| 166 | 172 | }; |
|---|
| 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"); |
|---|