Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6125684ybf; Thu, 5 Mar 2020 13:41:17 -0800 (PST) X-Google-Smtp-Source: ADFU+vtOwNQiNWZWJHho+675o8TQgtqtA7Q0fqxeA2/0Qudz+ZtYrcj7thXURVFcBfJ9k5fqgIZh X-Received: by 2002:a9d:46e:: with SMTP id 101mr449650otc.11.1583444477006; Thu, 05 Mar 2020 13:41:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583444476; cv=none; d=google.com; s=arc-20160816; b=FnpCvhyZKfUwjxa/fVeTlzvfLcHerwL8lFKHHQaYEFE1gYKX8GZBbsmk6CwCJLFJBU +0NLD0RKbPYXc8YR1OVjgfKsbb9cT5GXrB72iGlKpPwtjSd+y+ANJp7QQYWdLnO1MxD+ HCDh9cQIJJPX40peNWvYFK5W818aXTGVXH69jQawa9HnZ/8jbVuPVcrYpfS1avv+K8yW s8tD55WdBnyH5YvCgvME5HCgAJcsGkikWwQyFhV34VjELYozb0i1FYf7boYSYhJRrArc p2eECfnxWZRvb0spt8PfFupGz6+i5I0g+6i98GD3CP2eL199sOaNPnKtbqV7FKq5tPvW pPFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=H+MtbjKnVAkDwO1F8FyWPwhSDwCTW35q9GCq3MkDYjo=; b=PXomx+XbFfnDG+jLqrIGc3nsjaPqpAeRdqBQcpQTHJcwBvqKBhuIc2+fHNsjCr3twQ fuaM5qRXVMe64XM361ojctGv1InaL+4kDUvJ8zN9fYxS7XUVh0tNns4hdvKcq22h9oiE ggR0sh4HU61bjh58amogBON1sOWg24iEe9pS/rX3mz1aMRWs7rtTYIroRJ5Kd0dR+2TJ BPj15AxUkQeLjWCsMqiOhPejF+A9UzhPJd2qQX/FUrkdWeD5vJXRjGaOwVMCo0gyGTll m5QDMModIsW/Ik9NhZJxAxRyejKDMlxNnEghe1XNGFXdxr7juGbz/Z9WQma/3gT6s+6W rWgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jwmBRSLZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l23si122933otj.144.2020.03.05.13.41.04; Thu, 05 Mar 2020 13:41:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jwmBRSLZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726259AbgCEVkc (ORCPT + 99 others); Thu, 5 Mar 2020 16:40:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:41018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725991AbgCEVkc (ORCPT ); Thu, 5 Mar 2020 16:40:32 -0500 Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7E207217F4; Thu, 5 Mar 2020 21:40:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583444430; bh=2TbDtdzQLVrZkBATqyMst6WKIUAWhg4hkW93/u9hnxw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=jwmBRSLZS6+pu3brX7GBPDp8uiFUnw3oAp8b+jRAPpnnUNj9UDUx8NRgW/8lw0DLo 4KTbl6wQVU/UIkiO7pHPSb5gK1YuqwOC6xtTLVX1JI4ZAUtf88ErmZIaC6wJXs3SpG VoLBCKdodtLm4bH4OcKzJSPAaF/xK8XzSD0DKSRY= Received: by mail-qt1-f177.google.com with SMTP id e20so246353qto.5; Thu, 05 Mar 2020 13:40:30 -0800 (PST) X-Gm-Message-State: ANhLgQ28hK/b7e1yg2iih4GXSMbJaO1J2YfZe78vxeedE+6boLPFA3k1 MzbUxV4zmHSLAg65PfXgzDtYuzK52T14nV36qA== X-Received: by 2002:aed:3461:: with SMTP id w88mr223503qtd.143.1583444429367; Thu, 05 Mar 2020 13:40:29 -0800 (PST) MIME-Version: 1.0 References: <20200305030135.210675-1-pmalani@chromium.org> <158344320452.25912.4758137777863945655@swboyd.mtv.corp.google.com> In-Reply-To: <158344320452.25912.4758137777863945655@swboyd.mtv.corp.google.com> From: Rob Herring Date: Thu, 5 Mar 2020 15:40:18 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] dt-bindings: Convert usb-connector to YAML format. To: Stephen Boyd Cc: Prashant Malani , devicetree@vger.kernel.org, Benson Leung , Heikki Krogerus , Enric Balletbo i Serra , "Bryan O'Donoghue" , Chunfeng Yun , Greg Kroah-Hartman , Linus Walleij , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "linux-kernel@vger.kernel.org" , "moderated list:ARM/Mediatek SoC support" , Linux USB List , Mark Rutland , Matthias Brugger , Miquel Raynal Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 5, 2020 at 3:20 PM Stephen Boyd wrote: > > Quoting Prashant Malani (2020-03-04 19:01:30) > > diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree/bindings/connector/usb-connector.yaml > > new file mode 100644 > > index 0000000000000..b386e2880405c > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/connector/usb-connector.yaml > > @@ -0,0 +1,203 @@ > > +# SPDX-License-Identifier: GPL-2.0-only > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/connector/usb-connector.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: USB Connector > > + > > +maintainers: > > + - linux-usb@vger.kernel.org > > + > > +description: > > + A USB connector node represents a physical USB connector. It should be a child > > + of a USB interface controller. > > + > > +properties: > > + compatible: > > + enum: > > + - usb-a-connector > > + - usb-b-connector > > + - usb-c-connector > > + > > + label: > > + description: Symbolic name for the connector. > > + > > + type: > > + description: Size of the connector, should be specified in case of USB-A, > > + USB-B non-fullsize connectors. > > Maybe "should be specified in case of non-fullsize 'usb-a-connector' or > 'usb-b-connector' compatible connectors"? > > > + $ref: /schemas/types.yaml#definitions/string > > + enum: > > + - mini > > + - micro > > + > > + self-powered: > > + description: Set this property if the USB device has its own power source. > > + type: boolean > > + > > + # The following are optional properties for "usb-b-connector". > > + id-gpios: > > + description: An input gpio for USB ID pin. > > + maxItems: 1 > > + > > + vbus-gpios: > > + description: An input gpio for USB VBus pin, used to detect presence of > > + VBUS 5V. See gpio/gpio.txt. > > Can this be written as bindings/gpio/gpio.txt? Or just drop the reference so we don't have to fix it later. > > + maxItems: 1 > > + > > + vbus-supply: > > + description: A phandle to the regulator for USB VBUS if needed when host > > + mode or dual role mode is supported. > > + Particularly, if use an output GPIO to control a VBUS regulator, should > > + model it as a regulator. See regulator/fixed-regulator.yaml > > And bindings/regulator/fixed-regulator.yaml? The idea is to > disambiguate from kernel Documentation/ directory. > > > + > > + # The following are optional properties for "usb-c-connector". > > Is there a way to constrain the binding so that this can't be put in a > connector that doesn't have the usb-c-connector compatible string? Yes, with if/then and setting excluded properties to 'false'. Personally, I don't think it is worth the messiness. I'm not too worried if folks put in properties that are going to be ignored. Rob > > + power-role: > > + description: Determines the power role that the Type C connector will > > + support. "dual" refers to Dual Role Port (DRP). > > + allOf: > > + - $ref: /schemas/types.yaml#definitions/string > > + enum: > > + - source > > + - sink > > + - dual > > + > > + try-power-role: > > + description: Preferred power role. > > + allOf: > > + - $ref: /schemas/types.yaml#definitions/string > > + enum: > > + - source > > + - sink > > + - dual > > + > > + data-role: > > + description: Data role if Type C connector supports USB data. "dual" refers > > + Dual Role Device (DRD). > > + allOf: > > + - $ref: /schemas/types.yaml#definitions/string > > + enum: > > + - host > > + - device > > + - dual > > Is there a way to maintain a description for each possible string > property? Then we could move the last sentence in the description above > to be attached to '- dual' here. > > > + > > + # 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 > > + allOf: > > + - $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 > > + allOf: > > + - $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. > > + > > + ports: > > + description: OF graph bindings (specified in bindings/graph.txt) that model > > + any data bus to the connector unless the bus is between parent node and > > + the connector. Since a single connector can have multiple data buses every > > + bus has assigned OF graph port number as described below. > > has an assigned? > > > + type: object > > + properties: > > + port@0: > > + type: object > > + description: High Speed (HS), present in all connectors. > > + > > + port@1: > > + type: object > > + description: Super Speed (SS), present in SS capable connectors. > > + > > + port@2: > > + type: object > > + description: Sideband Use (SBU), present in USB-C. > > Likewise, is it possible to constrain this to only usb-c-connector > compatible string based bindings? And if so, does it become required for > that compatible string? Not required as alternate modes are not required. (BTW, it should probably be clarified this is supposed to be the alternate mode connection of which SBU is part of). Rob