Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * ATI X10 RF remote keytable
0004  *
0005  * Copyright (C) 2011 Anssi Hannula <anssi.hannula@?ki.fi>
0006  *
0007  * This file is based on the static generic keytable previously found in
0008  * ati_remote.c, which is
0009  * Copyright (c) 2004 Torrey Hoffman <thoffman@arnor.net>
0010  * Copyright (c) 2002 Vladimir Dergachev
0011  */
0012 
0013 #include <linux/module.h>
0014 #include <media/rc-map.h>
0015 
0016 /*
0017  * Intended usage comments below are from vendor-supplied
0018  * Source: ATI REMOTE WONDER™ Installation Guide
0019  * http://www2.ati.com/manuals/remctrl.pdf
0020  *
0021  * Scancodes were in strict left-right, top-bottom order on the
0022  * original ATI Remote Wonder, but were moved on later models.
0023  *
0024  * Keys A-F are intended to be user-programmable.
0025  */
0026 
0027 static struct rc_map_table ati_x10[] = {
0028     /* keyboard - Above the cursor pad */
0029     { 0x00, KEY_A },
0030     { 0x01, KEY_B },
0031     { 0x02, KEY_POWER },      /* Power */
0032 
0033     { 0x03, KEY_TV },         /* TV */
0034     { 0x04, KEY_DVD },        /* DVD */
0035     { 0x05, KEY_WWW },        /* WEB */
0036     { 0x06, KEY_BOOKMARKS },  /* "book": Open Media Library */
0037     { 0x07, KEY_EDIT },       /* "hand": Toggle left mouse button (grab) */
0038 
0039     /* Mouse emulation pad goes here, handled by driver separately */
0040 
0041     { 0x09, KEY_VOLUMEDOWN }, /* VOL + */
0042     { 0x08, KEY_VOLUMEUP },   /* VOL - */
0043     { 0x0a, KEY_MUTE },       /* MUTE  */
0044     { 0x0b, KEY_CHANNELUP },  /* CH + */
0045     { 0x0c, KEY_CHANNELDOWN },/* CH - */
0046 
0047     /*
0048      * We could use KEY_NUMERIC_x for these, but the X11 protocol
0049      * has problems with keycodes greater than 255, so avoid those high
0050      * keycodes in default maps.
0051      */
0052     { 0x0d, KEY_NUMERIC_1 },
0053     { 0x0e, KEY_NUMERIC_2 },
0054     { 0x0f, KEY_NUMERIC_3 },
0055     { 0x10, KEY_NUMERIC_4 },
0056     { 0x11, KEY_NUMERIC_5 },
0057     { 0x12, KEY_NUMERIC_6 },
0058     { 0x13, KEY_NUMERIC_7 },
0059     { 0x14, KEY_NUMERIC_8 },
0060     { 0x15, KEY_NUMERIC_9 },
0061     { 0x16, KEY_MENU },       /* "menu": DVD root menu */
0062                   /* KEY_NUMERIC_STAR? */
0063     { 0x17, KEY_NUMERIC_0 },
0064     { 0x18, KEY_SETUP },      /* "check": DVD setup menu */
0065                   /* KEY_NUMERIC_POUND? */
0066 
0067     /* DVD navigation buttons */
0068     { 0x19, KEY_C },
0069     { 0x1a, KEY_UP },         /* up */
0070     { 0x1b, KEY_D },
0071 
0072     { 0x1c, KEY_PROPS },      /* "timer" Should be Data On Screen */
0073                   /* Symbol is "circle nailed to box" */
0074     { 0x1d, KEY_LEFT },       /* left */
0075     { 0x1e, KEY_OK },         /* "OK" */
0076     { 0x1f, KEY_RIGHT },      /* right */
0077     { 0x20, KEY_SCREEN },     /* "max" (X11 warning: 0x177) */
0078                   /* Should be AC View Toggle, but
0079                      that's not in <input/input.h>.
0080                      KEY_ZOOM (0x174)? */
0081     { 0x21, KEY_E },
0082     { 0x22, KEY_DOWN },       /* down */
0083     { 0x23, KEY_F },
0084     /* Play/stop/pause buttons */
0085     { 0x24, KEY_REWIND },     /* (<<) Rewind */
0086     { 0x25, KEY_PLAY },       /* ( >) Play (KEY_PLAYCD?) */
0087     { 0x26, KEY_FASTFORWARD }, /* (>>) Fast forward */
0088 
0089     { 0x27, KEY_RECORD },     /* ( o) red */
0090     { 0x28, KEY_STOPCD },     /* ([]) Stop  (KEY_STOP is something else!) */
0091     { 0x29, KEY_PAUSE },      /* ('') Pause (KEY_PAUSECD?) */
0092 
0093     /* Extra keys, not on the original ATI remote */
0094     { 0x2a, KEY_NEXT },       /* (>+) */
0095     { 0x2b, KEY_PREVIOUS },   /* (<-) */
0096     { 0x2d, KEY_INFO },       /* PLAYING  (X11 warning: 0x166) */
0097     { 0x2e, KEY_HOME },       /* TOP */
0098     { 0x2f, KEY_END },        /* END */
0099     { 0x30, KEY_SELECT },     /* SELECT  (X11 warning: 0x161) */
0100 };
0101 
0102 static struct rc_map_list ati_x10_map = {
0103     .map = {
0104         .scan     = ati_x10,
0105         .size     = ARRAY_SIZE(ati_x10),
0106         .rc_proto = RC_PROTO_OTHER,
0107         .name     = RC_MAP_ATI_X10,
0108     }
0109 };
0110 
0111 static int __init init_rc_map_ati_x10(void)
0112 {
0113     return rc_map_register(&ati_x10_map);
0114 }
0115 
0116 static void __exit exit_rc_map_ati_x10(void)
0117 {
0118     rc_map_unregister(&ati_x10_map);
0119 }
0120 
0121 module_init(init_rc_map_ati_x10)
0122 module_exit(exit_rc_map_ati_x10)
0123 
0124 MODULE_LICENSE("GPL");
0125 MODULE_AUTHOR("Anssi Hannula <anssi.hannula@iki.fi>");