1 // SPDX-License-Identifier: GPL-2.0+ 2 // Copyright (c) 2019 Clément Péron 3 4 #include <media/rc-map.h> 5 #include <linux/module.h> 6 7 /* 8 * Keymap for the Beelink GS1 remote control 9 */ 10 11 static struct rc_map_table beelink_gs1_table[] = { 12 /* 13 * TV Keys (Power, Learn and Volume) 14 * { 0x40400d, KEY_TV }, 15 * { 0x80f1, KEY_TV }, 16 * { 0x80f3, KEY_TV }, 17 * { 0x80f4, KEY_TV }, 18 */ 19 20 { 0x8051, KEY_POWER }, 21 { 0x804d, KEY_MUTE }, 22 { 0x8040, KEY_CONFIG }, 23 24 { 0x8026, KEY_UP }, 25 { 0x8028, KEY_DOWN }, 26 { 0x8025, KEY_LEFT }, 27 { 0x8027, KEY_RIGHT }, 28 { 0x800d, KEY_OK }, 29 30 { 0x8053, KEY_HOME }, 31 { 0x80bc, KEY_MEDIA }, 32 { 0x801b, KEY_BACK }, 33 { 0x8049, KEY_MENU }, 34 35 { 0x804e, KEY_VOLUMEUP }, 36 { 0x8056, KEY_VOLUMEDOWN }, 37 38 { 0x8054, KEY_SUBTITLE }, /* Web */ 39 { 0x8052, KEY_EPG }, /* Media */ 40 41 { 0x8041, KEY_CHANNELUP }, 42 { 0x8042, KEY_CHANNELDOWN }, 43 44 { 0x8031, KEY_1 }, 45 { 0x8032, KEY_2 }, 46 { 0x8033, KEY_3 }, 47 48 { 0x8034, KEY_4 }, 49 { 0x8035, KEY_5 }, 50 { 0x8036, KEY_6 }, 51 52 { 0x8037, KEY_7 }, 53 { 0x8038, KEY_8 }, 54 { 0x8039, KEY_9 }, 55 56 { 0x8044, KEY_DELETE }, 57 { 0x8030, KEY_0 }, 58 { 0x8058, KEY_MODE }, /* # Input Method */ 59 }; 60 61 static struct rc_map_list beelink_gs1_map = { 62 .map = { 63 .scan = beelink_gs1_table, 64 .size = ARRAY_SIZE(beelink_gs1_table), 65 .rc_proto = RC_PROTO_NEC, 66 .name = RC_MAP_BEELINK_GS1, 67 } 68 }; 69 70 static int __init init_rc_map_beelink_gs1(void) 71 { 72 return rc_map_register(&beelink_gs1_map); 73 } 74 75 static void __exit exit_rc_map_beelink_gs1(void) 76 { 77 rc_map_unregister(&beelink_gs1_map); 78 } 79 80 module_init(init_rc_map_beelink_gs1) 81 module_exit(exit_rc_map_beelink_gs1) 82 83 MODULE_LICENSE("GPL"); 84 MODULE_AUTHOR("Clément Péron <peron.clem@gmail.com>"); 85 MODULE_DESCRIPTION("Beelink GS1 remote controller keytable"); 86