Corentin Chary | b229ece | 2011-02-26 10:20:40 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Asus Notebooks WMI hotkey driver |
| 3 | * |
| 4 | * Copyright(C) 2010 Corentin Chary <corentin.chary@gmail.com> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ |
| 20 | |
| 21 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 22 | |
| 23 | #include <linux/kernel.h> |
| 24 | #include <linux/module.h> |
| 25 | #include <linux/init.h> |
| 26 | #include <linux/input.h> |
| 27 | #include <linux/input/sparse-keymap.h> |
Corentin Chary | fb05b9f | 2012-03-20 09:53:11 +0100 | [diff] [blame] | 28 | #include <linux/fb.h> |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 29 | #include <linux/dmi.h> |
Corentin Chary | b229ece | 2011-02-26 10:20:40 +0100 | [diff] [blame] | 30 | |
| 31 | #include "asus-wmi.h" |
| 32 | |
| 33 | #define ASUS_NB_WMI_FILE "asus-nb-wmi" |
| 34 | |
Corentin Chary | 5909c65 | 2012-12-17 16:00:05 -0800 | [diff] [blame] | 35 | MODULE_AUTHOR("Corentin Chary <corentin.chary@gmail.com>"); |
Corentin Chary | b229ece | 2011-02-26 10:20:40 +0100 | [diff] [blame] | 36 | MODULE_DESCRIPTION("Asus Notebooks WMI Hotkey Driver"); |
| 37 | MODULE_LICENSE("GPL"); |
| 38 | |
| 39 | #define ASUS_NB_WMI_EVENT_GUID "0B3CBB35-E3C2-45ED-91C2-4C5A6D195D1C" |
| 40 | |
| 41 | MODULE_ALIAS("wmi:"ASUS_NB_WMI_EVENT_GUID); |
| 42 | |
Corentin Chary | fddbfed | 2011-07-01 11:34:39 +0200 | [diff] [blame] | 43 | /* |
| 44 | * WAPF defines the behavior of the Fn+Fx wlan key |
| 45 | * The significance of values is yet to be found, but |
| 46 | * most of the time: |
| 47 | * Bit | Bluetooth | WLAN |
| 48 | * 0 | Hardware | Hardware |
| 49 | * 1 | Hardware | Software |
| 50 | * 4 | Software | Software |
| 51 | */ |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 52 | static int wapf = -1; |
Corentin Chary | fddbfed | 2011-07-01 11:34:39 +0200 | [diff] [blame] | 53 | module_param(wapf, uint, 0444); |
| 54 | MODULE_PARM_DESC(wapf, "WAPF value"); |
| 55 | |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 56 | static struct quirk_entry *quirks; |
| 57 | |
Corentin Chary | 6a2bccc | 2012-03-20 09:53:10 +0100 | [diff] [blame] | 58 | static struct quirk_entry quirk_asus_unknown = { |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 59 | .wapf = 0, |
| 60 | }; |
| 61 | |
AceLan Kao | a2a96f0 | 2012-10-03 11:26:31 +0200 | [diff] [blame] | 62 | /* |
| 63 | * For those machines that need software to control bt/wifi status |
| 64 | * and can't adjust brightness through ACPI interface |
| 65 | * and have duplicate events(ACPI and WMI) for display toggle |
| 66 | */ |
| 67 | static struct quirk_entry quirk_asus_x55u = { |
| 68 | .wapf = 4, |
| 69 | .wmi_backlight_power = true, |
| 70 | .no_display_toggle = true, |
| 71 | }; |
| 72 | |
Hans de Goede | 378008d | 2014-07-14 09:14:34 +0200 | [diff] [blame] | 73 | static struct quirk_entry quirk_asus_wapf4 = { |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 74 | .wapf = 4, |
| 75 | }; |
| 76 | |
AceLan Kao | c66263a | 2014-07-09 16:18:19 +0800 | [diff] [blame] | 77 | static struct quirk_entry quirk_asus_x200ca = { |
| 78 | .wapf = 2, |
| 79 | }; |
| 80 | |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 81 | static int dmi_matched(const struct dmi_system_id *dmi) |
| 82 | { |
| 83 | quirks = dmi->driver_data; |
| 84 | return 1; |
| 85 | } |
| 86 | |
Mathias Krause | 55d1e9d | 2014-07-16 19:43:08 +0200 | [diff] [blame] | 87 | static const struct dmi_system_id asus_quirks[] = { |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 88 | { |
| 89 | .callback = dmi_matched, |
Hans de Goede | 831a444 | 2014-07-29 11:59:57 +0200 | [diff] [blame] | 90 | .ident = "ASUSTeK COMPUTER INC. U32U", |
| 91 | .matches = { |
| 92 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), |
| 93 | DMI_MATCH(DMI_PRODUCT_NAME, "U32U"), |
| 94 | }, |
| 95 | /* |
| 96 | * Note this machine has a Brazos APU, and most Brazos Asus |
| 97 | * machines need quirk_asus_x55u / wmi_backlight_power but |
| 98 | * here acpi-video seems to work fine for backlight control. |
| 99 | */ |
| 100 | .driver_data = &quirk_asus_wapf4, |
| 101 | }, |
| 102 | { |
| 103 | .callback = dmi_matched, |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 104 | .ident = "ASUSTeK COMPUTER INC. X401U", |
| 105 | .matches = { |
| 106 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 107 | DMI_MATCH(DMI_PRODUCT_NAME, "X401U"), |
| 108 | }, |
AceLan Kao | a2a96f0 | 2012-10-03 11:26:31 +0200 | [diff] [blame] | 109 | .driver_data = &quirk_asus_x55u, |
| 110 | }, |
| 111 | { |
| 112 | .callback = dmi_matched, |
| 113 | .ident = "ASUSTeK COMPUTER INC. X401A", |
| 114 | .matches = { |
| 115 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 116 | DMI_MATCH(DMI_PRODUCT_NAME, "X401A"), |
| 117 | }, |
Hans de Goede | 378008d | 2014-07-14 09:14:34 +0200 | [diff] [blame] | 118 | .driver_data = &quirk_asus_wapf4, |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 119 | }, |
| 120 | { |
| 121 | .callback = dmi_matched, |
| 122 | .ident = "ASUSTeK COMPUTER INC. X401A1", |
| 123 | .matches = { |
| 124 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 125 | DMI_MATCH(DMI_PRODUCT_NAME, "X401A1"), |
| 126 | }, |
Hans de Goede | 378008d | 2014-07-14 09:14:34 +0200 | [diff] [blame] | 127 | .driver_data = &quirk_asus_wapf4, |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 128 | }, |
| 129 | { |
| 130 | .callback = dmi_matched, |
| 131 | .ident = "ASUSTeK COMPUTER INC. X501U", |
| 132 | .matches = { |
| 133 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 134 | DMI_MATCH(DMI_PRODUCT_NAME, "X501U"), |
| 135 | }, |
AceLan Kao | a2a96f0 | 2012-10-03 11:26:31 +0200 | [diff] [blame] | 136 | .driver_data = &quirk_asus_x55u, |
| 137 | }, |
| 138 | { |
| 139 | .callback = dmi_matched, |
| 140 | .ident = "ASUSTeK COMPUTER INC. X501A", |
| 141 | .matches = { |
| 142 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 143 | DMI_MATCH(DMI_PRODUCT_NAME, "X501A"), |
| 144 | }, |
Hans de Goede | 378008d | 2014-07-14 09:14:34 +0200 | [diff] [blame] | 145 | .driver_data = &quirk_asus_wapf4, |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 146 | }, |
| 147 | { |
| 148 | .callback = dmi_matched, |
| 149 | .ident = "ASUSTeK COMPUTER INC. X501A1", |
| 150 | .matches = { |
| 151 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 152 | DMI_MATCH(DMI_PRODUCT_NAME, "X501A1"), |
| 153 | }, |
Hans de Goede | 378008d | 2014-07-14 09:14:34 +0200 | [diff] [blame] | 154 | .driver_data = &quirk_asus_wapf4, |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 155 | }, |
| 156 | { |
| 157 | .callback = dmi_matched, |
Andreas Utterberg | c08db55 | 2014-05-06 22:27:45 +0200 | [diff] [blame] | 158 | .ident = "ASUSTeK COMPUTER INC. X550CA", |
| 159 | .matches = { |
| 160 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 161 | DMI_MATCH(DMI_PRODUCT_NAME, "X550CA"), |
| 162 | }, |
Hans de Goede | 378008d | 2014-07-14 09:14:34 +0200 | [diff] [blame] | 163 | .driver_data = &quirk_asus_wapf4, |
Andreas Utterberg | c08db55 | 2014-05-06 22:27:45 +0200 | [diff] [blame] | 164 | }, |
| 165 | { |
| 166 | .callback = dmi_matched, |
Hans de Goede | 6d6ded3 | 2014-07-18 12:15:09 +0200 | [diff] [blame] | 167 | .ident = "ASUSTeK COMPUTER INC. X550CC", |
| 168 | .matches = { |
| 169 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 170 | DMI_MATCH(DMI_PRODUCT_NAME, "X550CC"), |
| 171 | }, |
| 172 | .driver_data = &quirk_asus_wapf4, |
| 173 | }, |
| 174 | { |
| 175 | .callback = dmi_matched, |
Hans de Goede | 22ba58c | 2014-07-14 09:14:35 +0200 | [diff] [blame] | 176 | .ident = "ASUSTeK COMPUTER INC. X550CL", |
| 177 | .matches = { |
| 178 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 179 | DMI_MATCH(DMI_PRODUCT_NAME, "X550CL"), |
| 180 | }, |
| 181 | .driver_data = &quirk_asus_wapf4, |
| 182 | }, |
| 183 | { |
| 184 | .callback = dmi_matched, |
Stanislaw Gruszka | 4ec7a45 | 2014-10-26 11:23:55 +0100 | [diff] [blame] | 185 | .ident = "ASUSTeK COMPUTER INC. X550VB", |
| 186 | .matches = { |
| 187 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 188 | DMI_MATCH(DMI_PRODUCT_NAME, "X550VB"), |
| 189 | }, |
| 190 | .driver_data = &quirk_asus_wapf4, |
| 191 | }, |
| 192 | { |
| 193 | .callback = dmi_matched, |
Hans de Goede | 841e11c | 2014-11-24 11:26:32 +0100 | [diff] [blame] | 194 | .ident = "ASUSTeK COMPUTER INC. X551CA", |
| 195 | .matches = { |
| 196 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 197 | DMI_MATCH(DMI_PRODUCT_NAME, "X551CA"), |
| 198 | }, |
| 199 | .driver_data = &quirk_asus_wapf4, |
| 200 | }, |
| 201 | { |
| 202 | .callback = dmi_matched, |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 203 | .ident = "ASUSTeK COMPUTER INC. X55A", |
| 204 | .matches = { |
| 205 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 206 | DMI_MATCH(DMI_PRODUCT_NAME, "X55A"), |
| 207 | }, |
Hans de Goede | 378008d | 2014-07-14 09:14:34 +0200 | [diff] [blame] | 208 | .driver_data = &quirk_asus_wapf4, |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 209 | }, |
| 210 | { |
| 211 | .callback = dmi_matched, |
| 212 | .ident = "ASUSTeK COMPUTER INC. X55C", |
| 213 | .matches = { |
| 214 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 215 | DMI_MATCH(DMI_PRODUCT_NAME, "X55C"), |
| 216 | }, |
Hans de Goede | 378008d | 2014-07-14 09:14:34 +0200 | [diff] [blame] | 217 | .driver_data = &quirk_asus_wapf4, |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 218 | }, |
| 219 | { |
| 220 | .callback = dmi_matched, |
| 221 | .ident = "ASUSTeK COMPUTER INC. X55U", |
| 222 | .matches = { |
| 223 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 224 | DMI_MATCH(DMI_PRODUCT_NAME, "X55U"), |
| 225 | }, |
AceLan Kao | a2a96f0 | 2012-10-03 11:26:31 +0200 | [diff] [blame] | 226 | .driver_data = &quirk_asus_x55u, |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 227 | }, |
| 228 | { |
| 229 | .callback = dmi_matched, |
| 230 | .ident = "ASUSTeK COMPUTER INC. X55VD", |
| 231 | .matches = { |
| 232 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 233 | DMI_MATCH(DMI_PRODUCT_NAME, "X55VD"), |
| 234 | }, |
Hans de Goede | 378008d | 2014-07-14 09:14:34 +0200 | [diff] [blame] | 235 | .driver_data = &quirk_asus_wapf4, |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 236 | }, |
AceLan Kao | a849e00 | 2013-04-25 15:11:07 +0800 | [diff] [blame] | 237 | { |
| 238 | .callback = dmi_matched, |
| 239 | .ident = "ASUSTeK COMPUTER INC. X75A", |
| 240 | .matches = { |
| 241 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 242 | DMI_MATCH(DMI_PRODUCT_NAME, "X75A"), |
| 243 | }, |
Hans de Goede | 378008d | 2014-07-14 09:14:34 +0200 | [diff] [blame] | 244 | .driver_data = &quirk_asus_wapf4, |
AceLan Kao | a849e00 | 2013-04-25 15:11:07 +0800 | [diff] [blame] | 245 | }, |
AceLan Kao | 144a19a | 2013-07-03 14:35:15 +0800 | [diff] [blame] | 246 | { |
| 247 | .callback = dmi_matched, |
poma | 7216e10 | 2014-05-06 22:03:38 +0200 | [diff] [blame] | 248 | .ident = "ASUSTeK COMPUTER INC. X75VBP", |
| 249 | .matches = { |
| 250 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 251 | DMI_MATCH(DMI_PRODUCT_NAME, "X75VBP"), |
| 252 | }, |
Hans de Goede | 378008d | 2014-07-14 09:14:34 +0200 | [diff] [blame] | 253 | .driver_data = &quirk_asus_wapf4, |
poma | 7216e10 | 2014-05-06 22:03:38 +0200 | [diff] [blame] | 254 | }, |
| 255 | { |
| 256 | .callback = dmi_matched, |
AceLan Kao | 144a19a | 2013-07-03 14:35:15 +0800 | [diff] [blame] | 257 | .ident = "ASUSTeK COMPUTER INC. 1015E", |
| 258 | .matches = { |
| 259 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 260 | DMI_MATCH(DMI_PRODUCT_NAME, "1015E"), |
| 261 | }, |
Hans de Goede | 378008d | 2014-07-14 09:14:34 +0200 | [diff] [blame] | 262 | .driver_data = &quirk_asus_wapf4, |
AceLan Kao | 144a19a | 2013-07-03 14:35:15 +0800 | [diff] [blame] | 263 | }, |
| 264 | { |
| 265 | .callback = dmi_matched, |
| 266 | .ident = "ASUSTeK COMPUTER INC. 1015U", |
| 267 | .matches = { |
| 268 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 269 | DMI_MATCH(DMI_PRODUCT_NAME, "1015U"), |
| 270 | }, |
Hans de Goede | 378008d | 2014-07-14 09:14:34 +0200 | [diff] [blame] | 271 | .driver_data = &quirk_asus_wapf4, |
AceLan Kao | 144a19a | 2013-07-03 14:35:15 +0800 | [diff] [blame] | 272 | }, |
AceLan Kao | c66263a | 2014-07-09 16:18:19 +0800 | [diff] [blame] | 273 | { |
| 274 | .callback = dmi_matched, |
| 275 | .ident = "ASUSTeK COMPUTER INC. X200CA", |
| 276 | .matches = { |
| 277 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 278 | DMI_MATCH(DMI_PRODUCT_NAME, "X200CA"), |
| 279 | }, |
| 280 | .driver_data = &quirk_asus_x200ca, |
| 281 | }, |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 282 | {}, |
Corentin Chary | 6a2bccc | 2012-03-20 09:53:10 +0100 | [diff] [blame] | 283 | }; |
| 284 | |
Corentin Chary | fddbfed | 2011-07-01 11:34:39 +0200 | [diff] [blame] | 285 | static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver) |
| 286 | { |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 287 | quirks = &quirk_asus_unknown; |
| 288 | dmi_check_system(asus_quirks); |
| 289 | |
| 290 | driver->quirks = quirks; |
Corentin Chary | fb05b9f | 2012-03-20 09:53:11 +0100 | [diff] [blame] | 291 | driver->panel_power = FB_BLANK_UNBLANK; |
AceLan Kao | d2044c5 | 2012-07-04 11:19:08 +0800 | [diff] [blame] | 292 | |
| 293 | /* overwrite the wapf setting if the wapf paramater is specified */ |
| 294 | if (wapf != -1) |
| 295 | quirks->wapf = wapf; |
| 296 | else |
| 297 | wapf = quirks->wapf; |
Corentin Chary | fddbfed | 2011-07-01 11:34:39 +0200 | [diff] [blame] | 298 | } |
| 299 | |
Corentin Chary | b229ece | 2011-02-26 10:20:40 +0100 | [diff] [blame] | 300 | static const struct key_entry asus_nb_wmi_keymap[] = { |
Corentin Chary | 3ba0302 | 2012-11-29 09:12:38 +0100 | [diff] [blame] | 301 | { KE_KEY, ASUS_WMI_BRN_DOWN, { KEY_BRIGHTNESSDOWN } }, |
| 302 | { KE_KEY, ASUS_WMI_BRN_UP, { KEY_BRIGHTNESSUP } }, |
Corentin Chary | b229ece | 2011-02-26 10:20:40 +0100 | [diff] [blame] | 303 | { KE_KEY, 0x30, { KEY_VOLUMEUP } }, |
| 304 | { KE_KEY, 0x31, { KEY_VOLUMEDOWN } }, |
| 305 | { KE_KEY, 0x32, { KEY_MUTE } }, |
| 306 | { KE_KEY, 0x33, { KEY_DISPLAYTOGGLE } }, /* LCD on */ |
| 307 | { KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */ |
| 308 | { KE_KEY, 0x40, { KEY_PREVIOUSSONG } }, |
| 309 | { KE_KEY, 0x41, { KEY_NEXTSONG } }, |
Corentin Chary | a935eae | 2012-10-03 11:26:26 +0200 | [diff] [blame] | 310 | { KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */ |
Corentin Chary | b229ece | 2011-02-26 10:20:40 +0100 | [diff] [blame] | 311 | { KE_KEY, 0x45, { KEY_PLAYPAUSE } }, |
Corentin Chary | a935eae | 2012-10-03 11:26:26 +0200 | [diff] [blame] | 312 | { KE_KEY, 0x4c, { KEY_MEDIA } }, /* WMP Key */ |
Corentin Chary | b229ece | 2011-02-26 10:20:40 +0100 | [diff] [blame] | 313 | { KE_KEY, 0x50, { KEY_EMAIL } }, |
| 314 | { KE_KEY, 0x51, { KEY_WWW } }, |
| 315 | { KE_KEY, 0x55, { KEY_CALC } }, |
Corentin Chary | 9b05ea2 | 2012-03-20 09:53:02 +0100 | [diff] [blame] | 316 | { KE_IGNORE, 0x57, }, /* Battery mode */ |
| 317 | { KE_IGNORE, 0x58, }, /* AC mode */ |
Corentin Chary | b229ece | 2011-02-26 10:20:40 +0100 | [diff] [blame] | 318 | { KE_KEY, 0x5C, { KEY_F15 } }, /* Power Gear key */ |
Corentin Chary | fddbfed | 2011-07-01 11:34:39 +0200 | [diff] [blame] | 319 | { KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */ |
| 320 | { KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */ |
| 321 | { KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */ |
AceLan Kao | 98bfcb8 | 2012-10-03 11:26:29 +0200 | [diff] [blame] | 322 | { KE_KEY, 0x60, { KEY_TOUCHPAD_ON } }, |
AceLan Kao | 24c8a4c | 2012-10-03 11:26:30 +0200 | [diff] [blame] | 323 | { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD only */ |
| 324 | { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT only */ |
| 325 | { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT */ |
| 326 | { KE_KEY, 0x64, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV */ |
| 327 | { KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */ |
| 328 | { KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */ |
| 329 | { KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */ |
Corentin Chary | b229ece | 2011-02-26 10:20:40 +0100 | [diff] [blame] | 330 | { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, |
Corentin Chary | 982d385 | 2012-10-03 11:26:25 +0200 | [diff] [blame] | 331 | { KE_IGNORE, 0x6E, }, /* Low Battery notification */ |
Corentin Chary | a935eae | 2012-10-03 11:26:26 +0200 | [diff] [blame] | 332 | { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */ |
| 333 | { KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */ |
Corentin Chary | b229ece | 2011-02-26 10:20:40 +0100 | [diff] [blame] | 334 | { KE_KEY, 0x82, { KEY_CAMERA } }, |
Corentin Chary | a935eae | 2012-10-03 11:26:26 +0200 | [diff] [blame] | 335 | { KE_KEY, 0x88, { KEY_RFKILL } }, /* Radio Toggle Key */ |
| 336 | { KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */ |
AceLan Kao | 24c8a4c | 2012-10-03 11:26:30 +0200 | [diff] [blame] | 337 | { KE_KEY, 0x8C, { KEY_SWITCHVIDEOMODE } }, /* SDSP DVI only */ |
| 338 | { KE_KEY, 0x8D, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + DVI */ |
| 339 | { KE_KEY, 0x8E, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + DVI */ |
| 340 | { KE_KEY, 0x8F, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + DVI */ |
| 341 | { KE_KEY, 0x90, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + DVI */ |
| 342 | { KE_KEY, 0x91, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + DVI */ |
| 343 | { KE_KEY, 0x92, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + DVI */ |
| 344 | { KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI */ |
Corentin Chary | b229ece | 2011-02-26 10:20:40 +0100 | [diff] [blame] | 345 | { KE_KEY, 0x95, { KEY_MEDIA } }, |
| 346 | { KE_KEY, 0x99, { KEY_PHONE } }, |
AceLan Kao | 3766054 | 2012-07-04 15:20:14 +0800 | [diff] [blame] | 347 | { KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */ |
| 348 | { KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */ |
| 349 | { KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */ |
| 350 | { KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */ |
AceLan Kao | 24c8a4c | 2012-10-03 11:26:30 +0200 | [diff] [blame] | 351 | { KE_KEY, 0xA4, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + HDMI */ |
| 352 | { KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */ |
| 353 | { KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */ |
| 354 | { KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI */ |
Corentin Chary | a935eae | 2012-10-03 11:26:26 +0200 | [diff] [blame] | 355 | { KE_KEY, 0xB5, { KEY_CALC } }, |
| 356 | { KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, |
| 357 | { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, |
Viktar Vauchkevich | 3aabf44 | 2013-05-23 07:17:11 +0300 | [diff] [blame] | 358 | { KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */ |
Corentin Chary | b229ece | 2011-02-26 10:20:40 +0100 | [diff] [blame] | 359 | { KE_END, 0}, |
| 360 | }; |
| 361 | |
| 362 | static struct asus_wmi_driver asus_nb_wmi_driver = { |
| 363 | .name = ASUS_NB_WMI_FILE, |
| 364 | .owner = THIS_MODULE, |
| 365 | .event_guid = ASUS_NB_WMI_EVENT_GUID, |
| 366 | .keymap = asus_nb_wmi_keymap, |
| 367 | .input_name = "Asus WMI hotkeys", |
| 368 | .input_phys = ASUS_NB_WMI_FILE "/input0", |
AceLan Kao | c87992d | 2012-03-20 09:53:08 +0100 | [diff] [blame] | 369 | .detect_quirks = asus_nb_wmi_quirks, |
Corentin Chary | b229ece | 2011-02-26 10:20:40 +0100 | [diff] [blame] | 370 | }; |
| 371 | |
| 372 | |
| 373 | static int __init asus_nb_wmi_init(void) |
| 374 | { |
| 375 | return asus_wmi_register_driver(&asus_nb_wmi_driver); |
| 376 | } |
| 377 | |
| 378 | static void __exit asus_nb_wmi_exit(void) |
| 379 | { |
| 380 | asus_wmi_unregister_driver(&asus_nb_wmi_driver); |
| 381 | } |
| 382 | |
| 383 | module_init(asus_nb_wmi_init); |
| 384 | module_exit(asus_nb_wmi_exit); |