1cb7aa33aSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2cb7aa33aSEmmanuel Vadot%YAML 1.2 3cb7aa33aSEmmanuel Vadot--- 4fac71e4eSEmmanuel Vadot$id: http://devicetree.org/schemas/usb/gpio-sbu-mux.yaml# 5fac71e4eSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6cb7aa33aSEmmanuel Vadot 7cb7aa33aSEmmanuel Vadottitle: GPIO-based SBU mux 8cb7aa33aSEmmanuel Vadot 9cb7aa33aSEmmanuel Vadotmaintainers: 10cb7aa33aSEmmanuel Vadot - Bjorn Andersson <andersson@kernel.org> 11cb7aa33aSEmmanuel Vadot 12cb7aa33aSEmmanuel Vadotdescription: 13cb7aa33aSEmmanuel Vadot In USB Type-C applications the SBU lines needs to be connected, disconnected 14cb7aa33aSEmmanuel Vadot and swapped depending on the altmode and orientation. This binding describes 15cb7aa33aSEmmanuel Vadot a family of hardware solutions which switches between these modes using GPIO 16cb7aa33aSEmmanuel Vadot signals. 17cb7aa33aSEmmanuel Vadot 18cb7aa33aSEmmanuel Vadotproperties: 19cb7aa33aSEmmanuel Vadot compatible: 20cb7aa33aSEmmanuel Vadot items: 21cb7aa33aSEmmanuel Vadot - enum: 2284943d6fSEmmanuel Vadot - nxp,cbdtu02043 23cb7aa33aSEmmanuel Vadot - onnn,fsusb43l10x 24cb7aa33aSEmmanuel Vadot - pericom,pi3usb102 25*0e8011faSEmmanuel Vadot - ti,tmuxhs4212 26cb7aa33aSEmmanuel Vadot - const: gpio-sbu-mux 27cb7aa33aSEmmanuel Vadot 28cb7aa33aSEmmanuel Vadot enable-gpios: 29cb7aa33aSEmmanuel Vadot description: Switch enable GPIO 30cb7aa33aSEmmanuel Vadot 31cb7aa33aSEmmanuel Vadot select-gpios: 32cb7aa33aSEmmanuel Vadot description: Orientation select 33cb7aa33aSEmmanuel Vadot 34cb7aa33aSEmmanuel Vadot vcc-supply: 35cb7aa33aSEmmanuel Vadot description: power supply 36cb7aa33aSEmmanuel Vadot 3701950c46SEmmanuel Vadot mode-switch: true 3801950c46SEmmanuel Vadot orientation-switch: true 39cb7aa33aSEmmanuel Vadot 40cb7aa33aSEmmanuel Vadot port: 41cb7aa33aSEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/port 42cb7aa33aSEmmanuel Vadot description: 43cb7aa33aSEmmanuel Vadot A port node to link the SBU mux to a TypeC controller for the purpose of 44cb7aa33aSEmmanuel Vadot handling altmode muxing and orientation switching. 45cb7aa33aSEmmanuel Vadot 46cb7aa33aSEmmanuel Vadotrequired: 47cb7aa33aSEmmanuel Vadot - compatible 48cb7aa33aSEmmanuel Vadot - select-gpios 49cb7aa33aSEmmanuel Vadot - orientation-switch 50cb7aa33aSEmmanuel Vadot - port 51cb7aa33aSEmmanuel Vadot 5201950c46SEmmanuel VadotallOf: 5301950c46SEmmanuel Vadot - $ref: usb-switch.yaml# 54*0e8011faSEmmanuel Vadot - if: 55*0e8011faSEmmanuel Vadot required: 56*0e8011faSEmmanuel Vadot - mode-switch 57*0e8011faSEmmanuel Vadot then: 58*0e8011faSEmmanuel Vadot required: 59*0e8011faSEmmanuel Vadot - enable-gpios 6001950c46SEmmanuel Vadot 61cb7aa33aSEmmanuel VadotadditionalProperties: false 62cb7aa33aSEmmanuel Vadot 63cb7aa33aSEmmanuel Vadotexamples: 64cb7aa33aSEmmanuel Vadot - | 65cb7aa33aSEmmanuel Vadot #include <dt-bindings/gpio/gpio.h> 66cb7aa33aSEmmanuel Vadot 67cb7aa33aSEmmanuel Vadot tcpm { 68cb7aa33aSEmmanuel Vadot connector { 69cb7aa33aSEmmanuel Vadot compatible = "usb-c-connector"; 70cb7aa33aSEmmanuel Vadot 71cb7aa33aSEmmanuel Vadot ports { 72cb7aa33aSEmmanuel Vadot #address-cells = <1>; 73cb7aa33aSEmmanuel Vadot #size-cells = <0>; 74cb7aa33aSEmmanuel Vadot 75cb7aa33aSEmmanuel Vadot port@0 { 76cb7aa33aSEmmanuel Vadot reg = <0>; 77cb7aa33aSEmmanuel Vadot tcpm_hs_out: endpoint { 78cb7aa33aSEmmanuel Vadot remote-endpoint = <&usb_hs_phy_in>; 79cb7aa33aSEmmanuel Vadot }; 80cb7aa33aSEmmanuel Vadot }; 81cb7aa33aSEmmanuel Vadot 82cb7aa33aSEmmanuel Vadot port@1 { 83cb7aa33aSEmmanuel Vadot reg = <1>; 84cb7aa33aSEmmanuel Vadot tcpm_ss_out: endpoint { 85cb7aa33aSEmmanuel Vadot remote-endpoint = <&usb_ss_phy_in>; 86cb7aa33aSEmmanuel Vadot }; 87cb7aa33aSEmmanuel Vadot }; 88cb7aa33aSEmmanuel Vadot 89cb7aa33aSEmmanuel Vadot port@2 { 90cb7aa33aSEmmanuel Vadot reg = <2>; 91cb7aa33aSEmmanuel Vadot tcpm_sbu_out: endpoint { 92cb7aa33aSEmmanuel Vadot remote-endpoint = <&sbu_mux_in>; 93cb7aa33aSEmmanuel Vadot }; 94cb7aa33aSEmmanuel Vadot }; 95cb7aa33aSEmmanuel Vadot }; 96cb7aa33aSEmmanuel Vadot }; 97cb7aa33aSEmmanuel Vadot }; 98cb7aa33aSEmmanuel Vadot 99cb7aa33aSEmmanuel Vadot sbu-mux { 100cb7aa33aSEmmanuel Vadot compatible = "pericom,pi3usb102", "gpio-sbu-mux"; 101cb7aa33aSEmmanuel Vadot 102cb7aa33aSEmmanuel Vadot enable-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>; 103cb7aa33aSEmmanuel Vadot select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>; 104cb7aa33aSEmmanuel Vadot 105cb7aa33aSEmmanuel Vadot mode-switch; 106cb7aa33aSEmmanuel Vadot orientation-switch; 107cb7aa33aSEmmanuel Vadot 108cb7aa33aSEmmanuel Vadot port { 109cb7aa33aSEmmanuel Vadot sbu_mux_in: endpoint { 110cb7aa33aSEmmanuel Vadot remote-endpoint = <&tcpm_sbu_out>; 111cb7aa33aSEmmanuel Vadot }; 112cb7aa33aSEmmanuel Vadot }; 113cb7aa33aSEmmanuel Vadot }; 114cb7aa33aSEmmanuel Vadot... 115