1
0
mirror of https://xff.cz/git/u-boot/ synced 2026-02-02 15:47:56 +01:00
Files
u-boot-megous/include
Alper Nebi Yasak 6900797678 cros_ec: Support keyboard scanning with EC_CMD_GET_NEXT_EVENT
The cros_ec_keyb driver currently uses EC_CMD_MKBP_STATE to scan the
keyboard, but this host command was superseded by EC_CMD_GET_NEXT_EVENT
and unavailable on more recent devices (including gru-kevin), as it was
removed in cros-ec commit 87a071941b89 ("mkbp: Add support for buttons
and switches.") dated 2016-07-06.

The EC_CMD_GET_NEXT_EVENT has been available since cros-ec commit
d1ed75815efe ("MKBP event signalling implementation") dated 2014-10-20,
but it looks like it isn't included in firmware-* branches for at least
link, nyan-big, samus, snow, spring, panther and peach-pit which have
defconfigs in U-Boot. So this patch falls back to the old method if the
EC doesn't recognize the newer command.

The implementation is mostly adapted from Depthcharge commit
f88af26b44fc ("cros_ec: Change keyboard scanning method.").

On a gru-kevin, the current driver before this patch fails to read the
pressed keys with:

    out: cmd=0x60: 03 9d 60 00 00 00 00 00
    in-header: 03 fc 01 00 00 00 00 00
    in-data:
    ec_command_inptr: len=-1, din=0000000000000000
    check_for_keys: keyboard scan failed

However the keyboard works fine with the newer command:

    out: cmd=0x67: 03 96 67 00 00 00 00 00
    in-header: 03 ef 00 00 0e 00 00 00
    in-data: 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ec_command_inptr: len=14, din=00000000f412df30
    key_matrix_decode: num_keys = 0
      0 valid keycodes found
    out: cmd=0x67: 03 96 67 00 00 00 00 00
    in-header: 03 df 00 00 0e 00 00 00
    in-data: 00 00 00 00 00 00 00 00 00 00 00 00 10 00
    ec_command_inptr: len=14, din=00000000f412df30
    key_matrix_decode: num_keys = 1
      valid=1, row=4, col=11
        keycode=28
      1 valid keycodes found
     {0d}

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-11-05 09:11:31 -07:00
..
2019-12-06 16:44:20 -05:00
2019-10-16 05:42:27 +02:00
2020-09-30 16:55:03 -04:00
2020-10-23 16:38:33 -04:00
2020-10-22 09:54:53 -04:00
2020-05-11 10:16:49 +05:30
2020-04-17 12:32:36 -04:00
2020-10-06 09:07:54 -06:00
2020-07-09 12:33:24 +08:00
2020-05-18 17:33:33 -04:00
2020-07-28 19:30:39 -06:00
2020-02-05 19:33:46 -07:00
2020-10-30 14:20:27 +01:00
2019-04-23 20:26:43 -06:00
2020-02-05 19:33:46 -07:00
2019-10-13 23:34:43 +02:00
2020-05-07 09:01:42 -04:00
2020-08-03 22:19:54 -04:00
2020-09-06 21:21:41 +02:00
2020-05-18 21:19:23 -04:00
2020-05-18 17:33:33 -04:00
2020-08-07 22:31:32 -04:00
2020-10-14 14:00:44 +08:00
2020-10-30 10:56:11 -04:00
2020-05-18 17:33:33 -04:00
2020-06-12 13:14:07 -04:00
2019-02-20 15:27:09 +08:00
2018-06-13 07:49:12 -04:00
2018-12-06 23:26:32 -05:00
2019-02-09 12:50:22 -07:00
2019-10-14 09:31:41 +02:00
2020-01-20 15:38:16 +01:00
2018-12-05 06:01:35 -07:00
2019-11-07 18:39:16 -05:00
2018-04-06 17:04:33 -04:00
2020-05-18 18:36:55 -04:00
2019-08-11 16:43:41 -04:00
2020-04-17 12:32:36 -04:00
2020-08-04 23:30:02 -04:00
2020-10-30 10:58:07 -04:00
2019-12-02 18:23:11 -05:00
2020-10-27 08:13:33 +01:00
2020-01-25 12:04:36 -05:00
2018-10-09 04:40:27 -06:00
2020-05-18 17:33:33 -04:00
2020-07-17 10:47:19 -04:00
2020-10-23 16:52:09 +05:30
2019-05-20 13:50:34 +02:00
2020-06-14 21:07:20 +02:00
2020-09-30 11:55:23 -04:00
2020-02-05 19:33:46 -07:00
2020-06-14 21:07:20 +02:00
2020-07-09 06:02:44 +02:00
2020-09-30 11:55:23 -04:00
2020-05-18 17:33:31 -04:00
2018-07-19 16:31:37 -04:00
2020-02-05 19:33:46 -07:00
2020-08-03 22:19:54 -04:00
2020-08-03 22:19:54 -04:00
2019-02-01 16:59:12 +01:00
2020-08-11 20:34:46 +05:30
2020-08-07 22:31:32 -04:00
2019-05-21 17:33:23 -06:00
2020-08-23 13:43:10 -04:00
2020-10-22 09:54:53 -04:00
2018-07-20 15:55:05 -04:00
2018-10-09 04:40:27 -06:00
2020-08-03 22:19:54 -04:00
2020-01-21 15:56:15 +01:00
2020-04-24 16:40:09 -04:00
2018-09-28 18:26:32 +02:00
2020-08-03 22:19:54 -04:00
2020-08-03 22:19:54 -04:00