From 3865a64284cc4845c61cf3dc6c7246349d80cc49 Mon Sep 17 00:00:00 2001 From: Nitheesh Sekar Date: Thu, 31 Aug 2023 08:35:03 +0530 Subject: dt-bindings: usb: dwc3: Add IPQ5018 compatible Document the IPQ5018 dwc3 compatible. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Nitheesh Sekar Link: https://lore.kernel.org/r/20230831030503.17100-1-quic_nsekar@quicinc.com Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml index 67591057f234..1ad62e55dfe2 100644 --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml @@ -14,6 +14,7 @@ properties: items: - enum: - qcom,ipq4019-dwc3 + - qcom,ipq5018-dwc3 - qcom,ipq5332-dwc3 - qcom,ipq6018-dwc3 - qcom,ipq8064-dwc3 @@ -238,6 +239,7 @@ allOf: compatible: contains: enum: + - qcom,ipq5018-dwc3 - qcom,ipq5332-dwc3 - qcom,msm8994-dwc3 - qcom,qcs404-dwc3 @@ -411,6 +413,7 @@ allOf: compatible: contains: enum: + - qcom,ipq5018-dwc3 - qcom,ipq5332-dwc3 - qcom,sdm660-dwc3 then: -- cgit v1.2.3 From ca58c4ae75b65e1d78408b134f129ea91e9595b8 Mon Sep 17 00:00:00 2001 From: Krishna Kurapati Date: Mon, 28 Aug 2023 19:00:21 +0530 Subject: dt-bindings: usb: qcom,dwc3: Add bindings for SC8280 Multiport Add the compatible string for SC8280 Multiport USB controller from Qualcomm. There are 4 power event irq interrupts supported by this controller (one for each port of multiport). Added all the 4 as non-optional interrupts for SC8280XP-MP Also each port of multiport has one DP and oen DM IRQ. Add all DP/DM IRQ's related to 4 ports of SC8280XP Teritiary controller. Also added ss phy irq for both SS Ports. Signed-off-by: Krishna Kurapati Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230828133033.11988-2-quic_kriskura@quicinc.com Signed-off-by: Greg Kroah-Hartman --- .../devicetree/bindings/usb/qcom,dwc3.yaml | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml index 1ad62e55dfe2..b4be38804df7 100644 --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml @@ -30,6 +30,7 @@ properties: - qcom,sc7180-dwc3 - qcom,sc7280-dwc3 - qcom,sc8280xp-dwc3 + - qcom,sc8280xp-dwc3-mp - qcom,sdm660-dwc3 - qcom,sdm670-dwc3 - qcom,sdm845-dwc3 @@ -260,6 +261,7 @@ allOf: contains: enum: - qcom,sc8280xp-dwc3 + - qcom,sc8280xp-dwc3-mp then: properties: clocks: @@ -482,6 +484,33 @@ allOf: - const: dm_hs_phy_irq - const: ss_phy_irq + - if: + properties: + compatible: + contains: + enum: + - qcom,sc8280xp-dwc3-mp + then: + properties: + interrupts: + maxItems: 14 + interrupt-names: + items: + - const: pwr_event_1 + - const: pwr_event_2 + - const: pwr_event_3 + - const: pwr_event_4 + - const: dp_hs_phy_1 + - const: dm_hs_phy_1 + - const: dp_hs_phy_2 + - const: dm_hs_phy_2 + - const: dp_hs_phy_3 + - const: dm_hs_phy_3 + - const: dp_hs_phy_4 + - const: dm_hs_phy_4 + - const: ss_phy_1 + - const: ss_phy_2 + additionalProperties: false examples: -- cgit v1.2.3 From eb3f1d9e42b1499152442e97b51bc1bcfee29d71 Mon Sep 17 00:00:00 2001 From: Krishna Kurapati Date: Mon, 28 Aug 2023 19:00:22 +0530 Subject: dt-bindings: usb: Add bindings for multiport properties on DWC3 controller Add bindings to indicate properties required to support multiport on Synopsys DWC3 controller. Suggested-by: Bjorn Andersson Signed-off-by: Krishna Kurapati Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230828133033.11988-3-quic_kriskura@quicinc.com Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index a696f23730d3..5bc941355b43 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -85,15 +85,16 @@ properties: phys: minItems: 1 - maxItems: 2 + maxItems: 8 phy-names: minItems: 1 - maxItems: 2 - items: - enum: - - usb2-phy - - usb3-phy + maxItems: 8 + oneOf: + - items: + enum: [ usb2-phy, usb3-phy ] + - items: + pattern: "^usb[23]-port[0-3]$" power-domains: description: -- cgit v1.2.3 From a3d19c289bedc99f01010020074f00b60640ade8 Mon Sep 17 00:00:00 2001 From: Stanley Chang Date: Sat, 26 Aug 2023 11:10:07 +0800 Subject: dt-bindings: usb: dwc3: Add Realtek DHC RTD SoC DWC3 USB Document the DWC3 USB bindings for Realtek SoCs. Signed-off-by: Stanley Chang Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230826031028.1892-2-stanley_chang@realtek.com Signed-off-by: Greg Kroah-Hartman --- .../devicetree/bindings/usb/realtek,rtd-dwc3.yaml | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/realtek,rtd-dwc3.yaml (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/realtek,rtd-dwc3.yaml b/Documentation/devicetree/bindings/usb/realtek,rtd-dwc3.yaml new file mode 100644 index 000000000000..345d0132d4a5 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/realtek,rtd-dwc3.yaml @@ -0,0 +1,80 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2023 Realtek Semiconductor Corporation +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/realtek,rtd-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Realtek DWC3 USB SoC Controller Glue + +maintainers: + - Stanley Chang + +description: + The Realtek DHC SoC embeds a DWC3 USB IP Core configured for USB 2.0 + and USB 3.0 in host or dual-role mode. + +properties: + compatible: + items: + - enum: + - realtek,rtd1295-dwc3 + - realtek,rtd1315e-dwc3 + - realtek,rtd1319-dwc3 + - realtek,rtd1319d-dwc3 + - realtek,rtd1395-dwc3 + - realtek,rtd1619-dwc3 + - realtek,rtd1619b-dwc3 + - const: realtek,rtd-dwc3 + + reg: + items: + - description: Address and length of register set for wrapper of dwc3 core. + - description: Address and length of register set for pm control. + + '#address-cells': + const: 1 + + '#size-cells': + const: 1 + + ranges: true + +patternProperties: + "^usb@[0-9a-f]+$": + $ref: snps,dwc3.yaml# + description: Required child node + +required: + - compatible + - reg + - "#address-cells" + - "#size-cells" + - ranges + +additionalProperties: false + +examples: + - | + usb@98013e00 { + compatible = "realtek,rtd1319d-dwc3", "realtek,rtd-dwc3"; + reg = <0x98013e00 0x140>, <0x98013f60 0x4>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + usb@98050000 { + compatible = "snps,dwc3"; + reg = <0x98050000 0x9000>; + interrupts = <0 94 4>; + phys = <&usb2phy &usb3phy>; + phy-names = "usb2-phy", "usb3-phy"; + dr_mode = "otg"; + usb-role-switch; + role-switch-default-mode = "host"; + snps,dis_u2_susphy_quirk; + snps,parkmode-disable-ss-quirk; + snps,parkmode-disable-hs-quirk; + maximum-speed = "high-speed"; + }; + }; -- cgit v1.2.3 From 6591e278f05c13f2525e0adb805e18174eda7024 Mon Sep 17 00:00:00 2001 From: Stanley Chang Date: Tue, 12 Sep 2023 12:19:03 +0800 Subject: dt-bindings: usb: dwc3: Add DWC_usb3 TX/RX threshold configurable In Synopsys's dwc3 data book: To avoid underrun and overrun during the burst, in a high-latency bus system (like USB), threshold and burst size control is provided through GTXTHRCFG and GRXTHRCFG registers. By default, USB TX and RX threshold are not enabled. To enable TX or RX threshold, both packet threshold count and max burst size properties must be set to a valid non-zero value. In Realtek DHC SoC, DWC3 USB 3.0 uses AHB system bus. When dwc3 is connected with USB 2.5G Ethernet, there will be overrun problem. Therefore, setting TX/RX thresholds can avoid this issue. Signed-off-by: Stanley Chang Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230912041904.30721-2-stanley_chang@realtek.com Signed-off-by: Greg Kroah-Hartman --- .../devicetree/bindings/usb/snps,dwc3.yaml | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index 5bc941355b43..d81c2e849ca9 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -311,6 +311,62 @@ properties: maximum: 62 deprecated: true + snps,rx-thr-num-pkt: + description: + USB RX packet threshold count. In host mode, this field specifies + the space that must be available in the RX FIFO before the core can + start the corresponding USB RX transaction (burst). + In device mode, this field specifies the space that must be + available in the RX FIFO before the core can send ERDY for a + flow-controlled endpoint. It is only used for SuperSpeed. + The valid values for this field are from 1 to 15. (DWC3 SuperSpeed + USB 3.0 Controller Databook) + $ref: /schemas/types.yaml#/definitions/uint8 + minimum: 1 + maximum: 15 + + snps,rx-max-burst: + description: + Max USB RX burst size. In host mode, this field specifies the + Maximum Bulk IN burst the DWC_usb3 core can perform. When the system + bus is slower than the USB, RX FIFO can overrun during a long burst. + You can program a smaller value to this field to limit the RX burst + size that the core can perform. It only applies to SS Bulk, + Isochronous, and Interrupt IN endpoints in the host mode. + In device mode, this field specifies the NUMP value that is sent in + ERDY for an OUT endpoint. + The valid values for this field are from 1 to 16. (DWC3 SuperSpeed + USB 3.0 Controller Databook) + $ref: /schemas/types.yaml#/definitions/uint8 + minimum: 1 + maximum: 16 + + snps,tx-thr-num-pkt: + description: + USB TX packet threshold count. This field specifies the number of + packets that must be in the TXFIFO before the core can start + transmission for the corresponding USB transaction (burst). + This count is valid in both host and device modes. It is only used + for SuperSpeed operation. + Valid values are from 1 to 15. (DWC3 SuperSpeed USB 3.0 Controller + Databook) + $ref: /schemas/types.yaml#/definitions/uint8 + minimum: 1 + maximum: 15 + + snps,tx-max-burst: + description: + Max USB TX burst size. When the system bus is slower than the USB, + TX FIFO can underrun during a long burst. Program a smaller value + to this field to limit the TX burst size that the core can execute. + In Host mode, it only applies to SS Bulk, Isochronous, and Interrupt + OUT endpoints. This value is not used in device mode. + Valid values are from 1 to 16. (DWC3 SuperSpeed USB 3.0 Controller + Databook) + $ref: /schemas/types.yaml#/definitions/uint8 + minimum: 1 + maximum: 16 + snps,rx-thr-num-pkt-prd: description: Periodic ESS RX packet threshold count (host mode only). Set this and -- cgit v1.2.3 From e38447bea4428e7dd80daba2b40160d5154e6e59 Mon Sep 17 00:00:00 2001 From: Rohit Agarwal Date: Fri, 22 Sep 2023 10:42:01 +0530 Subject: dt-bindings: phy: qcom,snps-eusb2-phy: Add compatible for SDX75 Add a dt-bindings compatible string for the SDX75 SoC that uses Synopsis eUSB2 PHY. Signed-off-by: Rohit Agarwal Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1695359525-4548-2-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml index c53bab107b6d..c95828607ab6 100644 --- a/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml +++ b/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml @@ -14,7 +14,12 @@ description: properties: compatible: - const: qcom,sm8550-snps-eusb2-phy + oneOf: + - items: + - enum: + - qcom,sdx75-snps-eusb2-phy + - const: qcom,sm8550-snps-eusb2-phy + - const: qcom,sm8550-snps-eusb2-phy reg: maxItems: 1 -- cgit v1.2.3 From df55d4f814f9b4f9deccb85e1a0ee34321572eab Mon Sep 17 00:00:00 2001 From: Rohit Agarwal Date: Fri, 22 Sep 2023 10:42:02 +0530 Subject: dt-bindings: phy: qcom,qmp-usb: Add SDX75 USB3 PHY Add dt-bindings for USB3 PHY found on Qualcomm SDX75. Signed-off-by: Rohit Agarwal Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1695359525-4548-3-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Greg Kroah-Hartman --- .../devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml index f99fbbcd68fb..d58dd744d5d2 100644 --- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml +++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml @@ -20,6 +20,7 @@ properties: - qcom,qcm2290-qmp-usb3-phy - qcom,sa8775p-qmp-usb3-uni-phy - qcom,sc8280xp-qmp-usb3-uni-phy + - qcom,sdx75-qmp-usb3-uni-phy - qcom,sm6115-qmp-usb3-phy reg: @@ -75,6 +76,7 @@ allOf: contains: enum: - qcom,ipq9574-qmp-usb3-phy + - qcom,sdx75-qmp-usb3-uni-phy then: properties: clock-names: -- cgit v1.2.3 From 91da60e3fda8bc917d48ba387942f08296e2af87 Mon Sep 17 00:00:00 2001 From: Rohit Agarwal Date: Fri, 22 Sep 2023 10:42:03 +0530 Subject: dt-bindings: usb: qcom,dwc3: Fix SDX65 clocks SDX65 has 5 clocks so mention in the bindings. Fixes: 16946a60715c ("dt-bindings: usb: qcom,dwc3: fix clock matching") Signed-off-by: Rohit Agarwal Acked-by: Rob Herring Link: https://lore.kernel.org/r/1695359525-4548-4-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml index b4be38804df7..a76b09290c40 100644 --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml @@ -182,6 +182,7 @@ allOf: - qcom,sdm670-dwc3 - qcom,sdm845-dwc3 - qcom,sdx55-dwc3 + - qcom,sdx65-dwc3 - qcom,sm6350-dwc3 then: properties: -- cgit v1.2.3 From f2b5cdb003e4047b6c55a24fd7d3a2482b9e1300 Mon Sep 17 00:00:00 2001 From: Rohit Agarwal Date: Fri, 22 Sep 2023 10:42:04 +0530 Subject: dt-bindings: usb: dwc3: Add SDX75 compatible Document the SDX75 dwc3 compatible. Signed-off-by: Rohit Agarwal Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1695359525-4548-5-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml index a76b09290c40..51a5581ce692 100644 --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml @@ -36,6 +36,7 @@ properties: - qcom,sdm845-dwc3 - qcom,sdx55-dwc3 - qcom,sdx65-dwc3 + - qcom,sdx75-dwc3 - qcom,sm4250-dwc3 - qcom,sm6115-dwc3 - qcom,sm6125-dwc3 @@ -183,6 +184,7 @@ allOf: - qcom,sdm845-dwc3 - qcom,sdx55-dwc3 - qcom,sdx65-dwc3 + - qcom,sdx75-dwc3 - qcom,sm6350-dwc3 then: properties: @@ -368,6 +370,7 @@ allOf: - qcom,sdm845-dwc3 - qcom,sdx55-dwc3 - qcom,sdx65-dwc3 + - qcom,sdx75-dwc3 - qcom,sm4250-dwc3 - qcom,sm6125-dwc3 - qcom,sm6350-dwc3 -- cgit v1.2.3 From 0e650c94a422be51b1dbe3cb4598ab247adabb29 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Sun, 24 Sep 2023 13:03:51 -0300 Subject: dt-bindings: usb: ci-hdrc-usb2: Allow "fsl,imx27-usb" to be passed alone imx27.dtsi describes its usb nodes as: compatible = "fsl,imx27-usb"; Adjust the bindings to allow it and avoid the following schema warning: usb@10024000: compatible: 'oneOf' conditional failed, one must be fixed: ['fsl,imx27-usb'] is too short Signed-off-by: Fabio Estevam Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230924160351.692867-1-festevam@gmail.com Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml index 1394557517b1..cd58ab3cc143 100644 --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml @@ -15,6 +15,7 @@ properties: oneOf: - enum: - chipidea,usb2 + - fsl,imx27-usb - lsi,zevio-usb - nvidia,tegra20-ehci - nvidia,tegra20-udc -- cgit v1.2.3 From bb9f10ff6709e15fb935c954f1fb715ac1f970e7 Mon Sep 17 00:00:00 2001 From: Jerome Brunet Date: Mon, 2 Oct 2023 14:29:08 +0200 Subject: dt-bindings: usb: add device for Genesys Logic hub gl3510 Add gl3510 USB 3 root hub device id Acked-by: Krzysztof Kozlowski Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20231002122909.2338049-2-jbrunet@baylibre.com Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/usb/genesys,gl850g.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/genesys,gl850g.yaml b/Documentation/devicetree/bindings/usb/genesys,gl850g.yaml index d0927f6768a4..ee08b9c3721f 100644 --- a/Documentation/devicetree/bindings/usb/genesys,gl850g.yaml +++ b/Documentation/devicetree/bindings/usb/genesys,gl850g.yaml @@ -4,7 +4,7 @@ $id: http://devicetree.org/schemas/usb/genesys,gl850g.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Genesys Logic GL850G USB 2.0 hub controller +title: Genesys Logic USB hub controller maintainers: - Icenowy Zheng @@ -18,6 +18,7 @@ properties: - usb5e3,608 - usb5e3,610 - usb5e3,620 + - usb5e3,626 reg: true -- cgit v1.2.3 From 568441b7d45fc7198a89b522d721428f2005c356 Mon Sep 17 00:00:00 2001 From: Heikki Krogerus Date: Mon, 2 Oct 2023 17:22:40 +0300 Subject: usb: pd: Exposing the Peak Current value of Fixed Supplies to user space Exposing the value of the field as is. The Peak Current value has to be interpreted as described in Table 6-10 (Fixed Power Source Peak Current Capability) of the USB Power Delivery Specification, but that interpretation will be done in user space, not in kernel. Suggested-by: Douglas Gilbert Reviewed-by: Guenter Roeck Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231002142240.2641962-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-usb_power_delivery | 7 +++++++ drivers/usb/typec/pd.c | 10 ++++------ include/linux/usb/pd.h | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'Documentation') diff --git a/Documentation/ABI/testing/sysfs-class-usb_power_delivery b/Documentation/ABI/testing/sysfs-class-usb_power_delivery index 1bf9d1d7902c..61d233c320ea 100644 --- a/Documentation/ABI/testing/sysfs-class-usb_power_delivery +++ b/Documentation/ABI/testing/sysfs-class-usb_power_delivery @@ -124,6 +124,13 @@ Contact: Heikki Krogerus Description: The voltage the supply supports in millivolts. +What: /sys/class/usb_power_delivery/.../source-capabilities/:fixed_supply/peak_current +Date: October 2023 +Contact: Heikki Krogerus +Description: + This file shows the value of the Fixed Power Source Peak Current + Capability field. + What: /sys/class/usb_power_delivery/.../source-capabilities/:fixed_supply/maximum_current Date: May 2022 Contact: Heikki Krogerus diff --git a/drivers/usb/typec/pd.c b/drivers/usb/typec/pd.c index 8cc66e4467c4..85d015cdbe1f 100644 --- a/drivers/usb/typec/pd.c +++ b/drivers/usb/typec/pd.c @@ -83,14 +83,12 @@ unchunked_extended_messages_supported_show(struct device *dev, } static DEVICE_ATTR_RO(unchunked_extended_messages_supported); -/* - * REVISIT: Peak Current requires access also to the RDO. static ssize_t peak_current_show(struct device *dev, struct device_attribute *attr, char *buf) { - ... + return sysfs_emit(buf, "%u\n", (to_pdo(dev)->pdo >> PDO_FIXED_PEAK_CURR_SHIFT) & 3); } -*/ +static DEVICE_ATTR_RO(peak_current); static ssize_t fast_role_swap_current_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -135,7 +133,7 @@ static struct attribute *source_fixed_supply_attrs[] = { &dev_attr_usb_communication_capable.attr, &dev_attr_dual_role_data.attr, &dev_attr_unchunked_extended_messages_supported.attr, - /*&dev_attr_peak_current.attr,*/ + &dev_attr_peak_current.attr, &dev_attr_voltage.attr, &maximum_current_attr.attr, NULL @@ -144,7 +142,7 @@ static struct attribute *source_fixed_supply_attrs[] = { static umode_t fixed_attr_is_visible(struct kobject *kobj, struct attribute *attr, int n) { if (to_pdo(kobj_to_dev(kobj))->object_position && - /*attr != &dev_attr_peak_current.attr &&*/ + attr != &dev_attr_peak_current.attr && attr != &dev_attr_voltage.attr && attr != &maximum_current_attr.attr && attr != &operational_current_attr.attr) diff --git a/include/linux/usb/pd.h b/include/linux/usb/pd.h index c59fb79a42e8..eb626af0e4e7 100644 --- a/include/linux/usb/pd.h +++ b/include/linux/usb/pd.h @@ -228,6 +228,7 @@ enum pd_pdo_type { #define PDO_FIXED_UNCHUNK_EXT BIT(24) /* Unchunked Extended Message supported (Source) */ #define PDO_FIXED_FRS_CURR_MASK (BIT(24) | BIT(23)) /* FR_Swap Current (Sink) */ #define PDO_FIXED_FRS_CURR_SHIFT 23 +#define PDO_FIXED_PEAK_CURR_SHIFT 20 #define PDO_FIXED_VOLT_SHIFT 10 /* 50mV units */ #define PDO_FIXED_CURR_SHIFT 0 /* 10mA units */ -- cgit v1.2.3 From 44ceac8c92daa2e08ba402c6609293cef2969093 Mon Sep 17 00:00:00 2001 From: Randy Li Date: Fri, 15 Sep 2023 01:23:24 +0800 Subject: docs: driver-api: usb: update dma info We should not hide the recommend APIs in a obscure place. Signed-off-by: Randy Li Link: https://lore.kernel.org/r/20230914172336.18761-3-ayaka@soulik.info Signed-off-by: Greg Kroah-Hartman --- Documentation/driver-api/usb/dma.rst | 48 +++++++++--------------------------- 1 file changed, 11 insertions(+), 37 deletions(-) (limited to 'Documentation') diff --git a/Documentation/driver-api/usb/dma.rst b/Documentation/driver-api/usb/dma.rst index d32c27e11b90..02f6825ff830 100644 --- a/Documentation/driver-api/usb/dma.rst +++ b/Documentation/driver-api/usb/dma.rst @@ -93,44 +93,18 @@ DMA address space of the device. However, most buffers passed to your driver can safely be used with such DMA mapping. (See the first section of Documentation/core-api/dma-api-howto.rst, titled "What memory is DMA-able?") -- When you're using scatterlists, you can map everything at once. On some - systems, this kicks in an IOMMU and turns the scatterlists into single - DMA transactions:: +- When you have the scatterlists which have been mapped for the USB controller, + you could use the new ``usb_sg_*()`` calls, which would turn scatterlist + into URBs:: - int usb_buffer_map_sg (struct usb_device *dev, unsigned pipe, - struct scatterlist *sg, int nents); + int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev, + unsigned pipe, unsigned period, struct scatterlist *sg, + int nents, size_t length, gfp_t mem_flags); - void usb_buffer_dmasync_sg (struct usb_device *dev, unsigned pipe, - struct scatterlist *sg, int n_hw_ents); + void usb_sg_wait(struct usb_sg_request *io); - void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe, - struct scatterlist *sg, int n_hw_ents); + void usb_sg_cancel(struct usb_sg_request *io); - It's probably easier to use the new ``usb_sg_*()`` calls, which do the DMA - mapping and apply other tweaks to make scatterlist i/o be fast. - -- Some drivers may prefer to work with the model that they're mapping large - buffers, synchronizing their safe re-use. (If there's no re-use, then let - usbcore do the map/unmap.) Large periodic transfers make good examples - here, since it's cheaper to just synchronize the buffer than to unmap it - each time an urb completes and then re-map it on during resubmission. - - These calls all work with initialized urbs: ``urb->dev``, ``urb->pipe``, - ``urb->transfer_buffer``, and ``urb->transfer_buffer_length`` must all be - valid when these calls are used (``urb->setup_packet`` must be valid too - if urb is a control request):: - - struct urb *usb_buffer_map (struct urb *urb); - - void usb_buffer_dmasync (struct urb *urb); - - void usb_buffer_unmap (struct urb *urb); - - The calls manage ``urb->transfer_dma`` for you, and set - ``URB_NO_TRANSFER_DMA_MAP`` so that usbcore won't map or unmap the buffer. - They cannot be used for setup_packet buffers in control requests. - -Note that several of those interfaces are currently commented out, since -they don't have current users. See the source code. Other than the dmasync -calls (where the underlying DMA primitives have changed), most of them can -easily be commented back in if you want to use them. + When the USB controller doesn't support DMA, the ``usb_sg_init()`` would try + to submit URBs in PIO way as long as the page in scatterlists is not in the + Highmem, which could be very rare in modern architectures. -- cgit v1.2.3 From af313201946a7e64f6985711136ef02f9113a8fc Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Wed, 27 Sep 2023 09:35:10 -0300 Subject: dt-bindings: usb: gpio-sbu-mux: Add an entry for CBDTU02043 Add a compatible entry for the NXP CBDTU02043 GPIO-based mux hardware used for connecting, disconnecting and switching orientation of the SBU lines in USB Type-C applications. CBTU02043 datasheet: https://www.nxp.com/docs/en/data-sheet/CBTU02043.pdf Signed-off-by: Fabio Estevam Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230927123511.45085-1-festevam@gmail.com Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml b/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml index f196beb826d8..b61dcf8b4aad 100644 --- a/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml +++ b/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml @@ -19,6 +19,7 @@ properties: compatible: items: - enum: + - nxp,cbdtu02043 - onnn,fsusb43l10x - pericom,pi3usb102 - const: gpio-sbu-mux -- cgit v1.2.3 From de2eb28cdb76df9ce7587e1c6552b169069af4bb Mon Sep 17 00:00:00 2001 From: James Gruber Date: Thu, 14 Sep 2023 15:27:46 -0700 Subject: usb: gadget: f_uac2: allow changing terminal types through configfs Add "c_terminal_type" and "p_terminal_type" configfs entries in order to allow the user to change the capture and playback terminal type codes. These fields affect the type of audio device that Windows detects, so being able to modify this is useful when it would be advantageous for a gadget to be detected as something other than a generic speaker/microphone. The fields default to microphone for the capture type field and speaker for the playback type field as was the case before. Signed-off-by: James Gruber Link: https://lore.kernel.org/r/20230914222746.155126-1-jimmyjgruber@gmail.com Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/configfs-usb-gadget-uac2 | 2 ++ Documentation/usb/gadget-testing.rst | 2 ++ drivers/usb/gadget/function/f_uac2.c | 16 ++++++++++++++-- drivers/usb/gadget/function/u_uac2.h | 8 ++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/ABI/testing/configfs-usb-gadget-uac2 b/Documentation/ABI/testing/configfs-usb-gadget-uac2 index 3371c39f651d..a2bf4fd82a5b 100644 --- a/Documentation/ABI/testing/configfs-usb-gadget-uac2 +++ b/Documentation/ABI/testing/configfs-usb-gadget-uac2 @@ -35,4 +35,6 @@ Description: req_number the number of pre-allocated requests for both capture and playback function_name name of the interface + c_terminal_type code of the capture terminal type + p_terminal_type code of the playback terminal type ===================== ======================================= diff --git a/Documentation/usb/gadget-testing.rst b/Documentation/usb/gadget-testing.rst index 394cd226bfae..29072c166d23 100644 --- a/Documentation/usb/gadget-testing.rst +++ b/Documentation/usb/gadget-testing.rst @@ -755,6 +755,8 @@ The uac2 function provides these attributes in its function directory: req_number the number of pre-allocated request for both capture and playback function_name name of the interface + c_terminal_type code of the capture terminal type + p_terminal_type code of the playback terminal type ================ ==================================================== The attributes have sane default values. diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index 0219cd79493a..f9a0f07a7476 100644 --- a/drivers/usb/gadget/function/f_uac2.c +++ b/drivers/usb/gadget/function/f_uac2.c @@ -212,7 +212,7 @@ static struct uac2_input_terminal_descriptor io_in_it_desc = { .bDescriptorSubtype = UAC_INPUT_TERMINAL, /* .bTerminalID = DYNAMIC */ - .wTerminalType = cpu_to_le16(UAC_INPUT_TERMINAL_MICROPHONE), + /* .wTerminalType = DYNAMIC */ .bAssocTerminal = 0, /* .bCSourceID = DYNAMIC */ .iChannelNames = 0, @@ -240,7 +240,7 @@ static struct uac2_output_terminal_descriptor io_out_ot_desc = { .bDescriptorSubtype = UAC_OUTPUT_TERMINAL, /* .bTerminalID = DYNAMIC */ - .wTerminalType = cpu_to_le16(UAC_OUTPUT_TERMINAL_SPEAKER), + /* .wTerminalType = DYNAMIC */ .bAssocTerminal = 0, /* .bSourceID = DYNAMIC */ /* .bCSourceID = DYNAMIC */ @@ -977,6 +977,9 @@ static void setup_descriptor(struct f_uac2_opts *opts) iad_desc.bInterfaceCount++; } + io_in_it_desc.wTerminalType = cpu_to_le16(opts->c_terminal_type); + io_out_ot_desc.wTerminalType = cpu_to_le16(opts->p_terminal_type); + setup_headers(opts, fs_audio_desc, USB_SPEED_FULL); setup_headers(opts, hs_audio_desc, USB_SPEED_HIGH); setup_headers(opts, ss_audio_desc, USB_SPEED_SUPER); @@ -2095,6 +2098,9 @@ UAC2_ATTRIBUTE(s16, c_volume_res); UAC2_ATTRIBUTE(u32, fb_max); UAC2_ATTRIBUTE_STRING(function_name); +UAC2_ATTRIBUTE(s16, p_terminal_type); +UAC2_ATTRIBUTE(s16, c_terminal_type); + static struct configfs_attribute *f_uac2_attrs[] = { &f_uac2_opts_attr_p_chmask, &f_uac2_opts_attr_p_srate, @@ -2122,6 +2128,9 @@ static struct configfs_attribute *f_uac2_attrs[] = { &f_uac2_opts_attr_function_name, + &f_uac2_opts_attr_p_terminal_type, + &f_uac2_opts_attr_c_terminal_type, + NULL, }; @@ -2180,6 +2189,9 @@ static struct usb_function_instance *afunc_alloc_inst(void) snprintf(opts->function_name, sizeof(opts->function_name), "Source/Sink"); + opts->p_terminal_type = UAC2_DEF_P_TERM_TYPE; + opts->c_terminal_type = UAC2_DEF_C_TERM_TYPE; + return &opts->func_inst; } diff --git a/drivers/usb/gadget/function/u_uac2.h b/drivers/usb/gadget/function/u_uac2.h index 0510c9bad58d..5e81bdd6c5fb 100644 --- a/drivers/usb/gadget/function/u_uac2.h +++ b/drivers/usb/gadget/function/u_uac2.h @@ -35,6 +35,11 @@ #define UAC2_DEF_REQ_NUM 2 #define UAC2_DEF_INT_REQ_NUM 10 +#define UAC2_DEF_P_TERM_TYPE 0x301 + /* UAC_OUTPUT_TERMINAL_SPEAKER */ +#define UAC2_DEF_C_TERM_TYPE 0x201 + /* UAC_INPUT_TERMINAL_MICROPHONE*/ + struct f_uac2_opts { struct usb_function_instance func_inst; int p_chmask; @@ -65,6 +70,9 @@ struct f_uac2_opts { char function_name[32]; + s16 p_terminal_type; + s16 c_terminal_type; + struct mutex lock; int refcnt; }; -- cgit v1.2.3 From 65682407f8f4b9c583f672746980ec7ec6aaef4d Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 2 Oct 2023 12:20:21 +0200 Subject: dt-bindings: soc: qcom: qcom,pmic-glink: add a gpio used to determine the Type-C port plug orientation On SM8450 and SM8550 based platforms, the Type-C plug orientation is given on a GPIO line for each connector which are set by the PMIC(s). Document this optional Type-C connector property, and take the assumption an active level represents an inverted/flipped orientation. Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20231002-topic-sm8550-upstream-type-c-orientation-v2-1-125410d3ff95@linaro.org Signed-off-by: Greg Kroah-Hartman --- .../devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml index bceb479f74c5..422921cf1f82 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml @@ -35,6 +35,12 @@ properties: '#size-cells': const: 0 + orientation-gpios: + description: Array of input gpios for the Type-C connector orientation indication. + The GPIO indication is used to detect the orientation of the Type-C connector. + The array should contain a gpio entry for each PMIC Glink connector, in reg order. + It is defined that GPIO active level means "CC2" or Reversed/Flipped orientation. + patternProperties: '^connector@\d$': $ref: /schemas/connector/usb-connector.yaml# @@ -44,6 +50,19 @@ patternProperties: required: - compatible +allOf: + - if: + not: + properties: + compatible: + contains: + enum: + - qcom,sm8450-pmic-glink + - qcom,sm8550-pmic-glink + then: + properties: + orientation-gpios: false + additionalProperties: false examples: -- cgit v1.2.3 From 6060d554e89162e6d8c87e9322e26d0fe1f0dd47 Mon Sep 17 00:00:00 2001 From: Abdel Alkuor Date: Tue, 3 Oct 2023 11:58:34 -0400 Subject: dt-bindings: usb: tps6598x: Add tps25750 TPS25750 is USB TypeC PD controller which is a subset of TPS6598x. Signed-off-by: Abdel Alkuor Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231003155842.57313-2-alkuor@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../devicetree/bindings/usb/ti,tps6598x.yaml | 81 +++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/ti,tps6598x.yaml b/Documentation/devicetree/bindings/usb/ti,tps6598x.yaml index 5497a60cddbc..72ac534e6ed2 100644 --- a/Documentation/devicetree/bindings/usb/ti,tps6598x.yaml +++ b/Documentation/devicetree/bindings/usb/ti,tps6598x.yaml @@ -20,8 +20,23 @@ properties: enum: - ti,tps6598x - apple,cd321x + - ti,tps25750 + reg: - maxItems: 1 + minItems: 1 + items: + - description: main PD controller address + - description: | + I2C slave address field in PBMs input data + which is used as the device address when writing the + patch for TPS25750. + The patch address can be any value except 0x00, 0x20, + 0x21, 0x22, and 0x23 + + reg-names: + items: + - const: main + - const: patch-address wakeup-source: true @@ -32,10 +47,42 @@ properties: items: - const: irq + firmware-name: + description: | + Should contain the name of the default patch binary + file located on the firmware search path which is + used to switch the controller into APP mode. + This is used when tps25750 doesn't have an EEPROM + connected to it. + maxItems: 1 + required: - compatible - reg +allOf: + - if: + properties: + compatible: + contains: + const: ti,tps25750 + then: + properties: + reg: + maxItems: 2 + + connector: + required: + - data-role + + required: + - connector + - reg-names + else: + properties: + reg: + maxItems: 1 + additionalProperties: true examples: @@ -68,4 +115,36 @@ examples: }; }; }; + + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + typec@21 { + compatible = "ti,tps25750"; + reg = <0x21>, <0x0f>; + reg-names = "main", "patch-address"; + + interrupt-parent = <&msmgpio>; + interrupts = <100 IRQ_TYPE_LEVEL_LOW>; + interrupt-names = "irq"; + firmware-name = "tps25750.bin"; + + pinctrl-names = "default"; + pinctrl-0 = <&typec_pins>; + + typec_con0: connector { + compatible = "usb-c-connector"; + label = "USB-C"; + data-role = "dual"; + port { + typec_ep0: endpoint { + remote-endpoint = <&otg_ep>; + }; + }; + }; + }; + }; ... -- cgit v1.2.3 From 59de2a56d127890cc610f3896d5fc31887c54ac2 Mon Sep 17 00:00:00 2001 From: Heikki Krogerus Date: Wed, 11 Oct 2023 13:58:24 +0300 Subject: usb: typec: Link enumerated USB devices with Type-C partner Adding functions that USB hub code can use to inform the Type-C class about connected USB devices. Once taken into use, it will allow the Type-C port drivers to power off components that are not needed, for example if USB2 device is enumerated, everything that is only relevant for USB3 (retimers, etc.), can be powered off. This will also create a symlink "typec" for the USB devices pointing to the USB Type-C partner device. Suggested-by: Benson Leung Tested-by: Benson Leung Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231011105825.320062-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-bus-usb | 9 +++ drivers/usb/typec/class.c | 108 +++++++++++++++++++++++++++++--- drivers/usb/typec/class.h | 16 +++++ drivers/usb/typec/port-mapper.c | 9 ++- include/linux/usb/typec.h | 37 +++++++++++ 5 files changed, 169 insertions(+), 10 deletions(-) (limited to 'Documentation') diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb index a44bfe020061..2b7108e21977 100644 --- a/Documentation/ABI/testing/sysfs-bus-usb +++ b/Documentation/ABI/testing/sysfs-bus-usb @@ -313,6 +313,15 @@ Description: Inter-Chip SSIC devices support asymmetric lanes up to 4 lanes per direction. Devices before USB 3.2 are single lane (tx_lanes = 1) +What: /sys/bus/usb/devices/.../typec +Date: November 2023 +Contact: Heikki Krogerus +Description: + Symlink to the USB Type-C partner device. USB Type-C partner + represents the component that communicates over the + Configuration Channel (CC signal on USB Type-C connectors and + cables) with the local port. + What: /sys/bus/usb/devices/usbX/bAlternateSetting Description: The current interface alternate setting number, in decimal. diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index 9c1dbf3c00e0..2e0451bd336e 100644 --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "bus.h" #include "class.h" @@ -681,6 +682,33 @@ const struct device_type typec_partner_dev_type = { .release = typec_partner_release, }; +static void typec_partner_link_device(struct typec_partner *partner, struct device *dev) +{ + int ret; + + ret = sysfs_create_link(&dev->kobj, &partner->dev.kobj, "typec"); + if (ret) + return; + + ret = sysfs_create_link(&partner->dev.kobj, &dev->kobj, dev_name(dev)); + if (ret) { + sysfs_remove_link(&dev->kobj, "typec"); + return; + } + + if (partner->attach) + partner->attach(partner, dev); +} + +static void typec_partner_unlink_device(struct typec_partner *partner, struct device *dev) +{ + sysfs_remove_link(&partner->dev.kobj, dev_name(dev)); + sysfs_remove_link(&dev->kobj, "typec"); + + if (partner->deattach) + partner->deattach(partner, dev); +} + /** * typec_partner_set_identity - Report result from Discover Identity command * @partner: The partner updated identity values @@ -865,6 +893,8 @@ struct typec_partner *typec_register_partner(struct typec_port *port, partner->num_altmodes = -1; partner->pd_revision = desc->pd_revision; partner->svdm_version = port->cap->svdm_version; + partner->attach = desc->attach; + partner->deattach = desc->deattach; if (desc->identity) { /* @@ -887,6 +917,11 @@ struct typec_partner *typec_register_partner(struct typec_port *port, return ERR_PTR(ret); } + if (port->usb2_dev) + typec_partner_link_device(partner, port->usb2_dev); + if (port->usb3_dev) + typec_partner_link_device(partner, port->usb3_dev); + return partner; } EXPORT_SYMBOL_GPL(typec_register_partner); @@ -899,8 +934,19 @@ EXPORT_SYMBOL_GPL(typec_register_partner); */ void typec_unregister_partner(struct typec_partner *partner) { - if (!IS_ERR_OR_NULL(partner)) - device_unregister(&partner->dev); + struct typec_port *port; + + if (IS_ERR_OR_NULL(partner)) + return; + + port = to_typec_port(partner->dev.parent); + + if (port->usb2_dev) + typec_partner_unlink_device(partner, port->usb2_dev); + if (port->usb3_dev) + typec_partner_unlink_device(partner, port->usb3_dev); + + device_unregister(&partner->dev); } EXPORT_SYMBOL_GPL(typec_unregister_partner); @@ -1775,6 +1821,50 @@ static int partner_match(struct device *dev, void *data) return is_typec_partner(dev); } +static struct typec_partner *typec_get_partner(struct typec_port *port) +{ + struct device *dev; + + dev = device_find_child(&port->dev, NULL, partner_match); + if (!dev) + return NULL; + + return to_typec_partner(dev); +} + +static void typec_partner_attach(struct typec_connector *con, struct device *dev) +{ + struct typec_port *port = container_of(con, struct typec_port, con); + struct typec_partner *partner = typec_get_partner(port); + struct usb_device *udev = to_usb_device(dev); + + if (udev->speed < USB_SPEED_SUPER) + port->usb2_dev = dev; + else + port->usb3_dev = dev; + + if (partner) { + typec_partner_link_device(partner, dev); + put_device(&partner->dev); + } +} + +static void typec_partner_deattach(struct typec_connector *con, struct device *dev) +{ + struct typec_port *port = container_of(con, struct typec_port, con); + struct typec_partner *partner = typec_get_partner(port); + + if (partner) { + typec_partner_unlink_device(partner, dev); + put_device(&partner->dev); + } + + if (port->usb2_dev == dev) + port->usb2_dev = NULL; + else if (port->usb3_dev == dev) + port->usb3_dev = NULL; +} + /** * typec_set_data_role - Report data role change * @port: The USB Type-C Port where the role was changed @@ -1784,7 +1874,7 @@ static int partner_match(struct device *dev, void *data) */ void typec_set_data_role(struct typec_port *port, enum typec_data_role role) { - struct device *partner_dev; + struct typec_partner *partner; if (port->data_role == role) return; @@ -1793,14 +1883,14 @@ void typec_set_data_role(struct typec_port *port, enum typec_data_role role) sysfs_notify(&port->dev.kobj, NULL, "data_role"); kobject_uevent(&port->dev.kobj, KOBJ_CHANGE); - partner_dev = device_find_child(&port->dev, NULL, partner_match); - if (!partner_dev) + partner = typec_get_partner(port); + if (!partner) return; - if (to_typec_partner(partner_dev)->identity) - typec_product_type_notify(partner_dev); + if (partner->identity) + typec_product_type_notify(&partner->dev); - put_device(partner_dev); + put_device(&partner->dev); } EXPORT_SYMBOL_GPL(typec_set_data_role); @@ -2251,6 +2341,8 @@ struct typec_port *typec_register_port(struct device *parent, port->ops = cap->ops; port->port_type = cap->type; port->prefer_role = cap->prefer_role; + port->con.attach = typec_partner_attach; + port->con.deattach = typec_partner_deattach; device_initialize(&port->dev); port->dev.class = &typec_class; diff --git a/drivers/usb/typec/class.h b/drivers/usb/typec/class.h index 673b2952b074..c36761ba3f59 100644 --- a/drivers/usb/typec/class.h +++ b/drivers/usb/typec/class.h @@ -8,6 +8,7 @@ struct typec_mux; struct typec_switch; +struct usb_device; struct typec_plug { struct device dev; @@ -35,6 +36,9 @@ struct typec_partner { enum usb_pd_svdm_ver svdm_version; struct usb_power_delivery *pd; + + void (*attach)(struct typec_partner *partner, struct device *dev); + void (*deattach)(struct typec_partner *partner, struct device *dev); }; struct typec_port { @@ -59,6 +63,18 @@ struct typec_port { const struct typec_capability *cap; const struct typec_operations *ops; + + struct typec_connector con; + + /* + * REVISIT: Only USB devices for now. If there are others, these need to + * be converted into a list. + * + * NOTE: These may be registered first before the typec_partner, so they + * will always have to be kept here instead of struct typec_partner. + */ + struct device *usb2_dev; + struct device *usb3_dev; }; #define to_typec_port(_dev_) container_of(_dev_, struct typec_port, dev) diff --git a/drivers/usb/typec/port-mapper.c b/drivers/usb/typec/port-mapper.c index a929e000d0e2..d42da5720a25 100644 --- a/drivers/usb/typec/port-mapper.c +++ b/drivers/usb/typec/port-mapper.c @@ -8,17 +8,22 @@ #include #include +#include #include "class.h" static int typec_aggregate_bind(struct device *dev) { - return component_bind_all(dev, NULL); + struct typec_port *port = to_typec_port(dev); + + return component_bind_all(dev, &port->con); } static void typec_aggregate_unbind(struct device *dev) { - component_unbind_all(dev, NULL); + struct typec_port *port = to_typec_port(dev); + + component_unbind_all(dev, &port->con); } static const struct component_master_ops typec_aggregate_ops = { diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h index 8fa781207970..a05d6f6f2536 100644 --- a/include/linux/usb/typec.h +++ b/include/linux/usb/typec.h @@ -202,6 +202,8 @@ struct typec_cable_desc { * @accessory: Audio, Debug or none. * @identity: Discover Identity command data * @pd_revision: USB Power Delivery Specification Revision if supported + * @attach: Notification about attached USB device + * @deattach: Notification about removed USB device * * Details about a partner that is attached to USB Type-C port. If @identity * member exists when partner is registered, a directory named "identity" is @@ -217,6 +219,9 @@ struct typec_partner_desc { enum typec_accessory accessory; struct usb_pd_identity *identity; u16 pd_revision; /* 0300H = "3.0" */ + + void (*attach)(struct typec_partner *partner, struct device *dev); + void (*deattach)(struct typec_partner *partner, struct device *dev); }; /** @@ -335,4 +340,36 @@ int typec_port_set_usb_power_delivery(struct typec_port *port, struct usb_power_ int typec_partner_set_usb_power_delivery(struct typec_partner *partner, struct usb_power_delivery *pd); +/** + * struct typec_connector - Representation of Type-C port for external drivers + * @attach: notification about device removal + * @deattach: notification about device removal + * + * Drivers that control the USB and other ports (DisplayPorts, etc.), that are + * connected to the Type-C connectors, can use these callbacks to inform the + * Type-C connector class about connections and disconnections. That information + * can then be used by the typec-port drivers to power on or off parts that are + * needed or not needed - as an example, in USB mode if USB2 device is + * enumerated, USB3 components (retimers, phys, and what have you) do not need + * to be powered on. + * + * The attached (enumerated) devices will be liked with the typec-partner device. + */ +struct typec_connector { + void (*attach)(struct typec_connector *con, struct device *dev); + void (*deattach)(struct typec_connector *con, struct device *dev); +}; + +static inline void typec_attach(struct typec_connector *con, struct device *dev) +{ + if (con && con->attach) + con->attach(con, dev); +} + +static inline void typec_deattach(struct typec_connector *con, struct device *dev) +{ + if (con && con->deattach) + con->deattach(con, dev); +} + #endif /* __LINUX_USB_TYPEC_H */ -- cgit v1.2.3 From 5220d8b04a840fa09434072c866d032b163419e3 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Mon, 16 Oct 2023 10:11:41 -0300 Subject: dt-bindings: usb: gpio-sbu-mux: Make 'mode-switch' not required On a i.MX8QXP MEK board that has an NXP CBDTU02043 mux, there is no mode-switch support, only orientation switch. Make the 'mode-switch' property a non-required one. Signed-off-by: Fabio Estevam Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231016131141.680517-1-festevam@gmail.com Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml | 1 - 1 file changed, 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml b/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml index b61dcf8b4aad..d3b2b666ec2a 100644 --- a/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml +++ b/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml @@ -51,7 +51,6 @@ required: - compatible - enable-gpios - select-gpios - - mode-switch - orientation-switch - port -- cgit v1.2.3 From 4936eb7567c3e44065979e1036ba3c018dd6b9a1 Mon Sep 17 00:00:00 2001 From: Jisheng Zhang Date: Wed, 18 Oct 2023 23:04:48 +0800 Subject: dt-bindings: usb: vialab,vl817: remove reset-gpios from required list The "reset-gpios" is optional in real case, for example reset pin is is hard wired to "high". And this fact is also reflected by the devm_gpio_get_optional() calling in driver code. Signed-off-by: Jisheng Zhang Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231018150448.1980-1-jszhang@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/usb/vialab,vl817.yaml | 1 - 1 file changed, 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/vialab,vl817.yaml b/Documentation/devicetree/bindings/usb/vialab,vl817.yaml index 76db9071b352..c815010ba9c2 100644 --- a/Documentation/devicetree/bindings/usb/vialab,vl817.yaml +++ b/Documentation/devicetree/bindings/usb/vialab,vl817.yaml @@ -37,7 +37,6 @@ properties: required: - compatible - reg - - reset-gpios - vdd-supply - peer-hub -- cgit v1.2.3 From ceae398f15b32ebce8db73c15f2603c3b72eca32 Mon Sep 17 00:00:00 2001 From: Tomer Maimon Date: Tue, 17 Oct 2023 22:59:02 +0300 Subject: dt-bindings: usb: ci-hdrc-usb2: add npcm750 and npcm845 compatible Add a compatible string for Nuvoton BMC NPCM750 and Nuvoton BMC NPCM845. Signed-off-by: Tomer Maimon Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231017195903.1665260-3-tmaimon77@gmail.com Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml index cd58ab3cc143..b7e664f7395b 100644 --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml @@ -17,6 +17,7 @@ properties: - chipidea,usb2 - fsl,imx27-usb - lsi,zevio-usb + - nuvoton,npcm750-udc - nvidia,tegra20-ehci - nvidia,tegra20-udc - nvidia,tegra30-ehci @@ -67,6 +68,10 @@ properties: - items: - const: xlnx,zynq-usb-2.20a - const: chipidea,usb2 + - items: + - enum: + - nuvoton,npcm845-udc + - const: nuvoton,npcm750-udc reg: minItems: 1 @@ -389,6 +394,7 @@ allOf: enum: - chipidea,usb2 - lsi,zevio-usb + - nuvoton,npcm750-udc - nvidia,tegra20-udc - nvidia,tegra30-udc - nvidia,tegra114-udc -- cgit v1.2.3 From 915360a5ce96f0c8e22730b21c50dd1a1f271930 Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Fri, 20 Oct 2023 12:35:46 +0200 Subject: dt-bindings: usb: add NXP PTN36502 Type-C redriver bindings Document bindings for this Type-C USB 3.1 Gen 1 and DisplayPort v1.2 combo redriver. The PTN36502 can also run in GPIO mode where it is configured differently, without any I2C connection, but this is not supported yet. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20231020-ptn36502-v2-1-b37a337d463e@fairphone.com Signed-off-by: Greg Kroah-Hartman --- .../devicetree/bindings/usb/nxp,ptn36502.yaml | 94 ++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/nxp,ptn36502.yaml (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/nxp,ptn36502.yaml b/Documentation/devicetree/bindings/usb/nxp,ptn36502.yaml new file mode 100644 index 000000000000..eee548ac1abe --- /dev/null +++ b/Documentation/devicetree/bindings/usb/nxp,ptn36502.yaml @@ -0,0 +1,94 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/nxp,ptn36502.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP PTN36502 Type-C USB 3.1 Gen 1 and DisplayPort v1.2 combo redriver + +maintainers: + - Luca Weiss + +properties: + compatible: + enum: + - nxp,ptn36502 + + reg: + maxItems: 1 + + vdd18-supply: + description: Power supply for VDD18 pin + + retimer-switch: + description: Flag the port as possible handle of SuperSpeed signals retiming + type: boolean + + orientation-switch: + description: Flag the port as possible handler of orientation switching + type: boolean + + ports: + $ref: /schemas/graph.yaml#/properties/ports + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: Super Speed (SS) Output endpoint to the Type-C connector + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Super Speed (SS) Input endpoint from the Super-Speed PHY + + port@2: + $ref: /schemas/graph.yaml#/properties/port + description: + Sideband Use (SBU) AUX lines endpoint to the Type-C connector for the purpose of + handling altmode muxing and orientation switching. + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + typec-mux@1a { + compatible = "nxp,ptn36502"; + reg = <0x1a>; + + vdd18-supply = <&usb_redrive_1v8>; + + retimer-switch; + orientation-switch; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + usb_con_ss: endpoint { + remote-endpoint = <&typec_con_ss>; + }; + }; + port@1 { + reg = <1>; + phy_con_ss: endpoint { + remote-endpoint = <&usb_phy_ss>; + }; + }; + port@2 { + reg = <2>; + usb_con_sbu: endpoint { + remote-endpoint = <&typec_dp_aux>; + }; + }; + }; + }; + }; +... -- cgit v1.2.3 From 98bad5bc447ec962988a48c92f7d0f8c4dc473d2 Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Fri, 20 Oct 2023 16:11:40 +0200 Subject: dt-bindings: usb: add rk3588 compatible to rockchip,dwc3 RK3588 has three DWC3 controllers. Two of them are fully functional in host, device and OTG mode including USB2 support. They are connected to dedicated PHYs, that also support USB-C's DisplayPort alternate mode. The third controller is connected to one of the combphy's shared with PCIe and SATA. It can only be used in host mode and does not support USB2. Compared to the other controllers this one needs some extra clocks. While adding the extra clocks required by RK3588, I noticed grf_clk is not available on RK3568, so I disallowed it for that platform. Signed-off-by: Sebastian Reichel Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20231020150022.48725-2-sebastian.reichel@collabora.com Signed-off-by: Greg Kroah-Hartman --- .../devicetree/bindings/usb/rockchip,dwc3.yaml | 60 ++++++++++++++++++++-- 1 file changed, 55 insertions(+), 5 deletions(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml index 291844c8f3e1..264c2178d61d 100644 --- a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml @@ -20,9 +20,6 @@ description: Type-C PHY Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt -allOf: - - $ref: snps,dwc3.yaml# - select: properties: compatible: @@ -30,6 +27,7 @@ select: enum: - rockchip,rk3328-dwc3 - rockchip,rk3568-dwc3 + - rockchip,rk3588-dwc3 required: - compatible @@ -39,6 +37,7 @@ properties: - enum: - rockchip,rk3328-dwc3 - rockchip,rk3568-dwc3 + - rockchip,rk3588-dwc3 - const: snps,dwc3 reg: @@ -58,7 +57,9 @@ properties: Master/Core clock, must to be >= 62.5 MHz for SS operation and >= 30MHz for HS operation - description: - Controller grf clock + Controller grf clock OR UTMI clock + - description: + PIPE clock clock-names: minItems: 3 @@ -66,7 +67,10 @@ properties: - const: ref_clk - const: suspend_clk - const: bus_clk - - const: grf_clk + - enum: + - grf_clk + - utmi + - const: pipe power-domains: maxItems: 1 @@ -86,6 +90,52 @@ required: - clocks - clock-names +allOf: + - $ref: snps,dwc3.yaml# + - if: + properties: + compatible: + contains: + const: rockchip,rk3328-dwc3 + then: + properties: + clocks: + minItems: 3 + maxItems: 4 + clock-names: + minItems: 3 + items: + - const: ref_clk + - const: suspend_clk + - const: bus_clk + - const: grf_clk + - if: + properties: + compatible: + contains: + const: rockchip,rk3568-dwc3 + then: + properties: + clocks: + maxItems: 3 + clock-names: + maxItems: 3 + - if: + properties: + compatible: + contains: + const: rockchip,rk3588-dwc3 + then: + properties: + clock-names: + minItems: 3 + items: + - const: ref_clk + - const: suspend_clk + - const: bus_clk + - const: utmi + - const: pipe + examples: - | #include -- cgit v1.2.3 From d026fc7b73a58ea3b2fe567674e71cccd90f6a84 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 24 Oct 2023 11:50:57 +0200 Subject: Revert "dt-bindings: usb: qcom,dwc3: Add bindings for SC8280 Multiport" This reverts commit ca58c4ae75b65e1d78408b134f129ea91e9595b8. The patches for the features that these bindings described are still under active development, so odds are these bindings will also have to be changed in the future. As no in-tree code requires these bindings at the moment, revert them. Reported-by: Johan Hovold Link: https://lore.kernel.org/r/ZTeObdjSSok0tttg@hovoldconsulting.com Cc: Krishna Kurapati Cc: Krzysztof Kozlowski Signed-off-by: Greg Kroah-Hartman --- .../devicetree/bindings/usb/qcom,dwc3.yaml | 29 ---------------------- 1 file changed, 29 deletions(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml index 51a5581ce692..e889158ca205 100644 --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml @@ -30,7 +30,6 @@ properties: - qcom,sc7180-dwc3 - qcom,sc7280-dwc3 - qcom,sc8280xp-dwc3 - - qcom,sc8280xp-dwc3-mp - qcom,sdm660-dwc3 - qcom,sdm670-dwc3 - qcom,sdm845-dwc3 @@ -264,7 +263,6 @@ allOf: contains: enum: - qcom,sc8280xp-dwc3 - - qcom,sc8280xp-dwc3-mp then: properties: clocks: @@ -488,33 +486,6 @@ allOf: - const: dm_hs_phy_irq - const: ss_phy_irq - - if: - properties: - compatible: - contains: - enum: - - qcom,sc8280xp-dwc3-mp - then: - properties: - interrupts: - maxItems: 14 - interrupt-names: - items: - - const: pwr_event_1 - - const: pwr_event_2 - - const: pwr_event_3 - - const: pwr_event_4 - - const: dp_hs_phy_1 - - const: dm_hs_phy_1 - - const: dp_hs_phy_2 - - const: dm_hs_phy_2 - - const: dp_hs_phy_3 - - const: dm_hs_phy_3 - - const: dp_hs_phy_4 - - const: dm_hs_phy_4 - - const: ss_phy_1 - - const: ss_phy_2 - additionalProperties: false examples: -- cgit v1.2.3 From ec098970364234411f39cd6821e6f95937b4070c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 24 Oct 2023 11:51:04 +0200 Subject: Revert "dt-bindings: usb: Add bindings for multiport properties on DWC3 controller" This reverts commit eb3f1d9e42b1499152442e97b51bc1bcfee29d71. The patches for the features that these bindings described are still under active development, so odds are these bindings will also have to be changed in the future. As no in-tree code requires these bindings at the moment, revert them. Reported-by: Johan Hovold Link: https://lore.kernel.org/r/ZTeObdjSSok0tttg@hovoldconsulting.com Cc: Bjorn Andersson Cc: Krishna Kurapati Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index d81c2e849ca9..ee5af4b381b1 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -85,16 +85,15 @@ properties: phys: minItems: 1 - maxItems: 8 + maxItems: 2 phy-names: minItems: 1 - maxItems: 8 - oneOf: - - items: - enum: [ usb2-phy, usb3-phy ] - - items: - pattern: "^usb[23]-port[0-3]$" + maxItems: 2 + items: + enum: + - usb2-phy + - usb3-phy power-domains: description: -- cgit v1.2.3 From fad89aa14c35f469ea7d3bf49ee1d5840eea0375 Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Fri, 20 Oct 2023 11:33:18 +0200 Subject: dt-bindings: usb: fsa4480: Add data-lanes property to endpoint Allow specifying data-lanes to reverse the muxing orientation between AUX+/- and SBU1/2 where necessary by the hardware design. In the mux there's a switch that needs to be controlled from the OS, and it either connects AUX+ -> SBU1 and AUX- -> SBU2, or the reverse: AUX+ -> SBU2 and AUX- -> SBU1, depending on the orientation of how the USB-C connector is plugged in. With this data-lanes property we can now specify that AUX+ and AUX- connections are swapped between the SoC and the mux, therefore the OS needs to consider this and reverse the direction of this switch in the mux. _______ _______ | | | |-- HP --| | |-- MIC --| |or SoC | | MUX |-- SBU1 ---> To the USB-C Codec |-- AUX+ --| |-- SBU2 ---> connected |-- AUX- --| | ______| |_____| (thanks to Neil Armstrong for this ASCII art) Signed-off-by: Luca Weiss Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20231020-fsa4480-swap-v2-1-9a7f9bb59873@fairphone.com Signed-off-by: Greg Kroah-Hartman --- .../devicetree/bindings/usb/fcs,fsa4480.yaml | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml b/Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml index f6e7a5c1ff0b..86f6d633c2fb 100644 --- a/Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml +++ b/Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml @@ -32,10 +32,37 @@ properties: type: boolean port: - $ref: /schemas/graph.yaml#/properties/port + $ref: /schemas/graph.yaml#/$defs/port-base description: A port node to link the FSA4480 to a TypeC controller for the purpose of handling altmode muxing and orientation switching. + unevaluatedProperties: false + + properties: + endpoint: + $ref: /schemas/graph.yaml#/$defs/endpoint-base + unevaluatedProperties: false + + properties: + data-lanes: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: + Specifies how the AUX+/- lines are connected to SBU1/2. + oneOf: + - items: + - const: 0 + - const: 1 + description: | + Default AUX/SBU layout + - AUX+ connected to SBU2 + - AUX- connected to SBU1 + - items: + - const: 1 + - const: 0 + description: | + Swapped AUX/SBU layout + - AUX+ connected to SBU1 + - AUX- connected to SBU2 required: - compatible -- cgit v1.2.3 From c3097719e438ab6d07b8b20b5575f985ab07b5a5 Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Fri, 20 Oct 2023 11:33:20 +0200 Subject: dt-bindings: usb: fsa4480: Add compatible for OCP96011 The Orient-Chip OCP96011 is generally compatible with the FSA4480, add a compatible for it with the fallback on fsa4480. However the AUX/SBU connections are expected to be swapped compared to FSA4480, so document this in the data-lanes description. Signed-off-by: Luca Weiss Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20231020-fsa4480-swap-v2-3-9a7f9bb59873@fairphone.com Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml b/Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml index 86f6d633c2fb..f9410eb76a62 100644 --- a/Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml +++ b/Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml @@ -11,8 +11,12 @@ maintainers: properties: compatible: - enum: - - fcs,fsa4480 + oneOf: + - const: fcs,fsa4480 + - items: + - enum: + - ocs,ocp96011 + - const: fcs,fsa4480 reg: maxItems: 1 @@ -53,16 +57,22 @@ properties: - const: 0 - const: 1 description: | - Default AUX/SBU layout + Default AUX/SBU layout (FSA4480) - AUX+ connected to SBU2 - AUX- connected to SBU1 + Default AUX/SBU layout (OCP96011) + - AUX+ connected to SBU1 + - AUX- connected to SBU2 - items: - const: 1 - const: 0 description: | - Swapped AUX/SBU layout + Swapped AUX/SBU layout (FSA4480) - AUX+ connected to SBU1 - AUX- connected to SBU2 + Swapped AUX/SBU layout (OCP96011) + - AUX+ connected to SBU2 + - AUX- connected to SBU1 required: - compatible -- cgit v1.2.3