Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2727640ybk; Tue, 12 May 2020 06:46:23 -0700 (PDT) X-Google-Smtp-Source: APiQypLNJt53MOLquBpu6cN2pZDH36EmR77XnpcwFWlt3U+lbmg3JFCuvrMeX2Tp3s1cyjX/97Yo X-Received: by 2002:aa7:db0b:: with SMTP id t11mr16994618eds.304.1589291183413; Tue, 12 May 2020 06:46:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589291183; cv=none; d=google.com; s=arc-20160816; b=XY4jmwTM/lw4W/SXBwrsW4H48irDb+RZfgpgd1oqxaY55rNMkC24DgA8U/xr06uXnJ py/A77u5mF8T0+kflhrpvdz1qTFRVfKxywcUHcauTQlguaSt8Bym/yKEsKPAfdWrIQ8h 1aFZ7gKJig7n95lDvfPkae3S8ShK5tOrabBb7AIHvLDHjwGGm9IiYBcZHFw8bJAzuX5R 0vBl6nWxkUCZboisoOUUaGDzt+MhX5tN+WtzRssB6/GSOsPVhO/PVGgmzVN01kK4ggIP UWCErp0+KaZlrD6RyKSma8aD3joDijqsquzIRcLT/OYqVnGVy8zB+PVdu+dzq0wCFiX6 cLVA== 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 :ironport-sdr:ironport-sdr; bh=Qm8NaYmLfMLzw/AWFcatH3+ogyLRvSf/hB+X+IFw6h8=; b=0mRchCY1dc5toq8Fsbdvix3k07dU3/eZctanFF7T6tcy8OQLMe+PJ7k59CKl+sttGu JoPx9LYMdIVAreTeb7fWCCrbZxV+fCclZtE8l+kcoprWm8EZXzVu/yYSzbrIR5D0owhW 4i8B4HMcdFsRgSQDcii5C6HmHRTJeA294XfNU2P2+i4RBBONqFnzoflLnpv8Rb7aIbo7 eitDvwKEE++kK1PSdZ0z/R4725tS/C/gUI7lmDFFH6zr25tECvtfey85gmFLKSBRdAIx pLunp3PeoFsOidrhwFplw50+KdE9RMa9trIqecPzXPBQqJC4rkv8L5rXJSafhRvO6MnJ wLPA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l30si1128496edl.555.2020.05.12.06.45.58; Tue, 12 May 2020 06:46:23 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729568AbgELNmD (ORCPT + 99 others); Tue, 12 May 2020 09:42:03 -0400 Received: from mga07.intel.com ([134.134.136.100]:50466 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726891AbgELNmC (ORCPT ); Tue, 12 May 2020 09:42:02 -0400 IronPort-SDR: +RRSjdhlvNWnGfL/4eGyaIFU7j7f4zrJRgU5QsxpJo6FDMflV7JC1Y3HFqap7NKyfYQq7+B2ZQ kgsaMss7zCPA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2020 06:42:00 -0700 IronPort-SDR: x2nk/Tb1YN4TUb8cjAbnzEnwap4bCiymXiruUW7jTrtkvGsKW3saY9tFd1bGLoQq6ARV2Y1+Sg jf9Q4f1byRZg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,383,1583222400"; d="scan'208";a="371566424" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 12 May 2020 06:41:55 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 12 May 2020 16:41:54 +0300 Date: Tue, 12 May 2020 16:41:54 +0300 From: Heikki Krogerus To: Prashant Malani Cc: Rob Herring , linux-kernel@vger.kernel.org, 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: <20200512134154.GC2085641@kuha.fi.intel.com> References: <20200422222242.241699-1-pmalani@chromium.org> <20200511192800.GA28762@bogus> <20200511204635.GC136540@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200511204635.GC136540@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi guys, On Mon, May 11, 2020 at 01:46:35PM -0700, Prashant Malani wrote: > 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? The mode-switch here would actually represent the "consumer" part in the mux-control bindings. So the mux-controls would describe the relationship between the "mode-switch" and the mux controller(s), while the mode-switch property describes the relationship between something like USB Type-C Port Manager (or this cros_ec function) and the "mux consumer". > > > + > > > + 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 > > > thanks, -- heikki