diff options
author | Nick Crews <ncrews@chromium.org> | 2019-05-21 22:20:45 +0300 |
---|---|---|
committer | Enric Balletbo i Serra <enric.balletbo@collabora.com> | 2019-06-05 11:14:50 +0300 |
commit | 1210d1e6bad1e7ccccb19627b880a50d7c15dd51 (patch) | |
tree | 6bfb3e3ad96eaee3dee3cbb0f0cf7ad46baa4128 /include/linux/platform_data | |
parent | f7b0bc5eafa44941ddf92df6f46dd82cbfacec3e (diff) | |
download | linux-1210d1e6bad1e7ccccb19627b880a50d7c15dd51.tar.xz |
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 '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 e3ce9ce49b11..ad03b586a095 100644 --- a/include/linux/platform_data/wilco-ec.h +++ b/include/linux/platform_data/wilco-ec.h @@ -29,6 +29,7 @@ * @data_size: Size of the data buffer used for EC communication. * @debugfs_pdev: The child platform_device used by the debugfs sub-driver. * @rtc_pdev: The child platform_device used by the RTC sub-driver. + * @telem_pdev: The child platform_device used by the telemetry sub-driver. */ struct wilco_ec_device { struct device *dev; @@ -40,6 +41,7 @@ struct wilco_ec_device { size_t data_size; struct platform_device *debugfs_pdev; struct platform_device *rtc_pdev; + struct platform_device *telem_pdev; }; /** |