diff options
| author | Nick Crews <ncrews@chromium.org> | 2019-02-08 19:37:18 -0500 |
|---|---|---|
| committer | Enric Balletbo i Serra <enric.balletbo@collabora.com> | 2019-02-21 15:36:21 -0500 |
| commit | b787bb126cbcd73754bcbc055ae9f804ac576e4a (patch) | |
| tree | 3c8d4173614ddfddbbe4ea0d6904c974a7c5a704 /include/linux/platform_data | |
| parent | 7b3d4f44abf0e7a1ba762c8a9c99a8b39ee0c8b1 (diff) | |
platform/chrome: wilco_ec: Add support for raw commands in debugfs
Add a debugfs attribute that allows sending raw commands to the EC.
This is useful for development and debug but should not be enabled
in a production environment.
To test:
Get the EC firmware build date
First send the request command
> echo 00 f0 38 00 03 00 > raw
Then read the result. "12/21/18" is in the middle of the response
> cat raw
00 31 32 2f 32 31 2f 31 38 00 00 0f 01 00 01 00 .12/21/18.......
Get the EC firmware build date
First send the request command
> echo 00 f0 38 00 03 00 > raw
Then read the result. "12/21/18" is in the middle of the response
> cat raw
00 31 32 2f 32 31 2f 31 38 00 00 0f 01 00 01 00 .12/21/18.......
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Signed-off-by: Nick Crews <ncrews@chromium.org>
[Fix off-by-one error in wilco_ec/debugfs.c]
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Diffstat (limited to 'include/linux/platform_data')
| -rw-r--r-- | include/linux/platform_data/wilco-ec.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/platform_data/wilco-ec.h b/include/linux/platform_data/wilco-ec.h index 0feb4b520a54..5344975afa1a 100644 --- a/include/linux/platform_data/wilco-ec.h +++ b/include/linux/platform_data/wilco-ec.h | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | * @data_buffer: Buffer used for EC communication. The same buffer | 34 | * @data_buffer: Buffer used for EC communication. The same buffer |
| 35 | * is used to hold the request and the response. | 35 | * is used to hold the request and the response. |
| 36 | * @data_size: Size of the data buffer used for EC communication. | 36 | * @data_size: Size of the data buffer used for EC communication. |
| 37 | * @debugfs_pdev: The child platform_device used by the debugfs sub-driver. | ||
| 37 | */ | 38 | */ |
| 38 | struct wilco_ec_device { | 39 | struct wilco_ec_device { |
| 39 | struct device *dev; | 40 | struct device *dev; |
| @@ -43,6 +44,7 @@ struct wilco_ec_device { | |||
| 43 | struct resource *io_packet; | 44 | struct resource *io_packet; |
| 44 | void *data_buffer; | 45 | void *data_buffer; |
| 45 | size_t data_size; | 46 | size_t data_size; |
| 47 | struct platform_device *debugfs_pdev; | ||
| 46 | }; | 48 | }; |
| 47 | 49 | ||
| 48 | /** | 50 | /** |
