rc-zx-irdec.c (1722B)
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) 2017 Sanechips Technology Co., Ltd. 4 * Copyright 2017 Linaro Ltd. 5 */ 6 7#include <linux/module.h> 8#include <media/rc-map.h> 9 10static struct rc_map_table zx_irdec_table[] = { 11 { 0x01, KEY_NUMERIC_1 }, 12 { 0x02, KEY_NUMERIC_2 }, 13 { 0x03, KEY_NUMERIC_3 }, 14 { 0x04, KEY_NUMERIC_4 }, 15 { 0x05, KEY_NUMERIC_5 }, 16 { 0x06, KEY_NUMERIC_6 }, 17 { 0x07, KEY_NUMERIC_7 }, 18 { 0x08, KEY_NUMERIC_8 }, 19 { 0x09, KEY_NUMERIC_9 }, 20 { 0x31, KEY_NUMERIC_0 }, 21 { 0x16, KEY_DELETE }, 22 { 0x0a, KEY_MODE }, /* Input method */ 23 { 0x0c, KEY_VOLUMEUP }, 24 { 0x18, KEY_VOLUMEDOWN }, 25 { 0x0b, KEY_CHANNELUP }, 26 { 0x15, KEY_CHANNELDOWN }, 27 { 0x0d, KEY_PAGEUP }, 28 { 0x13, KEY_PAGEDOWN }, 29 { 0x46, KEY_FASTFORWARD }, 30 { 0x43, KEY_REWIND }, 31 { 0x44, KEY_PLAYPAUSE }, 32 { 0x45, KEY_STOP }, 33 { 0x49, KEY_OK }, 34 { 0x47, KEY_UP }, 35 { 0x4b, KEY_DOWN }, 36 { 0x48, KEY_LEFT }, 37 { 0x4a, KEY_RIGHT }, 38 { 0x4d, KEY_MENU }, 39 { 0x56, KEY_APPSELECT }, /* Application */ 40 { 0x4c, KEY_BACK }, 41 { 0x1e, KEY_INFO }, 42 { 0x4e, KEY_F1 }, 43 { 0x4f, KEY_F2 }, 44 { 0x50, KEY_F3 }, 45 { 0x51, KEY_F4 }, 46 { 0x1c, KEY_AUDIO }, 47 { 0x12, KEY_MUTE }, 48 { 0x11, KEY_DOT }, /* Location */ 49 { 0x1d, KEY_SETUP }, 50 { 0x40, KEY_POWER }, 51}; 52 53static struct rc_map_list zx_irdec_map = { 54 .map = { 55 .scan = zx_irdec_table, 56 .size = ARRAY_SIZE(zx_irdec_table), 57 .rc_proto = RC_PROTO_NEC, 58 .name = RC_MAP_ZX_IRDEC, 59 } 60}; 61 62static int __init init_rc_map_zx_irdec(void) 63{ 64 return rc_map_register(&zx_irdec_map); 65} 66 67static void __exit exit_rc_map_zx_irdec(void) 68{ 69 rc_map_unregister(&zx_irdec_map); 70} 71 72module_init(init_rc_map_zx_irdec) 73module_exit(exit_rc_map_zx_irdec) 74 75MODULE_AUTHOR("Shawn Guo <shawn.guo@linaro.org>"); 76MODULE_LICENSE("GPL v2");