usb: typec: Add support for UCSI interface
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Fri, 16 Jun 2017 08:21:24 +0000 (11:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Jun 2017 15:55:45 +0000 (17:55 +0200)
commitc1b0bc2dabfa884dea49c02adaf3cd6b52b33d2f
tree863838be8553ee06e508c1ccdd0d9367e35bc89c
parentc68bb0ef177bbcaba505ed492101095c613dafa6
usb: typec: Add support for UCSI interface

UCSI - USB Type-C Connector System Software Interface - is a
specification that defines set of registers and data
structures for controlling the USB Type-C ports. It's
designed for systems where an embedded controller (EC) is in
charge of the USB Type-C PHY or USB Power Delivery
controller. It is designed for systems with EC, but it is
not limited to them, and for example some USB Power Delivery
controllers will use it as their direct control interface.

With UCSI the EC (or USB PD controller) acts as the port
manager, implementing all USB Type-C and Power Delivery state
machines. The OS can use the interfaces for reading the
status of the ports and controlling basic operations like
role swapping.

The UCSI specification highlights the fact that it does not
define the interface method (PCI/I2C/ACPI/etc.).
Therefore the driver is implemented as library and every
supported interface method needs its own driver. Driver for
ACPI is provided in separate patch following this one.

The initial driver includes support for all required
features from UCSI specification version 1.0 (getting
connector capabilities and status, and support for power and
data role swapping), but none of the optional UCSI features
(alternate modes, power source capabilities, and cable
capabilities).

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/Kconfig
drivers/usb/typec/Makefile
drivers/usb/typec/ucsi/Kconfig [new file with mode: 0644]
drivers/usb/typec/ucsi/Makefile [new file with mode: 0644]
drivers/usb/typec/ucsi/debug.h [new file with mode: 0644]
drivers/usb/typec/ucsi/trace.c [new file with mode: 0644]
drivers/usb/typec/ucsi/trace.h [new file with mode: 0644]
drivers/usb/typec/ucsi/ucsi.c [new file with mode: 0644]
drivers/usb/typec/ucsi/ucsi.h [new file with mode: 0644]