| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Asus Notebooks WMI hotkey driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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 | 6 | */ |
|---|
| 20 | 7 | |
|---|
| 21 | 8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
|---|
| .. | .. |
|---|
| 121 | 108 | static struct quirk_entry quirk_asus_forceals = { |
|---|
| 122 | 109 | .wmi_backlight_set_devstate = true, |
|---|
| 123 | 110 | .wmi_force_als_set = true, |
|---|
| 111 | +}; |
|---|
| 112 | + |
|---|
| 113 | +static struct quirk_entry quirk_asus_use_kbd_dock_devid = { |
|---|
| 114 | + .use_kbd_dock_devid = true, |
|---|
| 124 | 115 | }; |
|---|
| 125 | 116 | |
|---|
| 126 | 117 | static int dmi_matched(const struct dmi_system_id *dmi) |
|---|
| .. | .. |
|---|
| 415 | 406 | }, |
|---|
| 416 | 407 | .driver_data = &quirk_asus_forceals, |
|---|
| 417 | 408 | }, |
|---|
| 409 | + { |
|---|
| 410 | + .callback = dmi_matched, |
|---|
| 411 | + .ident = "ASUSTeK COMPUTER INC. UX430UNR", |
|---|
| 412 | + .matches = { |
|---|
| 413 | + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
|---|
| 414 | + DMI_MATCH(DMI_PRODUCT_NAME, "UX430UNR"), |
|---|
| 415 | + }, |
|---|
| 416 | + .driver_data = &quirk_asus_forceals, |
|---|
| 417 | + }, |
|---|
| 418 | + { |
|---|
| 419 | + .callback = dmi_matched, |
|---|
| 420 | + .ident = "Asus Transformer T100TA / T100HA / T100CHI", |
|---|
| 421 | + .matches = { |
|---|
| 422 | + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
|---|
| 423 | + /* Match *T100* */ |
|---|
| 424 | + DMI_MATCH(DMI_PRODUCT_NAME, "T100"), |
|---|
| 425 | + }, |
|---|
| 426 | + .driver_data = &quirk_asus_use_kbd_dock_devid, |
|---|
| 427 | + }, |
|---|
| 428 | + { |
|---|
| 429 | + .callback = dmi_matched, |
|---|
| 430 | + .ident = "Asus Transformer T101HA", |
|---|
| 431 | + .matches = { |
|---|
| 432 | + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
|---|
| 433 | + DMI_MATCH(DMI_PRODUCT_NAME, "T101HA"), |
|---|
| 434 | + }, |
|---|
| 435 | + .driver_data = &quirk_asus_use_kbd_dock_devid, |
|---|
| 436 | + }, |
|---|
| 437 | + { |
|---|
| 438 | + .callback = dmi_matched, |
|---|
| 439 | + .ident = "Asus Transformer T200TA", |
|---|
| 440 | + .matches = { |
|---|
| 441 | + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
|---|
| 442 | + DMI_MATCH(DMI_PRODUCT_NAME, "T200TA"), |
|---|
| 443 | + }, |
|---|
| 444 | + .driver_data = &quirk_asus_use_kbd_dock_devid, |
|---|
| 445 | + }, |
|---|
| 418 | 446 | {}, |
|---|
| 419 | 447 | }; |
|---|
| 420 | 448 | |
|---|
| .. | .. |
|---|
| 450 | 478 | { KE_KEY, 0x30, { KEY_VOLUMEUP } }, |
|---|
| 451 | 479 | { KE_KEY, 0x31, { KEY_VOLUMEDOWN } }, |
|---|
| 452 | 480 | { KE_KEY, 0x32, { KEY_MUTE } }, |
|---|
| 481 | + { KE_KEY, 0x33, { KEY_SCREENLOCK } }, |
|---|
| 453 | 482 | { KE_KEY, 0x35, { KEY_SCREENLOCK } }, |
|---|
| 454 | 483 | { KE_KEY, 0x40, { KEY_PREVIOUSSONG } }, |
|---|
| 455 | 484 | { KE_KEY, 0x41, { KEY_NEXTSONG } }, |
|---|
| .. | .. |
|---|
| 475 | 504 | { KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */ |
|---|
| 476 | 505 | { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, |
|---|
| 477 | 506 | { KE_IGNORE, 0x6E, }, /* Low Battery notification */ |
|---|
| 507 | + { KE_KEY, 0x71, { KEY_F13 } }, /* General-purpose button */ |
|---|
| 508 | + { KE_IGNORE, 0x79, }, /* Charger type dectection notification */ |
|---|
| 478 | 509 | { KE_KEY, 0x7a, { KEY_ALS_TOGGLE } }, /* Ambient Light Sensor Toggle */ |
|---|
| 510 | + { KE_IGNORE, 0x7B, }, /* Charger connect/disconnect notification */ |
|---|
| 511 | + { KE_KEY, 0x7c, { KEY_MICMUTE } }, |
|---|
| 479 | 512 | { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */ |
|---|
| 480 | 513 | { KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */ |
|---|
| 481 | 514 | { KE_KEY, 0x82, { KEY_CAMERA } }, |
|---|
| .. | .. |
|---|
| 490 | 523 | { KE_KEY, 0x92, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + DVI */ |
|---|
| 491 | 524 | { KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI */ |
|---|
| 492 | 525 | { KE_KEY, 0x95, { KEY_MEDIA } }, |
|---|
| 493 | | - { KE_KEY, 0x99, { KEY_PHONE } }, |
|---|
| 526 | + { KE_KEY, 0x99, { KEY_PHONE } }, /* Conflicts with fan mode switch */ |
|---|
| 494 | 527 | { KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */ |
|---|
| 495 | 528 | { KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */ |
|---|
| 496 | 529 | { KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */ |
|---|
| .. | .. |
|---|
| 500 | 533 | { KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */ |
|---|
| 501 | 534 | { KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI */ |
|---|
| 502 | 535 | { KE_KEY, 0xB5, { KEY_CALC } }, |
|---|
| 536 | + { KE_IGNORE, 0xC0, }, /* External display connect/disconnect notification */ |
|---|
| 503 | 537 | { KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, |
|---|
| 504 | 538 | { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, |
|---|
| 505 | 539 | { KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */ |
|---|
| .. | .. |
|---|
| 517 | 551 | .detect_quirks = asus_nb_wmi_quirks, |
|---|
| 518 | 552 | }; |
|---|
| 519 | 553 | |
|---|
| 520 | | -static const struct dmi_system_id asus_nb_wmi_blacklist[] __initconst = { |
|---|
| 521 | | - { |
|---|
| 522 | | - /* |
|---|
| 523 | | - * asus-nb-wm adds no functionality. The T100TA has a detachable |
|---|
| 524 | | - * USB kbd, so no hotkeys and it has no WMI rfkill; and loading |
|---|
| 525 | | - * asus-nb-wm causes the camera LED to turn and _stay_ on. |
|---|
| 526 | | - */ |
|---|
| 527 | | - .matches = { |
|---|
| 528 | | - DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
|---|
| 529 | | - DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"), |
|---|
| 530 | | - }, |
|---|
| 531 | | - }, |
|---|
| 532 | | - { |
|---|
| 533 | | - /* The Asus T200TA has the same issue as the T100TA */ |
|---|
| 534 | | - .matches = { |
|---|
| 535 | | - DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
|---|
| 536 | | - DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T200TA"), |
|---|
| 537 | | - }, |
|---|
| 538 | | - }, |
|---|
| 539 | | - {} /* Terminating entry */ |
|---|
| 540 | | -}; |
|---|
| 541 | 554 | |
|---|
| 542 | 555 | static int __init asus_nb_wmi_init(void) |
|---|
| 543 | 556 | { |
|---|
| 544 | | - if (dmi_check_system(asus_nb_wmi_blacklist)) |
|---|
| 545 | | - return -ENODEV; |
|---|
| 546 | | - |
|---|
| 547 | 557 | return asus_wmi_register_driver(&asus_nb_wmi_driver); |
|---|
| 548 | 558 | } |
|---|
| 549 | 559 | |
|---|