Skip to content

Commit

Permalink
usb: typec: add support for STUSB160x Type-C controller family
Browse files Browse the repository at this point in the history
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: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
Link: https://lore.kernel.org/r/20200924090049.9041-5-amelie.delaunay@st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
ADESTM authored and gregkh committed Oct 2, 2020
1 parent 12f3467 commit da0cb63
Show file tree
Hide file tree
Showing 3 changed files with 888 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/usb/typec/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/typec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/

0 comments on commit da0cb63

Please sign in to comment.