Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: dts: stm32: add STUSB1600 Type-C using I2C4 on stm32mp15xx-dkx

This patch adds support for STUSB1600 USB Type-C port controller, used on
I2C4 on stm32mp15xx-dkx.
The default configuration on this board, on Type-C connector, is:
- Dual Power Role (DRP), so set power-role to "dual";
- Vbus limited to 500mA, so set typec-power-opmode to "default" (it means
500mA in USB 2.0).
typec-power-opmode is used to reconfigure the STUSB1600 advertising of
current capability when its NVM is not in line with the board layout.
On stm32mp15xx-dkx, Vbus power source of STUSB1600 is 5V_VIN. So power
operation mode depends on the power supply used. To avoid any power
issues, it is better to limit Vbus to 500mA on this board.
ALERT# is the interrupt pin of STUSB1600. It needs an external pull-up, and
signal is active low.

USB OTG controller ID and Vbus signals are not connected on stm32mp15xx-dkx
boards, so disconnection are not detected.
Without DWC2 usb-role-switch:
- if you unplug the USB cable from the Type-C port, you have to manually
disconnect the USB gadget:
echo disconnect > /sys/devices/platform/soc/49000000.usb-otg/udc/49000000.usb-otg/soft_connect
- Then you can plug the USB cable again in the Type-C port, and manually
reconnect the USB gadget:
echo connect > /sys/devices/platform/soc/49000000.usb-otg/udc/49000000.usb-otg/soft_connect
With DWC2 usb-role-switch, USB gadget is dynamically disconnected or connected.

Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>

authored by

Amelie Delaunay and committed by
Alexandre Torgue
83686162 70966729

+37
+7
arch/arm/boot/dts/stm32mp15-pinctrl.dtsi
··· 1660 1660 }; 1661 1661 }; 1662 1662 1663 + stusb1600_pins_a: stusb1600-0 { 1664 + pins { 1665 + pinmux = <STM32_PINMUX('I', 11, ANALOG)>; 1666 + bias-pull-up; 1667 + }; 1668 + }; 1669 + 1663 1670 uart4_pins_a: uart4-0 { 1664 1671 pins1 { 1665 1672 pinmux = <STM32_PINMUX('G', 11, AF6)>; /* UART4_TX */
+30
arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
··· 246 246 /delete-property/dmas; 247 247 /delete-property/dma-names; 248 248 249 + stusb1600@28 { 250 + compatible = "st,stusb1600"; 251 + reg = <0x28>; 252 + interrupts = <11 IRQ_TYPE_EDGE_FALLING>; 253 + interrupt-parent = <&gpioi>; 254 + pinctrl-names = "default"; 255 + pinctrl-0 = <&stusb1600_pins_a>; 256 + status = "okay"; 257 + vdd-supply = <&vin>; 258 + 259 + connector { 260 + compatible = "usb-c-connector"; 261 + label = "USB-C"; 262 + power-role = "dual"; 263 + typec-power-opmode = "default"; 264 + 265 + port { 266 + con_usbotg_hs_ep: endpoint { 267 + remote-endpoint = <&usbotg_hs_ep>; 268 + }; 269 + }; 270 + }; 271 + }; 272 + 249 273 pmic: stpmic@33 { 250 274 compatible = "st,stpmic1"; 251 275 reg = <0x33>; ··· 680 656 phy-names = "usb2-phy"; 681 657 usb-role-switch; 682 658 status = "okay"; 659 + 660 + port { 661 + usbotg_hs_ep: endpoint { 662 + remote-endpoint = <&con_usbotg_hs_ep>; 663 + }; 664 + }; 683 665 }; 684 666 685 667 &usbphyc {