]> git.baikalelectronics.ru Git - kernel.git/commit
platform/chrome: wilco_ec: Add support for raw commands in debugfs
authorNick Crews <ncrews@chromium.org>
Sat, 9 Feb 2019 00:37:18 +0000 (17:37 -0700)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>
Thu, 21 Feb 2019 20:36:21 +0000 (21:36 +0100)
commitcde5947e286a0728b84674556bbbf74a56beaf5a
tree3c8d4173614ddfddbbe4ea0d6904c974a7c5a704
parent547ce25714ed4ef9445f7eb7e23b54e9b90de445
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>
Documentation/ABI/testing/debugfs-wilco-ec [new file with mode: 0644]
drivers/platform/chrome/wilco_ec/Kconfig
drivers/platform/chrome/wilco_ec/Makefile
drivers/platform/chrome/wilco_ec/core.c
drivers/platform/chrome/wilco_ec/debugfs.c [new file with mode: 0644]
include/linux/platform_data/wilco-ec.h