From patchwork Mon Aug 19 22:38:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 13769110 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 5E0C1200116 for ; Mon, 19 Aug 2024 22:39:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724107143; cv=none; b=tTJUiXRMNDTiKjJta4kFdU5vkHQtSCMdWtbbfUSk+d+X5/wfM+0y/vDG+n8F2x6N+bWMHlYDIYccr/1lJzDD/LBu5NIgCtjzq4/JFsu9GAWbh7/y+ht8PY1hHOZA/MfCaOF61cJFyZwrPbshy7sJtvEbyGg9TvuXSyEQGQ4oUvo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724107143; c=relaxed/simple; bh=8tqmUj+sdPUk4dj2c30W8lWQ9x5+wvhFnf8zSNBC8MQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fvnMG/PvAVOdfgJ18/sRcurloYVEzQqScIzY8qqiQwd9B2chm7W74slze76WPyKbhwaN/0zmMiCw9DY8DSGB6GHz55hizoY+MoU0wZX6LBt0aR4c4j05V9pqXaq1scaDqDKIvwKg+03iqPo1eenqkGCEvLaJsMk7D6BPZrKwZ2Y= 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=CEI3RWe6; arc=none smtp.client-ip=209.85.214.178 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="CEI3RWe6" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-201f2b7fe0dso31693755ad.1 for ; Mon, 19 Aug 2024 15:39:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724107141; x=1724711941; darn=lists.linux.dev; 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=MEGuE2jPeE6QbHnwj3cv7uloVpjVvE++iKPlChg2NtM=; b=CEI3RWe6D2p3WqtccZ4dGHTe1oWnQM+3CNNHA1wtMmJLzZ5S8s6totq01mt3xHzuH7 cFPaL0u4kEx8AE8gKe2PjCobtWGATImwXMRuOUbnIu1Hlw5Vq+SEoD6fFzh0tMVMN3az GbkNrUYVtTYLRABM+ez26OV/atZJWl+pVnxnQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724107141; x=1724711941; 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=MEGuE2jPeE6QbHnwj3cv7uloVpjVvE++iKPlChg2NtM=; b=BX/rVnogewANvl+Nj8Q6ng07DVCqzEbsAVw2l6MZ0rVENC//rOmxetKlOZaFaao2rw 9SSJrmgNNPkceQbJ9whq2YHZsJcJ7NfKaFyKX6HFp3z3pp3ZZhvdw7y3kIlpczOQZp9i IKs2RpotGialsK0mKb5Ocs0qume0glNgNg96OhmZ22G+9JmEW08SSDz0fbPkXVX5ZOnq 2/WGO8XUz3y/oBxv0HACjMAy4gVGotlvY9Ka0eO9K8V2b/VjLAzaAau0GlRAV1Q2Ds3g tTtzBDQJju1C/YRIj/koJweAcB38ep3R/+1SQ3Yv6gP3H30xEruRjWY8356nHugUKaod wb/g== X-Gm-Message-State: AOJu0YwaBweULzSXGvRJQkKoODAkR+pDbNAabIaAe9AYo0Pw5XtJBNfU UDQM2EoO+EPHgANZBIJO1kMTfiXul9+/zfsJ1dvAPUpzhTHL1HpUxQJzHpCUE+ovk3wiZpqfhwQ = X-Google-Smtp-Source: AGHT+IE9StWMBY/V2J5PvOnUgBdk52braBes3M3nIXsSIZjwGAz5lGGOgioaoZfLakp02OBmpgHzZg== X-Received: by 2002:a17:902:e74b:b0:202:348d:4e85 with SMTP id d9443c01a7336-202348d51eemr70659895ad.39.1724107141155; Mon, 19 Aug 2024 15:39:01 -0700 (PDT) Received: from localhost (210.73.125.34.bc.googleusercontent.com. [34.125.73.210]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-201f03a3607sm67131795ad.250.2024.08.19.15.38.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Aug 2024 15:39:00 -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 Subject: [PATCH v3 11/17] dt-bindings: usb-switch: Extract endpoints to defs Date: Mon, 19 Aug 2024 15:38:25 -0700 Message-ID: <20240819223834.2049862-12-swboyd@chromium.org> X-Mailer: git-send-email 2.46.0.184.g6999bdac58-goog In-Reply-To: <20240819223834.2049862-1-swboyd@chromium.org> References: <20240819223834.2049862-1-swboyd@chromium.org> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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. Cc: Rob Herring 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 Reviewed-by: Rob Herring (Arm) --- .../devicetree/bindings/usb/usb-switch.yaml | 74 ++++++++++++++++--- 1 file changed, 62 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/usb-switch.yaml b/Documentation/devicetree/bindings/usb/usb-switch.yaml index da76118e73a5..5fc031b56fad 100644 --- a/Documentation/devicetree/bindings/usb/usb-switch.yaml +++ b/Documentation/devicetree/bindings/usb/usb-switch.yaml @@ -35,9 +35,13 @@ 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' + unevaluatedProperties: false port@1: $ref: /schemas/graph.yaml#/$defs/port-base @@ -47,16 +51,8 @@ properties: properties: endpoint: - $ref: /schemas/graph.yaml#/$defs/endpoint-base + $ref: '#/$defs/usbc-in-endpoint' unevaluatedProperties: false - properties: - data-lanes: - $ref: /schemas/types.yaml#/definitions/uint32-array - minItems: 1 - maxItems: 8 - uniqueItems: true - items: - maximum: 8 oneOf: - required: @@ -65,3 +61,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>; + }; + }; + }; + }; + +...