Commit da0cb631 authored by Amelie Delaunay's avatar Amelie Delaunay Committed by Greg Kroah-Hartman

usb: typec: add support for STUSB160x Type-C controller family

STMicroelectronics USB Type-C port controllers use I2C interface to
configure, control and read the operation status of the device. All ST USB
Type-C port controllers are based on the same I2C register map. That's why
this driver can be used with all ST USB Type-C ICs.
Some ST USB Type-C port controllers are Dual Role Port (DRP), only Sink or
Source, some supports USB Power Delivery. This can be configured through
connector device tree bindings.

This driver is a basic Type-C port controller driver, with no power
delivery support. It allows to configure ST USB Type-C port controller.
Interrupt is supported and enables CC connection events, to detect
attach and detach and update Type-C subsystem accordingly as well as usb
role switch.

ST USB Type-C port controller can be supplied in three different ways
depending on the target application:
- through VDD pin only (so VDD is the main supply)
- through VSYS pin only (so VSYS is the main supply)
- through VDD and VSYS pins.
When both VDD and VSYS power supplies are present, the low power supply
VSYS is selected as main supply when VSYS voltage is above 3.1V, else
VDD is selected as main supply.

In case of Source or Dual port type, if VDD supply is present, it has to be
enabled in case of Source power role to provide Vbus. When interrupt
support is available, VDD supply is dynamically managed upon attach/detach
interrupt. When there is no interrupt support, VDD supply is enabled by
default.
Acked-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: default avatarAmelie Delaunay <amelie.delaunay@st.com>
Link: https://lore.kernel.org/r/20200924090049.9041-5-amelie.delaunay@st.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 12f3467b
......@@ -73,6 +73,18 @@ config TYPEC_TPS6598X
If you choose to build this driver as a dynamically linked module, the
module will be called tps6598x.ko.
config TYPEC_STUSB160X
tristate "STMicroelectronics STUSB160x Type-C controller driver"
depends on I2C
depends on REGMAP_I2C
depends on USB_ROLE_SWITCH || !USB_ROLE_SWITCH
help
Say Y or M here if your system has STMicroelectronics STUSB160x
Type-C port controller.
If you choose to build this driver as a dynamically linked module, the
module will be called stusb160x.ko.
source "drivers/usb/typec/mux/Kconfig"
source "drivers/usb/typec/altmodes/Kconfig"
......
......@@ -6,4 +6,5 @@ obj-$(CONFIG_TYPEC_TCPM) += tcpm/
obj-$(CONFIG_TYPEC_UCSI) += ucsi/
obj-$(CONFIG_TYPEC_HD3SS3220) += hd3ss3220.o
obj-$(CONFIG_TYPEC_TPS6598X) += tps6598x.o
obj-$(CONFIG_TYPEC_STUSB160X) += stusb160x.o
obj-$(CONFIG_TYPEC) += mux/
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment