platform/chrome: Add ChromeOS EC USB driver
Subsystems (2)
PATCH v4 1/1 platform/chrome: Add ChromeOS EC USB driver
Use USB to talk to the ChromeOS EC. The protocol is defined by the EC and is fairly simple, with a length byte, checksum, command byte and version byte in the header.
Use vendor defined usb interface with in/out endpoints to transfer requests and responses. Also use one interrupt in endpoint which signals readiness of response and pending events on the EC side.
Signed-off-by Dawid Niedzwiecki <[email protected]>
---
V3 -> V4:
- Use the GFP_ATOMIC memory flag when submitting URB inside interrupt
drivers/platform/chrome/Kconfig | 11 + drivers/platform/chrome/Makefile | 1 + drivers/platform/chrome/cros_ec_usb.c | 586 ++++++++++++++++++++++++++ 3 files changed, 598 insertions(+) create mode 100644 drivers/platform/chrome/cros_ec_usb.c
drivers/platform/chrome/Kconfig +11 -0
@@ -316,6 +316,17 @@ config CROS_TYPEC_SWITCH To compile this driver as a module, choose M here: the module will be called cros_typec_switch. +config CROS_EC_USB + tristate "ChromeOS Embedded Controller (USB)" + depends on CROS_EC && USB + help + If you say Y here, you get support for talking to the ChromeOS EC + through a USB. The driver uses vendor defined interface and is capable + of signaling events from EC. + + To compile this driver as a module, choose M here: the + module will be called cros_ec_usb. + source "drivers/platform/chrome/wilco_ec/Kconfig" # Kunit test cases
drivers/platform/chrome/Makefile +1 -0
@@ -38,6 +38,7 @@ obj-$(CONFIG_CROS_EC_SYSFS) += cros_ec_sysfs.o obj-$(CONFIG_CROS_HPS_I2C) += cros_hps_i2c.o obj-$(CONFIG_CROS_USBPD_LOGGER) += cros_usbpd_logger.o obj-$(CONFIG_CROS_USBPD_NOTIFY) += cros_usbpd_notify.o +obj-$(CONFIG_CROS_EC_USB) += cros_ec_usb.o obj-$(CONFIG_WILCO_EC) += wilco_ec/
drivers/platform/chrome/cros_ec_usb.c new file +586 -0
586 lines not on this page · raw message
Signature · 1 line
2.51.0.384.g4c02a37b29-goog