Commit a1ec56ed authored by Maxim Mikityanskiy's avatar Maxim Mikityanskiy Committed by Matthew Garrett

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: default avatarMaxim Mikityanskiy <maxtram95@gmail.com>
Tested-by: default avatarIvan Vojtko <nekroman.sk@gmail.com>
Signed-off-by: default avatarMatthew Garrett <matthew.garrett@nebula.com>
parent 8b10acd7
...@@ -640,7 +640,8 @@ static void ideapad_check_special_buttons(struct ideapad_private *priv) ...@@ -640,7 +640,8 @@ static void ideapad_check_special_buttons(struct ideapad_private *priv)
for (bit = 0; bit < 16; bit++) { for (bit = 0; bit < 16; bit++) {
if (test_bit(bit, &value)) { if (test_bit(bit, &value)) {
switch (bit) { switch (bit) {
case 6: case 0: /* Z580 */
case 6: /* Z570 */
/* Thermal Management button */ /* Thermal Management button */
ideapad_input_report(priv, 65); ideapad_input_report(priv, 65);
break; break;
...@@ -648,6 +649,9 @@ static void ideapad_check_special_buttons(struct ideapad_private *priv) ...@@ -648,6 +649,9 @@ static void ideapad_check_special_buttons(struct ideapad_private *priv)
/* OneKey Theater button */ /* OneKey Theater button */
ideapad_input_report(priv, 64); ideapad_input_report(priv, 64);
break; break;
default:
pr_info("Unknown special button: %lu\n", bit);
break;
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment