diff options
| -rw-r--r-- | drivers/platform/x86/eeepc-laptop.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 19cc9ae7db5a..f5d8473ea66f 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c | |||
| @@ -553,6 +553,28 @@ static int eeepc_setkeycode(struct input_dev *dev, int scancode, int keycode) | |||
| 553 | return -EINVAL; | 553 | return -EINVAL; |
| 554 | } | 554 | } |
| 555 | 555 | ||
| 556 | static void cmsg_quirk(int cm, const char *name) | ||
| 557 | { | ||
| 558 | int dummy; | ||
| 559 | |||
| 560 | /* Some BIOSes do not report cm although it is avaliable. | ||
| 561 | Check if cm_getv[cm] works and, if yes, assume cm should be set. */ | ||
| 562 | if (!(ehotk->cm_supported & (1 << cm)) | ||
| 563 | && !read_acpi_int(ehotk->handle, cm_getv[cm], &dummy)) { | ||
| 564 | pr_info("%s (%x) not reported by BIOS," | ||
| 565 | " enabling anyway\n", name, 1 << cm); | ||
| 566 | ehotk->cm_supported |= 1 << cm; | ||
| 567 | } | ||
| 568 | } | ||
| 569 | |||
| 570 | static void cmsg_quirks(void) | ||
| 571 | { | ||
| 572 | cmsg_quirk(CM_ASL_LID, "LID"); | ||
| 573 | cmsg_quirk(CM_ASL_TYPE, "TYPE"); | ||
| 574 | cmsg_quirk(CM_ASL_PANELPOWER, "PANELPOWER"); | ||
| 575 | cmsg_quirk(CM_ASL_TPD, "TPD"); | ||
| 576 | } | ||
| 577 | |||
| 556 | static int eeepc_hotk_check(void) | 578 | static int eeepc_hotk_check(void) |
| 557 | { | 579 | { |
| 558 | const struct key_entry *key; | 580 | const struct key_entry *key; |
| @@ -576,6 +598,7 @@ static int eeepc_hotk_check(void) | |||
| 576 | pr_err("Get control methods supported failed\n"); | 598 | pr_err("Get control methods supported failed\n"); |
| 577 | return -ENODEV; | 599 | return -ENODEV; |
| 578 | } else { | 600 | } else { |
| 601 | cmsg_quirks(); | ||
| 579 | pr_info("Get control methods supported: 0x%x\n", | 602 | pr_info("Get control methods supported: 0x%x\n", |
| 580 | ehotk->cm_supported); | 603 | ehotk->cm_supported); |
| 581 | } | 604 | } |
