From patchwork Sun Sep 1 04:06:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 824678 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25270149C76 for ; Sun, 1 Sep 2024 04:07:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725163652; cv=none; b=RzCEiaakzGGk2U0YTL5X5tXle/QB4Nb4vokjGGg3ghglhrCTJ7vRciQWNtIb+zPzs6roL3JRdcPpRC0ooUGMZiCqhzTkXZAJm6H3lMKp5Jy/5XbuJVyjoGML2AJ4LzGCeZMIvWqBiVEAToRQXudWjJydUyxeGhkjQ+e1U0X/SV0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725163652; c=relaxed/simple; bh=RUpzr9ZKBqIyyOycrXXNoFY+qDo5GiSWo5OPRiGL5UY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZZhU7XiZbvO2L0FWYGu49TMl949AnVBwmM3KqNfM7r/lCXVmZeNC84+krEyhWtnGb74mZZqbeMH4rp3CUTvGgGlXnUlviytK3VSX509cMgAG4Thb4RRuxEvSQRpypOLa57GWkDOF4rNEW557SBwh8JrvyZkevmjJObJOAGVEaaY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=hS0ZCq3W; arc=none smtp.client-ip=209.85.167.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="hS0ZCq3W" Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-3df16ece2c2so995647b6e.2 for ; Sat, 31 Aug 2024 21:07:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1725163650; x=1725768450; darn=vger.kernel.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=Wd502yvg5fXt4u5g230ZTpdeyPtCH4Yq39fj6qZgjT4=; b=hS0ZCq3WU51NbOpI4w0Y13/ZE7ykW4L8Kj4Klg8o5BeGkCcrN2TlUWzKg3ELQ/BIRK x5KfeZDgICv4TjRQozf/ombUMn/aC45yskW3Mo7XKPpSYFxhTPYvPXrbzrd9ZSPldJWT Cf01E0gPnKW1WGqAeUeyLsnvYKABf6Pz5nPso= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725163650; x=1725768450; 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=Wd502yvg5fXt4u5g230ZTpdeyPtCH4Yq39fj6qZgjT4=; b=REpbaLsV/r2yfqbPOMvROz3npZzt5Nfm6PSdjINaaDpW1tlpOBeXkwIsxgJSbtVd2E 8ei2YmGQbR/j5WBqXlF8dTVOebMc5WKQvO44LWXPSyL/g5D5BvsQ5/ZwE6ZWGSbUJFIH CHOyTpRg6pxZUnMBbH9BnvPfLXUfD3V/CdQbiFQyaXOOTtaDZHHVVRNv3l4aSXCKRIUb AkEbnAUm1oY2Vkll+VonbbTvo7fkMsNOYH8EaVSDxHGMBaARGPoW03Kf5rP0TOTpNDsl Rea5PHuDHxWC4QwR9pyZjf5rQD7i5oOR9QyHyT5R8+gQiRFOcJoH7T6Rfyl07XYDbBby hY7A== X-Forwarded-Encrypted: i=1; AJvYcCUBy/UUolqeXDmMK1cveiQ89+GvXZg30IfMGSZoIDxX3BtI16T3n2IprnGEwOHZpM2bX5C12edIDLg=@vger.kernel.org X-Gm-Message-State: AOJu0YxMmqHBcmA3cfEsNNy8ACd8jE8CHoQJZGeROihE2dGe2ScZIsnj tlKE8cez0Jqdk6w2S/jh2pY7dWerHREzPtRaDskMH9aisPRQ7FZxDZj8Q3IcQQ== X-Google-Smtp-Source: AGHT+IGL4OiCHHZFsgZPnNJ0c3FJUh9XkC9nxzYLew8976ZXhgGWIxU50B53RDoHj8H5q7Hy8p3c6w== X-Received: by 2002:a05:6808:318c:b0:3dc:299d:c505 with SMTP id 5614622812f47-3df22d06635mr3681624b6e.37.1725163650076; Sat, 31 Aug 2024 21:07:30 -0700 (PDT) Received: from localhost (210.73.125.34.bc.googleusercontent.com. [34.125.73.210]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-715e5763a67sm4833459b3a.216.2024.08.31.21.07.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 31 Aug 2024 21:07:29 -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 13/18] dt-bindings: usb-switch: Extend for DisplayPort altmode Date: Sat, 31 Aug 2024 21:06:51 -0700 Message-ID: <20240901040658.157425-14-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> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Extend the usb-switch binding to support DisplayPort (DP) alternate modes. A third port for the DP signal is necessary when a mode-switch is muxing USB and DP together onto a usb type-c connector. Add data-lanes to the usbc output node to allow a device using this binding to remap the data lanes on the output. Add an example to show how this new port can be used. 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 | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/usb-switch.yaml b/Documentation/devicetree/bindings/usb/usb-switch.yaml index f5dc7e23b134..816f295f322f 100644 --- a/Documentation/devicetree/bindings/usb/usb-switch.yaml +++ b/Documentation/devicetree/bindings/usb/usb-switch.yaml @@ -52,6 +52,14 @@ properties: endpoint: $ref: '#/$defs/usbc-in-endpoint' + port@2: + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + + properties: + endpoint: + $ref: '#/$defs/dp-endpoint' + oneOf: - required: - port @@ -65,6 +73,19 @@ $defs: $ref: /schemas/graph.yaml#/$defs/endpoint-base description: Super Speed (SS) output endpoint to a type-c connector unevaluatedProperties: false + properties: + data-lanes: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: | + An array of physical USB Type-C data lane indexes. + - 0 is SSRX1 lane + - 1 is SSTX1 lane + - 2 is SSTX2 lane + - 3 is SSRX2 lane + minItems: 4 + maxItems: 4 + items: + maximum: 3 usbc-in-endpoint: $ref: /schemas/graph.yaml#/$defs/endpoint-base @@ -79,7 +100,75 @@ $defs: items: maximum: 8 + dp-endpoint: + $ref: /schemas/graph.yaml#/$defs/endpoint-base + description: DisplayPort (DP) input from the DP PHY + unevaluatedProperties: false + properties: + data-lanes: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: | + An array of physical DP data lane indexes + - 0 is DP ML0 lane + - 1 is DP ML1 lane + - 2 is DP ML2 lane + - 3 is DP ML3 lane + oneOf: + - items: + - const: 0 + - const: 1 + - items: + - const: 0 + - const: 1 + - const: 2 + - const: 3 + examples: + # A USB + DP mode and orientation switch which muxes DP altmode + # and USB onto a usb-c-connector node. + - | + device { + mode-switch; + 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>; + data-lanes = <0 1 2 3>; + }; + }; + + port@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + endpoint { + remote-endpoint = <&usb_ss_phy>; + }; + }; + + port@2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + + endpoint { + remote-endpoint = <&dp_phy>; + data-lanes = <0 1 2 3>; + }; + }; + }; + }; + # A USB orientation switch which flips the pin orientation # for a usb-c-connector node. - |