[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230504194757.GA145231-robh@kernel.org>
Date: Thu, 4 May 2023 14:47:57 -0500
From: Rob Herring <robh@...nel.org>
To: Marco Felsch <m.felsch@...gutronix.de>
Cc: andreas@...al.se, jun.li@....com,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Bjorn Andersson <andersson@...nel.org>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Guenter Roeck <linux@...ck-us.net>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
linux-usb@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v2 1/4] dt-bindings: usb: gpio-sbu-mux: add support for
ss-data lanes mux
On Thu, May 04, 2023 at 03:46:50PM +0200, Marco Felsch wrote:
> This adds the support for GPIO based USB-C SS data lane muxing.
>
> Signed-off-by: Marco Felsch <m.felsch@...gutronix.de>
> ---
> .../devicetree/bindings/usb/gpio-sbu-mux.yaml | 82 +++++++++++++++++++---
> 1 file changed, 71 insertions(+), 11 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml b/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml
> index bf4b1d016e1f..796f3283ac02 100644
> --- a/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml
> +++ b/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml
> @@ -4,24 +4,26 @@
> $id: "http://devicetree.org/schemas/usb/gpio-sbu-mux.yaml#"
> $schema: "http://devicetree.org/meta-schemas/core.yaml#"
>
> -title: GPIO-based SBU mux
> +title: GPIO-based SS/SBU mux
>
> maintainers:
> - Bjorn Andersson <andersson@...nel.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.
> + In USB Type-C applications the SS/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.
Consider whether the mux-control binding would work for this purpose.
Then what controls the muxing can be anything.
>
> properties:
> compatible:
> - items:
> - - enum:
> - - onnn,fsusb43l10x
> - - pericom,pi3usb102
> - - const: gpio-sbu-mux
> + oneOf:
> + - items:
> + - enum:
> + - onnn,fsusb43l10x
> + - pericom,pi3usb102
> + - const: gpio-sbu-mux
> + - const: gpio-ss-mux
>
> enable-gpios:
> description: Switch enable GPIO
> @@ -50,10 +52,18 @@ required:
> - compatible
> - enable-gpios
> - select-gpios
> - - mode-switch
> - orientation-switch
> - port
>
> +if:
> + properties:
> + compatible:
> + contains:
> + const: gpio-sbu-mux
> +then:
> + required:
> + - mode-switch
> +
> additionalProperties: false
>
> examples:
> @@ -107,4 +117,54 @@ 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_ss_mux_out: endpoint {
> + remote-endpoint = <&ss_mux_in>;
> + };
> + };
port@2 already has a defined use for SBU signals. You can't use it.
port@1 corresponds to the SS signals.
> + };
> + };
> + };
> +
> + usb-ss-mux {
> + compatible = "gpio-ss-mux";
> +
> + enable-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>;
> + select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>;
> +
> + orientation-switch;
> +
> + port {
This is a mux device. It needs an output port and N input ports.
Please present a complete picture of your USB-C related h/w. It's hard
to review with just 'I have a GPIO controlling the SS muxing'.
Rob
Powered by blists - more mailing lists