Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2170363ybk; Mon, 11 May 2020 13:48:27 -0700 (PDT) X-Google-Smtp-Source: APiQypLwzr0TgvmbSp2vMM6/05+4wR5E9tElWQZarKYUy93GeyRK0aVEnn+OMWjJiTlbhyk3KoHC X-Received: by 2002:aa7:db0b:: with SMTP id t11mr14363845eds.304.1589230107465; Mon, 11 May 2020 13:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589230107; cv=none; d=google.com; s=arc-20160816; b=OL0VG5gC/Vgf/bo4mQNzEGXxp6xch3wX3um/iHMjDQRVn6LRpHIc7Xq7r/aVjUyYwB VVDUNrbLRdE1WV54YrC3ikF3BHvUVZ7GCFNRWrFjEgA8B+mon8e+RJrORwNaSQSuagmk HU5rdFc3L6aI2UadJOq4zNxBpqtBG37SfV34j5vrv2zcMq/WFX6B15sGV23VPbsXw4PQ L5u+P/W8TUNgw6W0CdxFKRsZ8JBet2OYzR6IIc6jr9a0hHMxqaaAsqbeU5Af8BIOUtxp LIVtRt08rX/75PVaBvjH+Ky9IiQ7O0+OdPxO1bYuZml7G3T3Tdxe9bDC+dF/wwl4FCFJ oD2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=uYusnhSC7Z6RV3AtOgOdxj3jC+YLs9nBvqEDynGfEO4=; b=Wl5ItQ7RFWmxS508inoAMINBpk2IT7zo96Stx4lwLYy3CdZ+lxQEFNMO4+JntdQbB3 6uEMZoKq4zdNnxyb6RIvNk5+NhM6r6+yge+NLA/4wEo+3dzMnL1GNDI4sntoP2p2/++e uaxQSph+IuaHETdPcVe+hKR9ZwTjbZ3HUHjViOC+9cvV/4bftyzj6cPwl++QqR3yJQh7 1Kk6NYd8fnfUiH9JycrncNcEXtfJA0AyME7Dg3qDeUx5x/TvEBlOWEWRyOGmVzwrd9XY J3977m5JYxNYnN2iqFetTSHgmY19LJWP7zod9Unv7N0+ZKTBqcNXiPtO334FfHZFv+ub PeSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hkEdszHi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t5si7063334edr.374.2020.05.11.13.48.04; Mon, 11 May 2020 13:48:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hkEdszHi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731639AbgEKUqj (ORCPT + 99 others); Mon, 11 May 2020 16:46:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729857AbgEKUqj (ORCPT ); Mon, 11 May 2020 16:46:39 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D20CDC061A0E for ; Mon, 11 May 2020 13:46:38 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id f7so5274491pfa.9 for ; Mon, 11 May 2020 13:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=uYusnhSC7Z6RV3AtOgOdxj3jC+YLs9nBvqEDynGfEO4=; b=hkEdszHivpyBZj6Je7n1VlEhojSGSt2t11cqUYXONgDCnJ3B4+XrxCdoiktys9EEOC BAUx9V1FUz8O5C/7N8IPPFEytTC+hjumCYHKCniwoC1fFUlk6/kxAMEx5Cc4CIbEMILA Y+xfoa9PZ+PAxKIEEbiFrXdJbhVedDFKoYKAM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uYusnhSC7Z6RV3AtOgOdxj3jC+YLs9nBvqEDynGfEO4=; b=FOJuz7L1No5BVLW/IgEPnmCtkf+SGR+5tsRKho48CZ9B9yhieLvjuAIa8eF1g/EU+B O3djV3lbwysJmjRY4Dx185+8os5Tzb8jJVS5/baYc+FIqKiJzHR/L4men0unTjkkfk+j qzfmrSsDriv3nyRz9bfg5Q+O1EOGbs2jxnWIXrNwvTFcVM1kNQFShoh1EgzLlaWBD2t/ HvLpyMe5HKqI0N4kOwujIWHpE3yH6qQtKLTrO0hbkJrnVKQQ+r6JCc/oSOudbBxI0nSc 1piWw67KLuXSWdPx+ZqLd1bQ7btHY7t1ZNZ3bmeZJaKz1b3eMASYt7ie1dFaJ4IN8hn+ E8GQ== X-Gm-Message-State: AOAM530CQLW5z4RUTOB87/0nl/FQXQ2TwsVjFUJQnMtxcPtq66JNMCWQ +t6qx+XvRhmqtlPTT/KbqH1MHw== X-Received: by 2002:a63:4cc:: with SMTP id 195mr3874382pge.294.1589229997580; Mon, 11 May 2020 13:46:37 -0700 (PDT) Received: from google.com ([2620:15c:202:201:476b:691:abc3:38db]) by smtp.gmail.com with ESMTPSA id 67sm10209091pfx.108.2020.05.11.13.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 13:46:36 -0700 (PDT) Date: Mon, 11 May 2020 13:46:35 -0700 From: Prashant Malani To: Rob Herring Cc: linux-kernel@vger.kernel.org, heikki.krogerus@linux.intel.com, twawrzynczak@chromium.org, Benson Leung , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Enric Balletbo i Serra , Guenter Roeck Subject: Re: [PATCH 1/2] dt-bindings: chrome: Add cros-ec-typec mux props Message-ID: <20200511204635.GC136540@google.com> References: <20200422222242.241699-1-pmalani@chromium.org> <20200511192800.GA28762@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200511192800.GA28762@bogus> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, Thank you for reviewing the patch. Kindly see my comments inline: On Mon, May 11, 2020 at 02:28:00PM -0500, Rob Herring wrote: > On Wed, Apr 22, 2020 at 03:22:39PM -0700, Prashant Malani wrote: > > Add properties for mode, orientation and USB data role switches for > > Type C connectors. When available, these will allow the Type C connector > > class port driver to configure the various switches according to USB PD > > information (like orientation, alt mode etc.) provided by the Chrome OS > > EC controller. > > > > Signed-off-by: Prashant Malani > > --- > > .../bindings/chrome/google,cros-ec-typec.yaml | 27 ++++++++++++++++++- > > 1 file changed, 26 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.yaml b/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.yaml > > index 6d7396ab8bee..b5814640aa32 100644 > > --- a/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.yaml > > +++ b/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.yaml > > @@ -21,7 +21,21 @@ properties: > > const: google,cros-ec-typec > > > > connector: > > - $ref: /schemas/connector/usb-connector.yaml# > > + allOf: > > + - $ref: /schemas/connector/usb-connector.yaml# > > + - type: object > > + properties: > > These don't seem CrOS EC specific, so why document them as such. Are you referring to the "mode-switch", "orientation-switch" and "usb-role-switch" properties? If so, then yes, they aren't Cros EC specific. The Type C connector class framework requires the nodes to be named like this, and the cros-ec-typec driver uses this framework, hence the description here (the Type C connector class framework doesn't have any bindings). Would it be better to add in the description string that Type Connector class expects these switches to be named this way? : " Reference to a DT node for the USB Type C Multiplexer controlling the data lines routing for this connector. This switch is assumed registered with the Type C connector class framework, which requires it to be named this way." > > > + mode-switch: > > + description: Reference to a DT node for the USB Type C Multiplexer > > + controlling the data lines routing for this connector. > > This is for alternate mode muxing I presume. Yes, that's right. > > We already have a mux-control binding. Why not use that here? Heikki might be able to offer more insight into why this is the case, since the connector class framework seems to expect a phandle and for the device driver to implement a "set" command. Heikki, would you happen to know? > > > + > > + orientation-switch: > > + description: Reference to a DT node for the USB Type C orientation > > + switch for this connector. > > What's in this node? Similar to the other "-switch", this will contain a phandle to a device which can control orientation settings for the Type C Mux. The connector class API assumes the switches are named this way. For example: orientation-switch: https://elixir.bootlin.com/linux/v5.7-rc2/source/drivers/usb/typec/mux.c#L64 mode-switch: https://elixir.bootlin.com/linux/v5.7-rc2/source/drivers/usb/typec/mux.c#L258 > > > + > > + usb-role-switch: > > + description: Reference to a DT node for the USB Data role switch > > + for this connector. > > > > required: > > - compatible > > @@ -49,6 +63,17 @@ examples: > > data-role = "dual"; > > try-power-role = "source"; > > }; > > + > > + connector@1 { > > + compatible = "usb-c-connector"; > > + reg = <1>; > > + power-role = "dual"; > > + data-role = "host"; > > + try-power-role = "source"; > > + mode-switch = <&typec_mux>; > > + orientation-switch = <&typec_orientation_switch>; > > + usb-role-switch = <&typec_mux>; > > + }; > > }; > > }; > > }; > > -- > > 2.26.1.301.g55bc3eb7cb9-goog > >