Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * Medion X10 RF remote keytable (Digitainer variant)
0004  *
0005  * Copyright (C) 2012 Anssi Hannula <anssi.hannula@iki.fi>
0006  *
0007  * This keymap is for a variant that has a distinctive scrollwheel instead of
0008  * up/down buttons (tested with P/N 40009936 / 20018268), reportedly
0009  * originally shipped with Medion Digitainer but now sold separately simply as
0010  * an "X10" remote.
0011  */
0012 
0013 #include <linux/module.h>
0014 #include <media/rc-map.h>
0015 
0016 static struct rc_map_table medion_x10_digitainer[] = {
0017     { 0x02, KEY_POWER },
0018 
0019     { 0x2c, KEY_TV },
0020     { 0x2d, KEY_VIDEO },
0021     { 0x04, KEY_DVD },    /* CD/DVD */
0022     { 0x16, KEY_TEXT },   /* "teletext" icon, i.e. a screen with lines */
0023     { 0x06, KEY_AUDIO },
0024     { 0x2e, KEY_RADIO },
0025     { 0x31, KEY_EPG },    /* a screen with an open book */
0026     { 0x05, KEY_IMAGES }, /* Photo */
0027     { 0x2f, KEY_INFO },
0028 
0029     { 0x78, KEY_UP },     /* scrollwheel up 1 notch */
0030     /* 0x79..0x7f: 2-8 notches, driver repeats 0x78 entry */
0031 
0032     { 0x70, KEY_DOWN },   /* scrollwheel down 1 notch */
0033     /* 0x71..0x77: 2-8 notches, driver repeats 0x70 entry */
0034 
0035     { 0x19, KEY_MENU },
0036     { 0x1d, KEY_LEFT },
0037     { 0x1e, KEY_OK },     /* scrollwheel press */
0038     { 0x1f, KEY_RIGHT },
0039     { 0x20, KEY_BACK },
0040 
0041     { 0x09, KEY_VOLUMEUP },
0042     { 0x08, KEY_VOLUMEDOWN },
0043     { 0x00, KEY_MUTE },
0044 
0045     { 0x1b, KEY_SELECT }, /* also has "U" rotated 90 degrees CCW */
0046 
0047     { 0x0b, KEY_CHANNELUP },
0048     { 0x0c, KEY_CHANNELDOWN },
0049     { 0x1c, KEY_LAST },
0050 
0051     { 0x32, KEY_RED },    /* also Audio */
0052     { 0x33, KEY_GREEN },  /* also Subtitle */
0053     { 0x34, KEY_YELLOW }, /* also Angle */
0054     { 0x35, KEY_BLUE },   /* also Title */
0055 
0056     { 0x28, KEY_STOP },
0057     { 0x29, KEY_PAUSE },
0058     { 0x25, KEY_PLAY },
0059     { 0x21, KEY_PREVIOUS },
0060     { 0x18, KEY_CAMERA },
0061     { 0x23, KEY_NEXT },
0062     { 0x24, KEY_REWIND },
0063     { 0x27, KEY_RECORD },
0064     { 0x26, KEY_FORWARD },
0065 
0066     { 0x0d, KEY_NUMERIC_1 },
0067     { 0x0e, KEY_NUMERIC_2 },
0068     { 0x0f, KEY_NUMERIC_3 },
0069     { 0x10, KEY_NUMERIC_4 },
0070     { 0x11, KEY_NUMERIC_5 },
0071     { 0x12, KEY_NUMERIC_6 },
0072     { 0x13, KEY_NUMERIC_7 },
0073     { 0x14, KEY_NUMERIC_8 },
0074     { 0x15, KEY_NUMERIC_9 },
0075     { 0x17, KEY_NUMERIC_0 },
0076 
0077     /* these do not actually exist on this remote, but these scancodes
0078      * exist on all other Medion X10 remotes and adding them here allows
0079      * such remotes to be adequately usable with this keymap in case
0080      * this keymap is wrongly used with them (which is quite possible as
0081      * there are lots of different Medion X10 remotes): */
0082     { 0x1a, KEY_UP },
0083     { 0x22, KEY_DOWN },
0084 };
0085 
0086 static struct rc_map_list medion_x10_digitainer_map = {
0087     .map = {
0088         .scan     = medion_x10_digitainer,
0089         .size     = ARRAY_SIZE(medion_x10_digitainer),
0090         .rc_proto = RC_PROTO_OTHER,
0091         .name     = RC_MAP_MEDION_X10_DIGITAINER,
0092     }
0093 };
0094 
0095 static int __init init_rc_map_medion_x10_digitainer(void)
0096 {
0097     return rc_map_register(&medion_x10_digitainer_map);
0098 }
0099 
0100 static void __exit exit_rc_map_medion_x10_digitainer(void)
0101 {
0102     rc_map_unregister(&medion_x10_digitainer_map);
0103 }
0104 
0105 module_init(init_rc_map_medion_x10_digitainer)
0106 module_exit(exit_rc_map_medion_x10_digitainer)
0107 
0108 MODULE_DESCRIPTION("Medion X10 RF remote keytable (Digitainer variant)");
0109 MODULE_AUTHOR("Anssi Hannula <anssi.hannula@iki.fi>");
0110 MODULE_LICENSE("GPL");