Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Hung-ying Tyan | 8836438 | 2013-05-15 18:27:28 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Chromium OS Matrix Keyboard Message Protocol definitions |
| 4 | * |
| 5 | * Copyright (c) 2012 The Chromium OS Authors. |
Hung-ying Tyan | 8836438 | 2013-05-15 18:27:28 +0800 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef _CROS_MESSAGE_H |
| 9 | #define _CROS_MESSAGE_H |
| 10 | |
| 11 | /* |
| 12 | * Command interface between EC and AP, for LPC, I2C and SPI interfaces. |
| 13 | * |
| 14 | * This is copied from the Chromium OS Open Source Embedded Controller code. |
| 15 | */ |
| 16 | enum { |
| 17 | /* The header byte, which follows the preamble */ |
| 18 | MSG_HEADER = 0xec, |
| 19 | |
| 20 | MSG_HEADER_BYTES = 3, |
| 21 | MSG_TRAILER_BYTES = 2, |
| 22 | MSG_PROTO_BYTES = MSG_HEADER_BYTES + MSG_TRAILER_BYTES, |
| 23 | |
| 24 | /* Max length of messages */ |
Simon Glass | 836bb6e | 2014-02-27 13:26:07 -0700 | [diff] [blame] | 25 | MSG_BYTES = EC_PROTO2_MAX_PARAM_SIZE + MSG_PROTO_BYTES, |
Hung-ying Tyan | 8836438 | 2013-05-15 18:27:28 +0800 | [diff] [blame] | 26 | }; |
| 27 | |
| 28 | #endif |