From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932427AbcFCJ0T (ORCPT ); Fri, 3 Jun 2016 05:26:19 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:33839 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752658AbcFCJ0O (ORCPT ); Fri, 3 Jun 2016 05:26:14 -0400 Date: Fri, 3 Jun 2016 17:20:40 +0800 From: Peter Chen To: Heikki Krogerus Cc: Lu Baolu , felipe.balbi@linux.intel.com, Mathias Nyman , Greg Kroah-Hartman , Lee Jones , Liam Girdwood , Mark Brown , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Roger Quadros Subject: Re: [PATCH v10 2/7] usb: mux: add generic code for dual role port mux Message-ID: <20160603092039.GA24714@shlinux2> References: <1464831449-8973-1-git-send-email-baolu.lu@linux.intel.com> <1464831449-8973-3-git-send-email-baolu.lu@linux.intel.com> <20160603074113.GA30006@shlinux2> <20160603081632.GA6305@kuha.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160603081632.GA6305@kuha.fi.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 03, 2016 at 11:16:32AM +0300, Heikki Krogerus wrote: > On Fri, Jun 03, 2016 at 03:41:13PM +0800, Peter Chen wrote: > > On Thu, Jun 02, 2016 at 09:37:24AM +0800, Lu Baolu wrote: > > > Several Intel platforms implement USB dual role by having completely > > > separate xHCI and dwc3 IPs in PCH or SOC silicons. These two IPs share > > > a single USB port. There is another external port mux which controls > > > where the data lines should go. While the USB controllers are part of > > > the silicon, the port mux design are platform specific. > > > > > > This patch adds the generic code to handle such multiple roles of a > > > usb port. It exports the necessary interfaces for other components to > > > register or unregister a usb mux device, and to control its role. > > > It registers the mux device with sysfs as well, so that users are able > > > to control the port role from user space. > > > > > > Some other archs (e.g. Renesas R-Car gen2 SoCs) need an external mux to > > > swap usb roles as well. This code could also be leveraged for those archs. > > > > > > > Sorry to review this so late, from my point, it is a dual-role switch > > driver too, we are reviewing USB OTG/dual-role framework [1], it is > > not necessary to create another framework to do it. And USB OTG framework > > has already tested at Renesas's platform [2]. > > > > [1] http://www.spinics.net/lists/linux-usb/msg140835.html > > [2] http://www.spinics.net/lists/linux-usb/msg140827.html > > We really can't marry dual-role capability with OTG. That OTG > framework can be used be when the hardware actually supports the > protocols defined in the OTG spec starting from SRP. In other cases it > must not be used. > > OTG relies heavily on existence of the ID pin, but with Type-C > connectors we do not have it. Therefore USB Type-C defines competing > support for example for the role swapping. With USB Type-C connectors > OTG will never be supported. > > So let's not mix USB dual-role capability with OTG. > Well, DRD/OTG framework is mainly used for dual-role switch, no matter what input is, you can use id pin, sysfs, or Type-C events. It is long term target, currently, it only supports id pin. In future, we can expend it to support more input events. Microsoft also has similar framework for it: https://msdn.microsoft.com/en-us/library/windows/hardware/dn957036(v=vs.85).aspx -- Best Regards, Peter Chen