1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Asus Notebooks WMI hotkey driver
5 * Copyright(C) 2010 Corentin Chary <corentin.chary@gmail.com>
8 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10 #include <linux/kernel.h>
11 #include <linux/module.h>
12 #include <linux/init.h>
13 #include <linux/input.h>
14 #include <linux/input/sparse-keymap.h>
16 #include <linux/dmi.h>
17 #include <linux/i8042.h>
21 #define ASUS_NB_WMI_FILE "asus-nb-wmi"
23 MODULE_AUTHOR("Corentin Chary <corentin.chary@gmail.com>");
24 MODULE_DESCRIPTION("Asus Notebooks WMI Hotkey Driver");
25 MODULE_LICENSE("GPL");
27 #define ASUS_NB_WMI_EVENT_GUID "0B3CBB35-E3C2-45ED-91C2-4C5A6D195D1C"
29 MODULE_ALIAS("wmi:"ASUS_NB_WMI_EVENT_GUID);
32 * WAPF defines the behavior of the Fn+Fx wlan key
33 * The significance of values is yet to be found, but
35 * Bit | Bluetooth | WLAN
36 * 0 | Hardware | Hardware
37 * 1 | Hardware | Software
38 * 4 | Software | Software
41 module_param(wapf, uint, 0444);
42 MODULE_PARM_DESC(wapf, "WAPF value");
44 static int tablet_mode_sw = -1;
45 module_param(tablet_mode_sw, uint, 0444);
46 MODULE_PARM_DESC(tablet_mode_sw, "Tablet mode detect: -1:auto 0:disable 1:kbd-dock 2:lid-flip 3:lid-flip-rog");
48 static struct quirk_entry *quirks;
50 static bool asus_q500a_i8042_filter(unsigned char data, unsigned char str,
56 if (str & I8042_STR_AUXDATA)
59 if (unlikely(data == 0xe1)) {
62 } else if (unlikely(extended)) {
70 static struct quirk_entry quirk_asus_unknown = {
72 .wmi_backlight_set_devstate = true,
75 static struct quirk_entry quirk_asus_q500a = {
76 .i8042_filter = asus_q500a_i8042_filter,
77 .wmi_backlight_set_devstate = true,
81 * For those machines that need software to control bt/wifi status
82 * and have duplicate events(ACPI and WMI) for display toggle
84 static struct quirk_entry quirk_asus_x55u = {
86 .wmi_backlight_set_devstate = true,
87 .no_display_toggle = true,
90 static struct quirk_entry quirk_asus_wapf4 = {
92 .wmi_backlight_set_devstate = true,
95 static struct quirk_entry quirk_asus_x200ca = {
97 .wmi_backlight_set_devstate = true,
100 static struct quirk_entry quirk_asus_x550lb = {
101 .wmi_backlight_set_devstate = true,
105 static struct quirk_entry quirk_asus_forceals = {
106 .wmi_backlight_set_devstate = true,
107 .wmi_force_als_set = true,
110 static struct quirk_entry quirk_asus_use_kbd_dock_devid = {
111 .tablet_switch_mode = asus_wmi_kbd_dock_devid,
114 static struct quirk_entry quirk_asus_use_lid_flip_devid = {
115 .wmi_backlight_set_devstate = true,
116 .tablet_switch_mode = asus_wmi_lid_flip_devid,
119 static struct quirk_entry quirk_asus_tablet_mode = {
120 .wmi_backlight_set_devstate = true,
121 .tablet_switch_mode = asus_wmi_lid_flip_rog_devid,
124 static struct quirk_entry quirk_asus_ignore_fan = {
125 .wmi_ignore_fan = true,
128 static int dmi_matched(const struct dmi_system_id *dmi)
130 pr_info("Identified laptop model '%s'\n", dmi->ident);
131 quirks = dmi->driver_data;
135 static const struct dmi_system_id asus_quirks[] = {
137 .callback = dmi_matched,
138 .ident = "ASUSTeK COMPUTER INC. Q500A",
140 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
141 DMI_MATCH(DMI_PRODUCT_NAME, "Q500A"),
143 .driver_data = &quirk_asus_q500a,
146 .callback = dmi_matched,
147 .ident = "ASUSTeK COMPUTER INC. U32U",
149 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
150 DMI_MATCH(DMI_PRODUCT_NAME, "U32U"),
152 .driver_data = &quirk_asus_wapf4,
155 .callback = dmi_matched,
156 .ident = "ASUSTeK COMPUTER INC. X302UA",
158 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
159 DMI_MATCH(DMI_PRODUCT_NAME, "X302UA"),
161 .driver_data = &quirk_asus_wapf4,
164 .callback = dmi_matched,
165 .ident = "ASUSTeK COMPUTER INC. X401U",
167 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
168 DMI_MATCH(DMI_PRODUCT_NAME, "X401U"),
170 .driver_data = &quirk_asus_x55u,
173 .callback = dmi_matched,
174 .ident = "ASUSTeK COMPUTER INC. X401A",
176 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
177 DMI_MATCH(DMI_PRODUCT_NAME, "X401A"),
179 .driver_data = &quirk_asus_wapf4,
182 .callback = dmi_matched,
183 .ident = "ASUSTeK COMPUTER INC. X401A1",
185 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
186 DMI_MATCH(DMI_PRODUCT_NAME, "X401A1"),
188 .driver_data = &quirk_asus_wapf4,
191 .callback = dmi_matched,
192 .ident = "ASUSTeK COMPUTER INC. X45U",
194 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
195 DMI_MATCH(DMI_PRODUCT_NAME, "X45U"),
197 .driver_data = &quirk_asus_wapf4,
200 .callback = dmi_matched,
201 .ident = "ASUSTeK COMPUTER INC. X456UA",
203 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
204 DMI_MATCH(DMI_PRODUCT_NAME, "X456UA"),
206 .driver_data = &quirk_asus_wapf4,
209 .callback = dmi_matched,
210 .ident = "ASUSTeK COMPUTER INC. X456UF",
212 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
213 DMI_MATCH(DMI_PRODUCT_NAME, "X456UF"),
215 .driver_data = &quirk_asus_wapf4,
218 .callback = dmi_matched,
219 .ident = "ASUSTeK COMPUTER INC. X501U",
221 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
222 DMI_MATCH(DMI_PRODUCT_NAME, "X501U"),
224 .driver_data = &quirk_asus_x55u,
227 .callback = dmi_matched,
228 .ident = "ASUSTeK COMPUTER INC. X501A",
230 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
231 DMI_MATCH(DMI_PRODUCT_NAME, "X501A"),
233 .driver_data = &quirk_asus_wapf4,
236 .callback = dmi_matched,
237 .ident = "ASUSTeK COMPUTER INC. X501A1",
239 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
240 DMI_MATCH(DMI_PRODUCT_NAME, "X501A1"),
242 .driver_data = &quirk_asus_wapf4,
245 .callback = dmi_matched,
246 .ident = "ASUSTeK COMPUTER INC. X550CA",
248 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
249 DMI_MATCH(DMI_PRODUCT_NAME, "X550CA"),
251 .driver_data = &quirk_asus_wapf4,
254 .callback = dmi_matched,
255 .ident = "ASUSTeK COMPUTER INC. X550CC",
257 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
258 DMI_MATCH(DMI_PRODUCT_NAME, "X550CC"),
260 .driver_data = &quirk_asus_wapf4,
263 .callback = dmi_matched,
264 .ident = "ASUSTeK COMPUTER INC. X550CL",
266 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
267 DMI_MATCH(DMI_PRODUCT_NAME, "X550CL"),
269 .driver_data = &quirk_asus_wapf4,
272 .callback = dmi_matched,
273 .ident = "ASUSTeK COMPUTER INC. X550VB",
275 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
276 DMI_MATCH(DMI_PRODUCT_NAME, "X550VB"),
278 .driver_data = &quirk_asus_wapf4,
281 .callback = dmi_matched,
282 .ident = "ASUSTeK COMPUTER INC. X551CA",
284 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
285 DMI_MATCH(DMI_PRODUCT_NAME, "X551CA"),
287 .driver_data = &quirk_asus_wapf4,
290 .callback = dmi_matched,
291 .ident = "ASUSTeK COMPUTER INC. X55A",
293 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
294 DMI_MATCH(DMI_PRODUCT_NAME, "X55A"),
296 .driver_data = &quirk_asus_wapf4,
299 .callback = dmi_matched,
300 .ident = "ASUSTeK COMPUTER INC. X55C",
302 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
303 DMI_MATCH(DMI_PRODUCT_NAME, "X55C"),
305 .driver_data = &quirk_asus_wapf4,
308 .callback = dmi_matched,
309 .ident = "ASUSTeK COMPUTER INC. X55U",
311 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
312 DMI_MATCH(DMI_PRODUCT_NAME, "X55U"),
314 .driver_data = &quirk_asus_x55u,
317 .callback = dmi_matched,
318 .ident = "ASUSTeK COMPUTER INC. X55VD",
320 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
321 DMI_MATCH(DMI_PRODUCT_NAME, "X55VD"),
323 .driver_data = &quirk_asus_wapf4,
326 .callback = dmi_matched,
327 .ident = "ASUSTeK COMPUTER INC. X75A",
329 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
330 DMI_MATCH(DMI_PRODUCT_NAME, "X75A"),
332 .driver_data = &quirk_asus_wapf4,
335 .callback = dmi_matched,
336 .ident = "ASUSTeK COMPUTER INC. X75VBP",
338 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
339 DMI_MATCH(DMI_PRODUCT_NAME, "X75VBP"),
341 .driver_data = &quirk_asus_wapf4,
344 .callback = dmi_matched,
345 .ident = "ASUSTeK COMPUTER INC. X75VD",
347 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
348 DMI_MATCH(DMI_PRODUCT_NAME, "X75VD"),
350 .driver_data = &quirk_asus_wapf4,
353 .callback = dmi_matched,
354 .ident = "ASUSTeK COMPUTER INC. 1015E",
356 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
357 DMI_MATCH(DMI_PRODUCT_NAME, "1015E"),
359 .driver_data = &quirk_asus_wapf4,
362 .callback = dmi_matched,
363 .ident = "ASUSTeK COMPUTER INC. 1015U",
365 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
366 DMI_MATCH(DMI_PRODUCT_NAME, "1015U"),
368 .driver_data = &quirk_asus_wapf4,
371 .callback = dmi_matched,
372 .ident = "ASUSTeK COMPUTER INC. X200CA",
374 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
375 DMI_MATCH(DMI_PRODUCT_NAME, "X200CA"),
377 .driver_data = &quirk_asus_x200ca,
380 .callback = dmi_matched,
381 .ident = "ASUSTeK COMPUTER INC. UX330UAK",
383 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
384 DMI_MATCH(DMI_PRODUCT_NAME, "UX330UAK"),
386 .driver_data = &quirk_asus_forceals,
389 .callback = dmi_matched,
390 .ident = "ASUSTeK COMPUTER INC. X550LB",
392 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
393 DMI_MATCH(DMI_PRODUCT_NAME, "X550LB"),
395 .driver_data = &quirk_asus_x550lb,
398 .callback = dmi_matched,
399 .ident = "ASUSTeK COMPUTER INC. UX430UQ",
401 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
402 DMI_MATCH(DMI_PRODUCT_NAME, "UX430UQ"),
404 .driver_data = &quirk_asus_forceals,
407 .callback = dmi_matched,
408 .ident = "ASUSTeK COMPUTER INC. UX430UNR",
410 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
411 DMI_MATCH(DMI_PRODUCT_NAME, "UX430UNR"),
413 .driver_data = &quirk_asus_forceals,
416 .callback = dmi_matched,
417 .ident = "Asus Transformer T100TA / T100HA / T100CHI",
419 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
421 DMI_MATCH(DMI_PRODUCT_NAME, "T100"),
423 .driver_data = &quirk_asus_use_kbd_dock_devid,
426 .callback = dmi_matched,
427 .ident = "Asus Transformer T101HA",
429 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
430 DMI_MATCH(DMI_PRODUCT_NAME, "T101HA"),
432 .driver_data = &quirk_asus_use_kbd_dock_devid,
435 .callback = dmi_matched,
436 .ident = "Asus Transformer T200TA",
438 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
439 DMI_MATCH(DMI_PRODUCT_NAME, "T200TA"),
441 .driver_data = &quirk_asus_use_kbd_dock_devid,
444 .callback = dmi_matched,
445 .ident = "ASUS ZenBook Flip UX360",
447 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
449 DMI_MATCH(DMI_PRODUCT_NAME, "UX360"),
451 .driver_data = &quirk_asus_use_lid_flip_devid,
454 .callback = dmi_matched,
455 .ident = "ASUS TP200s / E205SA",
457 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
458 DMI_MATCH(DMI_PRODUCT_NAME, "E205SA"),
460 .driver_data = &quirk_asus_use_lid_flip_devid,
463 .callback = dmi_matched,
464 .ident = "ASUS ROG FLOW X13",
466 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
468 DMI_MATCH(DMI_PRODUCT_NAME, "GV301"),
470 .driver_data = &quirk_asus_tablet_mode,
473 .callback = dmi_matched,
474 .ident = "ASUS ROG FLOW X16",
476 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
477 DMI_MATCH(DMI_PRODUCT_NAME, "GV601R"),
479 .driver_data = &quirk_asus_tablet_mode,
482 .callback = dmi_matched,
483 .ident = "ASUS ROG FLOW X16",
485 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
486 DMI_MATCH(DMI_PRODUCT_NAME, "GV601V"),
488 .driver_data = &quirk_asus_tablet_mode,
491 .callback = dmi_matched,
492 .ident = "ASUS VivoBook E410MA",
494 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
495 DMI_MATCH(DMI_PRODUCT_NAME, "E410MA"),
497 .driver_data = &quirk_asus_ignore_fan,
502 static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
506 quirks = &quirk_asus_unknown;
507 dmi_check_system(asus_quirks);
509 driver->quirks = quirks;
510 driver->panel_power = FB_BLANK_UNBLANK;
512 /* overwrite the wapf setting if the wapf paramater is specified */
518 if (tablet_mode_sw != -1)
519 quirks->tablet_switch_mode = tablet_mode_sw;
521 if (quirks->i8042_filter) {
522 ret = i8042_install_filter(quirks->i8042_filter);
524 pr_warn("Unable to install key filter\n");
527 pr_info("Using i8042 filter function for receiving events\n");
531 static const struct key_entry asus_nb_wmi_keymap[] = {
532 { KE_KEY, ASUS_WMI_BRN_DOWN, { KEY_BRIGHTNESSDOWN } },
533 { KE_KEY, ASUS_WMI_BRN_UP, { KEY_BRIGHTNESSUP } },
534 { KE_KEY, 0x30, { KEY_VOLUMEUP } },
535 { KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
536 { KE_KEY, 0x32, { KEY_MUTE } },
537 { KE_KEY, 0x33, { KEY_SCREENLOCK } },
538 { KE_KEY, 0x35, { KEY_SCREENLOCK } },
539 { KE_KEY, 0x38, { KEY_PROG3 } }, /* Armoury Crate */
540 { KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
541 { KE_KEY, 0x41, { KEY_NEXTSONG } },
542 { KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */
543 { KE_KEY, 0x45, { KEY_PLAYPAUSE } },
544 { KE_KEY, 0x4c, { KEY_MEDIA } }, /* WMP Key */
545 { KE_KEY, 0x50, { KEY_EMAIL } },
546 { KE_KEY, 0x51, { KEY_WWW } },
547 { KE_KEY, 0x55, { KEY_CALC } },
548 { KE_IGNORE, 0x57, }, /* Battery mode */
549 { KE_IGNORE, 0x58, }, /* AC mode */
550 { KE_KEY, 0x5C, { KEY_F15 } }, /* Power Gear key */
551 { KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */
552 { KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
553 { KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
554 { KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
555 { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD only */
556 { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT only */
557 { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT */
558 { KE_KEY, 0x64, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV */
559 { KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */
560 { KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */
561 { KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
562 { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
563 { KE_IGNORE, 0x6E, }, /* Low Battery notification */
564 { KE_KEY, 0x71, { KEY_F13 } }, /* General-purpose button */
565 { KE_IGNORE, 0x79, }, /* Charger type dectection notification */
566 { KE_KEY, 0x7a, { KEY_ALS_TOGGLE } }, /* Ambient Light Sensor Toggle */
567 { KE_IGNORE, 0x7B, }, /* Charger connect/disconnect notification */
568 { KE_KEY, 0x7c, { KEY_MICMUTE } },
569 { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
570 { KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */
571 { KE_KEY, 0x82, { KEY_CAMERA } },
572 { KE_KEY, 0x85, { KEY_CAMERA } },
573 { KE_KEY, 0x86, { KEY_PROG1 } }, /* MyASUS Key */
574 { KE_KEY, 0x88, { KEY_RFKILL } }, /* Radio Toggle Key */
575 { KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */
576 { KE_KEY, 0x8C, { KEY_SWITCHVIDEOMODE } }, /* SDSP DVI only */
577 { KE_KEY, 0x8D, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + DVI */
578 { KE_KEY, 0x8E, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + DVI */
579 { KE_KEY, 0x8F, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + DVI */
580 { KE_KEY, 0x90, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + DVI */
581 { KE_KEY, 0x91, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + DVI */
582 { KE_KEY, 0x92, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + DVI */
583 { KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI */
584 { KE_KEY, 0x95, { KEY_MEDIA } },
585 { KE_KEY, 0x99, { KEY_PHONE } }, /* Conflicts with fan mode switch */
586 { KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */
587 { KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */
588 { KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */
589 { KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */
590 { KE_KEY, 0xA4, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + HDMI */
591 { KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */
592 { KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */
593 { KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI */
594 { KE_KEY, 0xAE, { KEY_FN_F5 } }, /* Fn+F5 fan mode on 2020+ */
595 { KE_KEY, 0xB3, { KEY_PROG4 } }, /* AURA */
596 { KE_KEY, 0xB5, { KEY_CALC } },
597 { KE_IGNORE, 0xC0, }, /* External display connect/disconnect notification */
598 { KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
599 { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
600 { KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */
601 { KE_KEY, 0xFA, { KEY_PROG2 } }, /* Lid flip action */
602 { KE_KEY, 0xBD, { KEY_PROG2 } }, /* Lid flip action on ROG xflow laptops */
606 static struct asus_wmi_driver asus_nb_wmi_driver = {
607 .name = ASUS_NB_WMI_FILE,
608 .owner = THIS_MODULE,
609 .event_guid = ASUS_NB_WMI_EVENT_GUID,
610 .keymap = asus_nb_wmi_keymap,
611 .input_name = "Asus WMI hotkeys",
612 .input_phys = ASUS_NB_WMI_FILE "/input0",
613 .detect_quirks = asus_nb_wmi_quirks,
617 static int __init asus_nb_wmi_init(void)
619 return asus_wmi_register_driver(&asus_nb_wmi_driver);
622 static void __exit asus_nb_wmi_exit(void)
624 asus_wmi_unregister_driver(&asus_nb_wmi_driver);
627 module_init(asus_nb_wmi_init);
628 module_exit(asus_nb_wmi_exit);