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

dt-bindings: usb: typec: add bindings for stm32g0 controller

Add DT schema documentation for the STM32G0 Type-C PD (Power Delivery)
controller.
STM32G0 provides an integrated USB Type-C and power delivery interface.
It can be programmed with a firmware to handle UCSI protocol over I2C
interface. A GPIO is used as an interrupt line.
It may be used as a wakeup source, so use optional "wakeup-source" and
"power-domains" properties to support wakeup.
The firmware itself may be flashed or later updated (optional). Choice is
let to the application to allow firmware update. A default firmware could
be already programmed in production and be customized (to not allow it).
So the firmware-name is made optional to represent this option.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20220713120842.560902-2-fabrice.gasnier@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Fabrice Gasnier and committed by
Greg Kroah-Hartman
b60fd936 a7dc438b

+91
+91
Documentation/devicetree/bindings/usb/st,typec-stm32g0.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/usb/st,typec-stm32g0.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: STMicroelectronics STM32G0 USB Type-C PD controller 8 + 9 + description: | 10 + The STM32G0 MCU can be programmed to control Type-C connector(s) through I2C 11 + typically using the UCSI protocol over I2C, with a dedicated alert 12 + (interrupt) pin. 13 + 14 + maintainers: 15 + - Fabrice Gasnier <fabrice.gasnier@foss.st.com> 16 + 17 + properties: 18 + compatible: 19 + const: st,stm32g0-typec 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + interrupts: 25 + maxItems: 1 26 + 27 + connector: 28 + type: object 29 + $ref: /schemas/connector/usb-connector.yaml# 30 + unevaluatedProperties: false 31 + 32 + firmware-name: 33 + description: | 34 + Should contain the name of the default firmware image 35 + file located on the firmware search path 36 + 37 + wakeup-source: true 38 + 39 + power-domains: 40 + maxItems: 1 41 + 42 + required: 43 + - compatible 44 + - reg 45 + - interrupts 46 + - connector 47 + 48 + additionalProperties: false 49 + 50 + examples: 51 + - | 52 + #include <dt-bindings/interrupt-controller/irq.h> 53 + i2c { 54 + #address-cells = <1>; 55 + #size-cells = <0>; 56 + 57 + typec@53 { 58 + compatible = "st,stm32g0-typec"; 59 + reg = <0x53>; 60 + /* Alert pin on GPIO PE12 */ 61 + interrupts = <12 IRQ_TYPE_EDGE_FALLING>; 62 + interrupt-parent = <&gpioe>; 63 + 64 + /* Example with one type-C connector */ 65 + connector { 66 + compatible = "usb-c-connector"; 67 + label = "USB-C"; 68 + 69 + ports { 70 + #address-cells = <1>; 71 + #size-cells = <0>; 72 + port@0 { 73 + reg = <0>; 74 + con_usb_c_ep: endpoint { 75 + remote-endpoint = <&usb_ep>; 76 + }; 77 + }; 78 + }; 79 + }; 80 + }; 81 + }; 82 + 83 + usb { 84 + usb-role-switch; 85 + port { 86 + usb_ep: endpoint { 87 + remote-endpoint = <&con_usb_c_ep>; 88 + }; 89 + }; 90 + }; 91 + ...