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>
This commit is contained in:

committed by
Enric Balletbo i Serra

parent
7b3d4f44ab
commit
b787bb126c
@@ -34,6 +34,7 @@
|
||||
* @data_buffer: Buffer used for EC communication. The same buffer
|
||||
* is used to hold the request and the response.
|
||||
* @data_size: Size of the data buffer used for EC communication.
|
||||
* @debugfs_pdev: The child platform_device used by the debugfs sub-driver.
|
||||
*/
|
||||
struct wilco_ec_device {
|
||||
struct device *dev;
|
||||
@@ -43,6 +44,7 @@ struct wilco_ec_device {
|
||||
struct resource *io_packet;
|
||||
void *data_buffer;
|
||||
size_t data_size;
|
||||
struct platform_device *debugfs_pdev;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user