devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Bjorn Andersson <quic_bjorande@quicinc.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Bjorn Andersson <andersson@kernel.org>,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] dt-bindings: usb: Introduce GPIO-based SBU mux
Date: Tue, 17 Jan 2023 11:56:57 -0600	[thread overview]
Message-ID: <20230117175657.GA3275060-robh@kernel.org> (raw)
In-Reply-To: <20230113041115.4189210-1-quic_bjorande@quicinc.com>

On Thu, Jan 12, 2023 at 08:11:14PM -0800, Bjorn Andersson wrote:
> From: Bjorn Andersson <bjorn.andersson@linaro.org>
> 
> Introduce a binding for GPIO-based mux hardware used for connecting,
> disconnecting and switching orientation of the SBU lines in USB Type-C
> applications.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
> ---
> 
> Changes since v1:
> - Expanded the example to indicate how this fits with the TCPM
> - Updated maintainer email address.
> 
>  .../devicetree/bindings/usb/gpio-sbu-mux.yaml | 110 ++++++++++++++++++
>  1 file changed, 110 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml
> 
> diff --git a/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml b/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml
> new file mode 100644
> index 000000000000..bf4b1d016e1f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml
> @@ -0,0 +1,110 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/usb/gpio-sbu-mux.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: GPIO-based SBU mux
> +
> +maintainers:
> +  - Bjorn Andersson <andersson@kernel.org>
> +
> +description:
> +  In USB Type-C applications the SBU lines needs to be connected, disconnected
> +  and swapped depending on the altmode and orientation. This binding describes
> +  a family of hardware solutions which switches between these modes using GPIO
> +  signals.
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - onnn,fsusb43l10x
> +          - pericom,pi3usb102
> +      - const: gpio-sbu-mux
> +
> +  enable-gpios:
> +    description: Switch enable GPIO
> +
> +  select-gpios:
> +    description: Orientation select
> +
> +  vcc-supply:
> +    description: power supply
> +
> +  mode-switch:
> +    description: Flag the port as possible handle of altmode switching
> +    type: boolean
> +
> +  orientation-switch:
> +    description: Flag the port as possible handler of orientation switching
> +    type: boolean
> +
> +  port:
> +    $ref: /schemas/graph.yaml#/properties/port
> +    description:
> +      A port node to link the SBU mux to a TypeC controller for the purpose of
> +      handling altmode muxing and orientation switching.
> +
> +required:
> +  - compatible
> +  - enable-gpios
> +  - select-gpios
> +  - mode-switch
> +  - orientation-switch
> +  - port
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    tcpm {
> +        connector {
> +            compatible = "usb-c-connector";
> +
> +            ports {
> +                #address-cells = <1>;
> +                #size-cells = <0>;
> +
> +                port@0 {
> +                    reg = <0>;
> +                    tcpm_hs_out: endpoint {
> +                        remote-endpoint = <&usb_hs_phy_in>;
> +                    };
> +                };
> +
> +                port@1 {
> +                    reg = <1>;
> +                    tcpm_ss_out: endpoint {
> +                        remote-endpoint = <&usb_ss_phy_in>;
> +                    };
> +                };
> +
> +                port@2 {
> +                    reg = <2>;
> +                    tcpm_sbu_out: endpoint {
> +                        remote-endpoint = <&sbu_mux_in>;
> +                    };
> +                };
> +            };
> +        };
> +    };
> +
> +    sbu-mux {
> +        compatible = "pericom,pi3usb102", "gpio-sbu-mux";
> +
> +        enable-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>;
> +        select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>;
> +
> +        mode-switch;
> +        orientation-switch;
> +
> +        port {
> +            sbu_mux_in: endpoint {
> +                remote-endpoint = <&tcpm_sbu_out>;
> +            };

Don't you need a connection to whatever drives SBU? Maybe your case is 
fixed because the phy does the DP/USB muxing? But the binding needs to 
support the worst case which I guess would be all the muxing/switching 
is done by separate board level components.

Rob

  parent reply	other threads:[~2023-01-17 18:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13  4:11 [PATCH v2 1/2] dt-bindings: usb: Introduce GPIO-based SBU mux Bjorn Andersson
2023-01-13  4:11 ` [PATCH v2 2/2] usb: typec: mux: " Bjorn Andersson
2023-01-17 11:56   ` Heikki Krogerus
2023-01-17 17:56 ` Rob Herring [this message]
2023-01-18 18:08   ` [PATCH v2 1/2] dt-bindings: usb: " Bjorn Andersson
2023-01-19 16:11     ` Rob Herring
2023-01-19 17:39       ` Bjorn Andersson
2023-01-24 16:00         ` Rob Herring
2023-01-24 17:04           ` Bjorn Andersson
2023-01-25  2:31             ` Rob Herring
2023-01-25 23:40               ` Bjorn Andersson
2023-01-30 16:48                 ` Rob Herring
2023-01-30 21:42                   ` Bjorn Andersson
2023-01-31 19:44                     ` Rob Herring
2023-01-31 23:58                       ` Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230117175657.GA3275060-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=andersson@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=quic_bjorande@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).