From patchwork Sun Sep 1 04:06:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 13786261 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CCED7CD342A for ; Sun, 1 Sep 2024 04:07:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 45A8B10E182; Sun, 1 Sep 2024 04:07:30 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="h5oy948p"; dkim-atps=neutral Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) by gabe.freedesktop.org (Postfix) with ESMTPS id CEB2F10E184 for ; Sun, 1 Sep 2024 04:07:28 +0000 (UTC) Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-39e6a1e0079so12533555ab.0 for ; Sat, 31 Aug 2024 21:07:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1725163648; x=1725768448; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lVAbaFTBXgnW+fAYVEBW9D2cgqLAHsvQgjfJBzfAY3s=; b=h5oy948pKL88ozYK+BonpVWVr7ENds8BSn6/oV1Le/busBIpIuNY2330iGoWJXVMWt KRiKJ1D5rHVwCcMeKkDZ9GpJR2MNxCE5I9RF2yqmk4XNfSrRdvoDiuprysScif/fKSjt jijXz/0PY47rkpRz/ioJE1gXKbZGeXgUFh1wc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725163648; x=1725768448; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lVAbaFTBXgnW+fAYVEBW9D2cgqLAHsvQgjfJBzfAY3s=; b=wUSVldXvLvlXgcGr5wjuCO2uQsqzgTiMDq8JYOBT4XNVY49rc7F3L4KNuLeV6SUHb3 34ej1eCCRTahLV8ftg77uiucVeycOlS4fW8J1edUC4Ab9EXOTTbhKo5YCNMApN3J6Ktb Asjnj87XyXHGWOYJdlKX5PSBy/sRo9MIjXqankA7h/zg4Fry5f0jsNyrdPEzEttjAzX/ 3nuBFSXEjNzBmPQXpdmNrNm8+o2Eq3yi80i9JKy09tjLPRbq9zMB3R8gYTvA+HS26E+n wkF7PC6VXVUutW3kC/MWjk+IKXrkItkHNCnPFTG4vruH2kIwaXtSNMTTHp9PSJs3Aesh fbYQ== X-Forwarded-Encrypted: i=1; AJvYcCXc4dWLqn2cg8z1jy+G9ZNjATecf6JQXPN/NhS43VqBVy+jESItTeR7ASbKh08IdiY+HPvhgGcnlDk=@lists.freedesktop.org X-Gm-Message-State: AOJu0YzbVx6gDB4VCeyHoPSIMh6Jp4Z7hsgxn+yvvaTEqdwN2HTCz55h cFP04uD9v2UpZ4bZCGGDjtLWX+APVMWwJ/+Cn2LLKEfK1j8/b+3ikaKsDuTljQ== X-Google-Smtp-Source: AGHT+IFsOTewMNJ0BJt0tAvMG/AJBfDBb9as9o8BHiOu5PQfrktxWGnHk+Ahlp9K/S8f1Bq4n28w/g== X-Received: by 2002:a05:6e02:1c42:b0:39f:5646:97da with SMTP id e9e14a558f8ab-39f56469978mr14867835ab.20.1725163647832; Sat, 31 Aug 2024 21:07:27 -0700 (PDT) Received: from localhost (210.73.125.34.bc.googleusercontent.com. [34.125.73.210]) by smtp.gmail.com with UTF8SMTPSA id 41be03b00d2f7-7d22e9d77f2sm5333884a12.89.2024.08.31.21.07.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 31 Aug 2024 21:07:27 -0700 (PDT) From: Stephen Boyd To: chrome-platform@lists.linux.dev Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, devicetree@vger.kernel.org, Douglas Anderson , Pin-yen Lin , Andrzej Hajda , Benson Leung , Conor Dooley , Daniel Vetter , David Airlie , Dmitry Baryshkov , dri-devel@lists.freedesktop.org, Guenter Roeck , Jernej Skrabec , Jonas Karlman , Krzysztof Kozlowski , Laurent Pinchart , Lee Jones , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Prashant Malani , Robert Foss , Rob Herring , Thomas Zimmermann , Tzung-Bi Shih , Alexandre Belloni , Andy Shevchenko , Daniel Scally , Greg Kroah-Hartman , Heikki Krogerus , Ivan Orlov , linux-acpi@vger.kernel.org, linux-usb@vger.kernel.org, Mika Westerberg , "Rafael J . Wysocki" , Sakari Ailus , Vinod Koul , "Rob Herring (Arm)" Subject: [PATCH v4 12/18] dt-bindings: usb-switch: Extract endpoints to defs Date: Sat, 31 Aug 2024 21:06:50 -0700 Message-ID: <20240901040658.157425-13-swboyd@chromium.org> X-Mailer: git-send-email 2.46.0.469.g59c65b2a67-goog In-Reply-To: <20240901040658.157425-1-swboyd@chromium.org> References: <20240901040658.157425-1-swboyd@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Move the usb-switch endpoint bindings to defs so that they can be reused by other bindings. Future users of this binding will have more than one type-c output node when they're muxing a single DP signal to more than one usb-c-connector. Add an example to show how this binding can be used and accelerate binding checks. Reviewed-by: Rob Herring (Arm) Cc: Krzysztof Kozlowski Cc: Conor Dooley Cc: Benson Leung Cc: Guenter Roeck Cc: Prashant Malani Cc: Tzung-Bi Shih Cc: Cc: Cc: Pin-yen Lin Signed-off-by: Stephen Boyd --- .../devicetree/bindings/usb/usb-switch.yaml | 74 +++++++++++++++---- 1 file changed, 61 insertions(+), 13 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/usb-switch.yaml b/Documentation/devicetree/bindings/usb/usb-switch.yaml index da76118e73a5..f5dc7e23b134 100644 --- a/Documentation/devicetree/bindings/usb/usb-switch.yaml +++ b/Documentation/devicetree/bindings/usb/usb-switch.yaml @@ -35,9 +35,12 @@ properties: $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 + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + + properties: + endpoint: + $ref: '#/$defs/usbc-out-endpoint' port@1: $ref: /schemas/graph.yaml#/$defs/port-base @@ -47,16 +50,7 @@ properties: properties: endpoint: - $ref: /schemas/graph.yaml#/$defs/endpoint-base - unevaluatedProperties: false - properties: - data-lanes: - $ref: /schemas/types.yaml#/definitions/uint32-array - minItems: 1 - maxItems: 8 - uniqueItems: true - items: - maximum: 8 + $ref: '#/$defs/usbc-in-endpoint' oneOf: - required: @@ -65,3 +59,57 @@ oneOf: - ports additionalProperties: true + +$defs: + usbc-out-endpoint: + $ref: /schemas/graph.yaml#/$defs/endpoint-base + description: Super Speed (SS) output endpoint to a type-c connector + unevaluatedProperties: false + + usbc-in-endpoint: + $ref: /schemas/graph.yaml#/$defs/endpoint-base + description: Super Speed (SS) input endpoint from the Super Speed PHY + unevaluatedProperties: false + properties: + data-lanes: + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 1 + maxItems: 8 + uniqueItems: true + items: + maximum: 8 + +examples: + # A USB orientation switch which flips the pin orientation + # for a usb-c-connector node. + - | + device { + orientation-switch; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + endpoint { + remote-endpoint = <&usb_c_connector>; + }; + }; + + port@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + endpoint { + remote-endpoint = <&usb_ss_phy>; + }; + }; + }; + }; + +...