From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751508AbcFEIrE (ORCPT ); Sun, 5 Jun 2016 04:47:04 -0400 Received: from mga09.intel.com ([134.134.136.24]:5806 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751112AbcFEIrA (ORCPT ); Sun, 5 Jun 2016 04:47:00 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,420,1459839600"; d="scan'208";a="714115034" Subject: Re: [PATCH v10 2/7] usb: mux: add generic code for dual role port mux To: Jun Li , Peter Chen 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> <5751AAEE.2090001@linux.intel.com> <20160604022838.GA26936@shlinux2> <5753CCFC.2060504@linux.intel.com> Cc: "felipe.balbi@linux.intel.com" , Mathias Nyman , Greg Kroah-Hartman , Lee Jones , Heikki Krogerus , Liam Girdwood , Mark Brown , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Roger Quadros From: Lu Baolu Message-ID: <5753E6FF.5010501@linux.intel.com> Date: Sun, 5 Jun 2016 16:46:55 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 06/05/2016 04:33 PM, Jun Li wrote: >> Port mux is part of dual role switch, but not the whole thing. >> > >> > Dual role switch includes at least below things: >> > - ID or type-C event detection >> > - port mux >> > - VBUS management >> > - start/stop host/device controllers >> > >> > An OTG/Dual-role framework can be used to keep all these things run >> > together with an internal state machine. But it's not duplicated with a >> > generic framework for port mux and the port mux drivers. >> > >>> > > Your >>> > > case is just like Renesas case, which uses two different drivers >>> > > between peripheral and host[1]. >> > >> > In my case, the port mux devices are physical devices and they can be >> > controlled through GPIO pins or device registers. They are independent of >> > both peripheral and host controllers. >> > > I also think current OTG/Dual role framework can support your case, if you > find there is any limitation of it which can't meet your requirement, we > should improve it, Roger also provide an example of dual role switch with > USB3 based on his OTG core. Why do we need an OTG framework to support a device driver? Is it something like a bus or class driver? Best regards, Lu Baolu