summaryrefslogtreecommitdiffstats
path: root/drivers/platform/chrome/wilco_ec/debugfs.c
diff options
context:
space:
mode:
authorNick Crews <ncrews@chromium.org>2019-05-21 13:20:45 -0600
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>2019-06-05 10:14:50 +0200
commit1210d1e6bad1e7ccccb19627b880a50d7c15dd51 (patch)
tree6bfb3e3ad96eaee3dee3cbb0f0cf7ad46baa4128 /drivers/platform/chrome/wilco_ec/debugfs.c
parentf7b0bc5eafa44941ddf92df6f46dd82cbfacec3e (diff)
downloadlinux-stable-1210d1e6bad1e7ccccb19627b880a50d7c15dd51.tar.gz
linux-stable-1210d1e6bad1e7ccccb19627b880a50d7c15dd51.tar.bz2
linux-stable-1210d1e6bad1e7ccccb19627b880a50d7c15dd51.zip
platform/chrome: wilco_ec: Add telemetry char device interface
The Wilco Embedded Controller is able to send telemetry data which is useful for enterprise applications. A daemon running on the OS sends a command to the EC via a write() to a char device, and can read the response with a read(). The write() request is verified by the driver to ensure that it is performing only one of the whitelisted commands, and that no extraneous data is being transmitted to the EC. The response is passed directly back to the reader with no modification. The character device will appear as /dev/wilco_telemN, where N is some small non-negative integer, starting with 0. Only one process may have the file descriptor open at a time. The calling userspace program needs to keep the device file descriptor open between the calls to write() and read() in order to preserve the response. Up to 32 bytes will be available for reading. For testing purposes, try requesting the EC's firmware build date, by sending the WILCO_EC_TELEM_GET_VERSION command with argument index=3. i.e. write [0x38, 0x00, 0x03] to the device node. An ASCII string of the build date is returned. Signed-off-by: Nick Crews <ncrews@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Diffstat (limited to 'drivers/platform/chrome/wilco_ec/debugfs.c')
-rw-r--r--drivers/platform/chrome/wilco_ec/debugfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/chrome/wilco_ec/debugfs.c b/drivers/platform/chrome/wilco_ec/debugfs.c
index 281ec595e8e0..8d65a1e2f1a3 100644
--- a/drivers/platform/chrome/wilco_ec/debugfs.c
+++ b/drivers/platform/chrome/wilco_ec/debugfs.c
@@ -16,7 +16,7 @@
#define DRV_NAME "wilco-ec-debugfs"
-/* The 256 raw bytes will take up more space when represented as a hex string */
+/* The raw bytes will take up more space when represented as a hex string */
#define FORMATTED_BUFFER_SIZE (EC_MAILBOX_DATA_SIZE * 4)
struct wilco_ec_debugfs {