From patchwork Mon Jan 15 09:29:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 188085 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp1594345dyc; Mon, 15 Jan 2024 01:30:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKZFi8tfDK07yrCzRhc50QKVYeVZhwjuT8wDyTwjaHZK4iL23sqs9T5DuIh5eRPTbD24Pw X-Received: by 2002:a05:6e02:20c8:b0:35d:637e:c3d2 with SMTP id 8-20020a056e0220c800b0035d637ec3d2mr8031833ilq.20.1705311024349; Mon, 15 Jan 2024 01:30:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705311024; cv=none; d=google.com; s=arc-20160816; b=wtXX0nAzZf0GL26o0p96xYsy14r4lWHyNaloMoH6LPXevDc0XwGRtLCJ3ZonTKqzDe a0uObNT72raNbMP3zk4b+NWZyweDWCm7RlqWhF79W4jZviClPqwMktFIcYPy2PmEDe2e O/U+VLQv1dEgxN2lMBsEEzQc6IuJ58Ba73URw1SCdmx+tc0NaKqPk/Q7mQNuehjSKyS+ hIx5iciwNB3Zeu5hfr/P+V2+9wTazmsEen76CWncO6LoonK6LtK2FPtQvGFEbdp+of48 M94nPIflWROVFWyYXh53oRkrxxh3gRQ41sxD3W13wiQ/gPfxeVuTUYkbGWPcb7FNuzKj oAVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=VoDXqFFLk9wV6ltZ99cVwiQyTGhTczHKPc4pVMyihu8=; fh=hRALtIPss7f75te1daDgBudPuNzxIy6WhrJ6EW9dIXk=; b=PYbHnAdXKZUi0Uyn6g+ribBC6QMAKM+gn25BfRTH6J9o+mMZfodjC8PM4qSpVgPO8U 8bpBzilqw0v6xcPWtkWW/qr8s72TwY+wsLp9lcU8QY47XOAEUiZlWLA4fQS/VkLJvgjL KPiB3ciT8esAN4XibgJ+kua9FIdXJbpx/9xYj9fmuOrmvixRIdJNSOokMcNPKYAkajdr k7GJxeraszVXG6iArOxExVag3zWQkdSfR2hmyUInq+1s9yNAnYrlyv3SkY+VfohJPG6S 4NBrfYhHm/MmFJtreTUwbesIpNs9CSumWUqAHyjWQ6Ms7W466SxeftZZ+SM2XKCvgCOE KDDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TPsdg61j; spf=pass (google.com: domain of linux-kernel+bounces-25799-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25799-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id r65-20020a632b44000000b005cdc2cc9a15si8311284pgr.742.2024.01.15.01.30.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 01:30:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25799-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TPsdg61j; spf=pass (google.com: domain of linux-kernel+bounces-25799-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25799-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7A9ADB207D2 for ; Mon, 15 Jan 2024 09:30:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75829F4EF; Mon, 15 Jan 2024 09:29:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TPsdg61j" Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 4EA65EAE7 for ; Mon, 15 Jan 2024 09:29:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-557e76e1bd6so7993524a12.1 for ; Mon, 15 Jan 2024 01:29:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705310966; x=1705915766; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VoDXqFFLk9wV6ltZ99cVwiQyTGhTczHKPc4pVMyihu8=; b=TPsdg61jtSV0YjC12KsS4M2mEn4vSfDQVUWkx71Mu0uy+zCn5XzeSibd20TxXAeHT7 KBENF0v9/+4TI1KkEIUm3qpdHdF1tkwJwexwfTBgMbYKUBMnnAdClt2OPaeRXIJDKfi2 kXWHCzKgerRuM0u0VmGJMx+g2/fg7cuIxPAC6i1ZIQ5K+xUzaqkzQXwJ1yG85X4KUzxu 8L//EMFx/zFdkATJ5lV7YkYsm38gY4RQ/lM+kZKw7/56RcuvDqtIDo1yLNOzstdyfCbR ZrxX+8lcw9pABGKDE1muVR8nis4aH5FR1DizjMsm1CNQVfkV5iTcXBkAATzxiuu/HRHg Qvhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705310966; x=1705915766; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VoDXqFFLk9wV6ltZ99cVwiQyTGhTczHKPc4pVMyihu8=; b=db1lHqxmQA53sIhdinXhB2GE9AfK7EFHJmXfwr61k/DfnnWM1TC0rE3mDY6He00IIh BSbE4zvSX4NFvCmSUl+Slin32venOdBIARupdpDKbA29GCVJbYXPrGcJO+QR43DF0cYb /Y2/jqAqlCNEPrMBodPy3r84TG2eLl0t/8p3Lvp7cc4EjlI8z48XYmu7Q6n8EOhWOPTC ZIVxWKl81FiXPioPtpe8lPqvmVc9FZoFjt1s/8+K2X+cR1xlDvnO7zThPRR8tKyyhovb xCDCZidpt6+djE9vNxbdEl+u0mLXWwz8xiZDk2N+1+1Ce+UdZC+NAeAPVe+RRrinDEwz 5iog== X-Gm-Message-State: AOJu0YwcaV3gTeJjgIhv4ikQ9lF7GNUO5Ft1aoi4M0Xrdec11MWuz+dX qM4pm+DZe34X+vlt4tr3PRaYJQ8uuec+Hg== X-Received: by 2002:a05:6402:5148:b0:558:91c4:2e61 with SMTP id n8-20020a056402514800b0055891c42e61mr2544008edd.40.1705310966547; Mon, 15 Jan 2024 01:29:26 -0800 (PST) Received: from krzk-bin.. ([178.197.215.66]) by smtp.gmail.com with ESMTPSA id e10-20020a056402104a00b005593a4e1635sm1459143edu.11.2024.01.15.01.29.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 01:29:26 -0800 (PST) From: Krzysztof Kozlowski To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Luca Weiss , Neil Armstrong , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH] dt-bindings: usb: add common Type-C USB Switch schema Date: Mon, 15 Jan 2024 10:29:23 +0100 Message-Id: <20240115092923.105275-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788148212936820819 X-GMAIL-MSGID: 1788148212936820819 Several bindings implement parts of Type-C USB orientation and mode switching, and retiming. Keep definition of such properties in one place, new usb-switch schema, to avoid duplicate defines. Signed-off-by: Krzysztof Kozlowski --- .../devicetree/bindings/usb/fcs,fsa4480.yaml | 12 ++-- .../devicetree/bindings/usb/gpio-sbu-mux.yaml | 12 ++-- .../devicetree/bindings/usb/nxp,ptn36502.yaml | 12 ++-- .../bindings/usb/onnn,nb7vpq904m.yaml | 13 ++-- .../bindings/usb/qcom,wcd939x-usbss.yaml | 12 ++-- .../devicetree/bindings/usb/usb-switch.yaml | 68 +++++++++++++++++++ 6 files changed, 93 insertions(+), 36 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/usb-switch.yaml diff --git a/Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml b/Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml index f9410eb76a62..8b25b9a01ced 100644 --- a/Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml +++ b/Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml @@ -27,13 +27,8 @@ properties: vcc-supply: description: power supply (2.7V-5.5V) - 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 + mode-switch: true + orientation-switch: true port: $ref: /schemas/graph.yaml#/$defs/port-base @@ -79,6 +74,9 @@ required: - reg - port +allOf: + - $ref: usb-switch.yaml# + additionalProperties: false examples: diff --git a/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml b/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml index d3b2b666ec2a..88e1607cf053 100644 --- a/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml +++ b/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml @@ -33,13 +33,8 @@ properties: 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 + mode-switch: true + orientation-switch: true port: $ref: /schemas/graph.yaml#/properties/port @@ -54,6 +49,9 @@ required: - orientation-switch - port +allOf: + - $ref: usb-switch.yaml# + additionalProperties: false examples: diff --git a/Documentation/devicetree/bindings/usb/nxp,ptn36502.yaml b/Documentation/devicetree/bindings/usb/nxp,ptn36502.yaml index eee548ac1abe..d805dde80796 100644 --- a/Documentation/devicetree/bindings/usb/nxp,ptn36502.yaml +++ b/Documentation/devicetree/bindings/usb/nxp,ptn36502.yaml @@ -20,13 +20,8 @@ properties: vdd18-supply: description: Power supply for VDD18 pin - retimer-switch: - description: Flag the port as possible handle of SuperSpeed signals retiming - type: boolean - - orientation-switch: - description: Flag the port as possible handler of orientation switching - type: boolean + orientation-switch: true + retimer-switch: true ports: $ref: /schemas/graph.yaml#/properties/ports @@ -49,6 +44,9 @@ required: - compatible - reg +allOf: + - $ref: usb-switch.yaml# + additionalProperties: false examples: diff --git a/Documentation/devicetree/bindings/usb/onnn,nb7vpq904m.yaml b/Documentation/devicetree/bindings/usb/onnn,nb7vpq904m.yaml index c0201da002f6..589914d22bf2 100644 --- a/Documentation/devicetree/bindings/usb/onnn,nb7vpq904m.yaml +++ b/Documentation/devicetree/bindings/usb/onnn,nb7vpq904m.yaml @@ -21,14 +21,8 @@ properties: description: power supply (1.8V) enable-gpios: true - - retimer-switch: - description: Flag the port as possible handle of SuperSpeed signals retiming - type: boolean - - orientation-switch: - description: Flag the port as possible handler of orientation switching - type: boolean + orientation-switch: true + retimer-switch: true ports: $ref: /schemas/graph.yaml#/properties/ports @@ -95,6 +89,9 @@ required: - compatible - reg +allOf: + - $ref: usb-switch.yaml# + additionalProperties: false examples: diff --git a/Documentation/devicetree/bindings/usb/qcom,wcd939x-usbss.yaml b/Documentation/devicetree/bindings/usb/qcom,wcd939x-usbss.yaml index 7ddfd3313a18..96346723f3e9 100644 --- a/Documentation/devicetree/bindings/usb/qcom,wcd939x-usbss.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,wcd939x-usbss.yaml @@ -35,13 +35,8 @@ properties: vdd-supply: description: USBSS VDD 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 + mode-switch: true + orientation-switch: true ports: $ref: /schemas/graph.yaml#/properties/ports @@ -63,6 +58,9 @@ required: - reg - ports +allOf: + - $ref: usb-switch.yaml# + additionalProperties: false examples: diff --git a/Documentation/devicetree/bindings/usb/usb-switch.yaml b/Documentation/devicetree/bindings/usb/usb-switch.yaml new file mode 100644 index 000000000000..0d0b60234d1f --- /dev/null +++ b/Documentation/devicetree/bindings/usb/usb-switch.yaml @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/usb-switch.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: USB Orientation and Mode Switches Common Properties + +maintainers: + - Greg Kroah-Hartman + +description: + Common properties for devices handling USB mode and orientation switching. + +properties: + mode-switch: + description: Possible handle of altmode switching + type: boolean + + orientation-switch: + description: Possible handler of orientation switching + type: boolean + + retimer-switch: + description: Possible handle of SuperSpeed signals retiming + type: boolean + + port: + $ref: /schemas/graph.yaml#/properties/port + description: + A port node to link the device to a TypeC controller for the purpose of + handling altmode muxing and orientation switching. + + ports: + $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 + + port@1: + $ref: /schemas/graph.yaml#/$defs/port-base + description: + Super Speed (SS) Input endpoint from the Super-Speed PHY + unevaluatedProperties: false + + properties: + endpoint: + $ref: /schemas/graph.yaml#/$defs/endpoint-base + # additionalProperties: true + unevaluatedProperties: false + properties: + data-lanes: + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 1 + maxItems: 8 + uniqueItems: true + items: + maximum: 8 + +oneOf: + - required: + - port + - required: + - ports + +additionalProperties: true