cros: platform/chrome: Add cros-ec-uart driver for uart support
Bhanu Prakash Maiya
maintainerPATCH 1/2 cros: platform/chrome: Add cros-ec-uart driver for uart support
From: Bhanu Prakash Maiya <[email protected]>
This patch enables uart transport layer for cros_ec framework. The cros-ec-uart binds with EC device working on uart transport to send request and receive response.
Signed-off-by Bhanu Prakash Maiya <[email protected]>
Reported-by kernel test robot <[email protected]>
Change-Id Icb23b633700f1ef4d123e3f21fd26fad21a3f207
---
Changes in v2:
1: Fixed build error on v1.
2: Changed EC timeout for response packet to 3 Sec and added comments. 3: Fixed cros_ec_uart_rx_bytes function to handle rx buffer < size of response header.
MAINTAINERS | 1 + drivers/platform/chrome/Kconfig | 10 + drivers/platform/chrome/Makefile | 1 + drivers/platform/chrome/cros_ec_uart.c | 411 +++++++++++++++++++++++++ 4 files changed, 423 insertions(+) create mode 100644 drivers/platform/chrome/cros_ec_uart.c
MAINTAINERS +1 -0
@@ -4036,6 +4036,7 @@ F: sound/soc/codecs/cros_ec_codec.* CHROMEOS EC SUBDRIVERS M: Benson Leung <[email protected]> M: Enric Balletbo i Serra <[email protected]> +M: Bhanu Prakash Maiya <[email protected]> R: Guenter Roeck <[email protected]> S: Maintained F: drivers/power/supply/cros_usbpd-charger.c
drivers/platform/chrome/Kconfig +10 -0
@@ -125,6 +125,16 @@ config CROS_EC_SPI response time cannot be guaranteed, we support ignoring 'pre-amble' bytes before the response actually starts. +config CROS_EC_UART + tristate "ChromeOS Embedded Controller (UART)" + depends on CROS_EC && ACPI && SERIAL_DEV_BUS + help + If you say Y here, you get support for talking to the ChromeOS EC + through a UART, using a byte-level protocol. + + To compile this driver as a module, choose M here: the + module will be called cros_ec_uart. + config CROS_EC_LPC tristate "ChromeOS Embedded Controller (LPC)" depends on CROS_EC && ACPI && (X86 || COMPILE_TEST)
drivers/platform/chrome/Makefile +1 -0
@@ -12,6 +12,7 @@ obj-$(CONFIG_CROS_EC_I2C) += cros_ec_i2c.o obj-$(CONFIG_CROS_EC_ISHTP) += cros_ec_ishtp.o obj-$(CONFIG_CROS_EC_RPMSG) += cros_ec_rpmsg.o obj-$(CONFIG_CROS_EC_SPI) += cros_ec_spi.o +obj-$(CONFIG_CROS_EC_UART) += cros_ec_uart.o cros_ec_lpcs-objs := cros_ec_lpc.o cros_ec_lpc_mec.o obj-$(CONFIG_CROS_EC_TYPEC) += cros_ec_typec.o obj-$(CONFIG_CROS_EC_LPC) += cros_ec_lpcs.o
drivers/platform/chrome/cros_ec_uart.c new file +411 -0
411 lines not on this page · raw message
Signature · 1 line
2.26.2