Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2861999rdb; Mon, 4 Dec 2023 09:23:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IE4pG1eAdeEUpJdwS9pWa2qGuy56TC3HawMueMdWfsoS8eDZfhjzXu1Tx74HZVMY0rUxlF+ X-Received: by 2002:a17:902:76c5:b0:1d0:6ffd:8376 with SMTP id j5-20020a17090276c500b001d06ffd8376mr1656777plt.129.1701710595587; Mon, 04 Dec 2023 09:23:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701710595; cv=none; d=google.com; s=arc-20160816; b=EBgzn4ujjO78UJ3xtX4GjY75WtZfkED38DKhfw0MnR0w3LU2/kijLDkZyHFbHmmQ5+ xr1Fx8iBpyCBIMIau7a45OWyl4T0LqlCncG0zknbPX3iL7vYoMIXJoumHWRVfwdTUqPc DTDKcRKuKzcItm859c3TMcNgSFXAYLawciiws0E86qe3i6wvIq5kom2ThC4HbJp7cL84 drALt4wtw21YpMZ4GTMLpQGjnxgYsbDot4yu16Au8mapU6zHggG8hxn8Pjcy0sUoB+8f p5SS4JNp5xwx3bCt6z8A5W7Dm0fpSK4Txum9IuRUZAbfzyAzaEY1CrAHGvMinjlqaEAr IuSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=QagWLgs2h5+JriAq/VG8W2CPIQLr8/EIksrOH5rGRok=; fh=gdvDTN+Cm+9LzcJd/caAKD4T07XKqXeUTdaNaPhPksY=; b=ss/1ufJR4mvtUumDkggd2hrAdYVacP6YZhiOf3Kml40aDi4tfRq4cekF+/fns7um4i CLdUg3eJKLFbzalGyI9GcIlJeb99PB+DlLgfMSw9NLwwIW32AeaCAFlmQSVlmp6rBE5u VDkUyrNmXvzzli900aUPgFminxbFqkHW/jzmo0e3V/IW2R/6psZEJlsMik2OIXgzFMKY kNODox80BTL4CRRlPq7rjTe5imFrgPerbjbrAiiFxJyAMF7faPz47KxmkeLjiJcUNhLb brpSM45rENIrWtkL4Vci5ogVW79uFzS5lWfyzDO8kSzKdNGQLMLJhJRT8Y70ecG2YYN1 ZIvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=iJHL+ain; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id t12-20020a170902a5cc00b001cc30cb3f9asi7816668plq.14.2023.12.04.09.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 09:23:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=iJHL+ain; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id F078A804BC37; Mon, 4 Dec 2023 09:23:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234930AbjLDRW4 (ORCPT + 99 others); Mon, 4 Dec 2023 12:22:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234949AbjLDRWy (ORCPT ); Mon, 4 Dec 2023 12:22:54 -0500 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0380FF for ; Mon, 4 Dec 2023 09:22:59 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5d3bdbf1fb5so55151067b3.2 for ; Mon, 04 Dec 2023 09:22:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701710579; x=1702315379; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=QagWLgs2h5+JriAq/VG8W2CPIQLr8/EIksrOH5rGRok=; b=iJHL+ainzGbec5xnxYzL0+kGDHtG3jttn9tf8pvu0apBSrFXzhHpO1YylpaIQTkpsK eJSlsEf2q5/xvv0pKOocrI6a0h72GFWUxCNXc3SqwjoKybTD2Aj4eTzTqe0rFV6Y2DsQ c8uSx4mOFkIxRN1bJ33tboq33x0lhqsCAujr3dI7nAfJvzEAP4PlXjXCP49gU1q74KZ4 y32O3BVUu+qSSQuB4Y0dSgjCdQN1/xi6VnEh98xRxT52pvMO2K9J+qPvSDx/zMt1LYsM LZjpjVsy4Lt9qA2HitMPf9Bf5Ygt5o33UgvU79NmEUx633kxMwSLKLH+W4wHBbc+shBb fqVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701710579; x=1702315379; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QagWLgs2h5+JriAq/VG8W2CPIQLr8/EIksrOH5rGRok=; b=OBcP7Vxh584HgvEpCnLxU1CSx8fB0BgfBW0PnCy47+VuXnf+/erkJlC81enZGiG0jo t4v4smStl7OY4n/J68e4BLRA67dqtwGBSdeBW4h5HjsVO/az6gU4/mZ/15r3LcoDKCf0 MRd0xnkEPvp0AADSoNBsYNm3YrL9H6eDwJk+IwhrrMuyurvEHXFRbJaXSV2KEW4NPhP9 PMENwMFhiyjVTtNqzFr4SeJFvKFBv6g0oJ7bMF2el2HvpULBXKdOVR8MeS7NjAgwkkYg NllIII6UZ5XGq2u2sinyRoWcRsirbrl9eQKXja98712nctibDEKf5IS9uJ+GcbT2guCo H7nw== X-Gm-Message-State: AOJu0Yyr66Nexz8A1UlohLDoFgOYML39LCDFKRvIZzfOdP0fjkKNuev6 2mirzmBa53lsyXNoy6pLpWgs350JmxeN X-Received: from kyletso-p620lin01.ntc.corp.google.com ([2401:fa00:fc:202:ac51:a57:5e72:a957]) (user=kyletso job=sendgmr) by 2002:a81:4425:0:b0:5d3:472b:3427 with SMTP id r37-20020a814425000000b005d3472b3427mr393951ywa.6.1701710579266; Mon, 04 Dec 2023 09:22:59 -0800 (PST) Date: Tue, 5 Dec 2023 01:22:46 +0800 In-Reply-To: <20231204172247.1087152-1-kyletso@google.com> Mime-Version: 1.0 References: <20231204172247.1087152-1-kyletso@google.com> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog Message-ID: <20231204172247.1087152-2-kyletso@google.com> Subject: [PATCH v4 1/2] dt-bindings: connector: Add child nodes for multiple PD capabilities From: Kyle Tso To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux@roeck-us.net, heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org Cc: badhri@google.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Kyle Tso Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 04 Dec 2023 09:23:13 -0800 (PST) The realtime Power Delivery capabilities of a port may not be always the same under different hardware status such as the port usage of a multiple port system or the status of the battery pack. Define the PD capability sets in DT for better configurability in Type-C/PD port drivers. Define an optional child node "capabilities" to contain multiple USB Power Delivery capabilities. Define child nodes with pattern (e.g. caps-0, caps-1) under "capabilities". Each node contains PDO data of a selectable Power Delivery capability. Also define common properties for source-pdos, sink-pdos, and op-sink-microwatt that can be referenced. Signed-off-by: Kyle Tso --- v3 -> v4 - modified the structure of the bindings as corrected in v2 - modified the commit message to better describe the reason of this change .../bindings/connector/usb-connector.yaml | 78 ++++++++++++------- 1 file changed, 49 insertions(+), 29 deletions(-) diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree/bindings/connector/usb-connector.yaml index 7c8a3e8430d3..50fec97436d8 100644 --- a/Documentation/devicetree/bindings/connector/usb-connector.yaml +++ b/Documentation/devicetree/bindings/connector/usb-connector.yaml @@ -14,6 +14,8 @@ description: of a USB interface controller or a separate node when it is attached to both MUX and USB interface controller. +$ref: "#/$defs/capabilities" + properties: compatible: oneOf: @@ -119,30 +121,6 @@ properties: # The following are optional properties for "usb-c-connector" with power # delivery support. - source-pdos: - description: An array of u32 with each entry providing supported power - source data object(PDO), the detailed bit definitions of PDO can be found - in "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.2 - Source_Capabilities Message, the order of each entry(PDO) should follow - the PD spec chapter 6.4.1. Required for power source and power dual role. - User can specify the source PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() - defined in dt-bindings/usb/pd.h. - minItems: 1 - maxItems: 7 - $ref: /schemas/types.yaml#/definitions/uint32-array - - sink-pdos: - description: An array of u32 with each entry providing supported power sink - data object(PDO), the detailed bit definitions of PDO can be found in - "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.3 - Sink Capabilities Message, the order of each entry(PDO) should follow the - PD spec chapter 6.4.1. Required for power sink and power dual role. User - can specify the sink PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() defined - in dt-bindings/usb/pd.h. - minItems: 1 - maxItems: 7 - $ref: /schemas/types.yaml#/definitions/uint32-array - sink-vdos: description: An array of u32 with each entry, a Vendor Defined Message Object (VDO), providing additional information corresponding to the product, the detailed bit @@ -166,11 +144,6 @@ properties: maxItems: 6 $ref: /schemas/types.yaml#/definitions/uint32-array - op-sink-microwatt: - description: Sink required operating power in microwatt, if source can't - offer the power, Capability Mismatch is set. Required for power sink and - power dual role. - port: $ref: /schemas/graph.yaml#/properties/port description: OF graph bindings modeling a data bus to the connector, e.g. @@ -231,6 +204,21 @@ properties: SNK_READY for non-pd link. type: boolean + capabilities: + description: A child node to contain all the selectable USB Power Delivery capabilities. + type: object + + patternProperties: + "^caps-[0-9]+$": + description: Child nodes under "capabilities" node. Each node contains a selectable USB + Power Delivery capability. + type: object + $ref: "#/$defs/capabilities" + + unevaluatedProperties: false + + additionalProperties: false + dependencies: sink-vdos-v1: [ sink-vdos ] sink-vdos: [ sink-vdos-v1 ] @@ -238,6 +226,38 @@ dependencies: required: - compatible +$defs: + capabilities: + properties: + source-pdos: + description: An array of u32 with each entry providing supported power + source data object(PDO), the detailed bit definitions of PDO can be found + in "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.2 + Source_Capabilities Message, the order of each entry(PDO) should follow + the PD spec chapter 6.4.1. Required for power source and power dual role. + User can specify the source PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() + defined in dt-bindings/usb/pd.h. + minItems: 1 + maxItems: 7 + $ref: /schemas/types.yaml#/definitions/uint32-array + + sink-pdos: + description: An array of u32 with each entry providing supported power sink + data object(PDO), the detailed bit definitions of PDO can be found in + "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.3 + Sink Capabilities Message, the order of each entry(PDO) should follow the + PD spec chapter 6.4.1. Required for power sink and power dual role. User + can specify the sink PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() defined + in dt-bindings/usb/pd.h. + minItems: 1 + maxItems: 7 + $ref: /schemas/types.yaml#/definitions/uint32-array + + op-sink-microwatt: + description: Sink required operating power in microwatt, if source can't + offer the power, Capability Mismatch is set. Required for power sink and + power dual role. + allOf: - if: properties: -- 2.43.0.rc2.451.g8631bc7472-goog