Commit a1ec56ed9f42fb5374cd2add373811c9527c0995

Authored by Maxim Mikityanskiy
Committed by Matthew Garrett
1 parent 8b10acd74c

Add support for fan button on Ideapad Z580

The patch adds support for fan control button on Ideapad Z580. This is
the same button as on Z570, but it raises different bit in
VPCCMD_R_SPECIAL_BUTTONS. Also add message to dmesg when unknown button
press detected, it will help adding support for new special buttons.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Tested-by: Ivan Vojtko <nekroman.sk@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>

Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff

drivers/platform/x86/ideapad-laptop.c
... ... @@ -640,13 +640,17 @@
640 640 for (bit = 0; bit < 16; bit++) {
641 641 if (test_bit(bit, &value)) {
642 642 switch (bit) {
643   - case 6:
  643 + case 0: /* Z580 */
  644 + case 6: /* Z570 */
644 645 /* Thermal Management button */
645 646 ideapad_input_report(priv, 65);
646 647 break;
647 648 case 1:
648 649 /* OneKey Theater button */
649 650 ideapad_input_report(priv, 64);
  651 + break;
  652 + default:
  653 + pr_info("Unknown special button: %lu\n", bit);
650 654 break;
651 655 }
652 656 }