From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752093AbcFFHfi (ORCPT ); Mon, 6 Jun 2016 03:35:38 -0400 Received: from mga09.intel.com ([134.134.136.24]:62833 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751699AbcFFHfh (ORCPT ); Mon, 6 Jun 2016 03:35:37 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,426,1459839600"; d="scan'208";a="714535577" Subject: Re: [PATCH v10 2/7] usb: mux: add generic code for dual role port mux To: 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> <20160606012557.GA16012@shlinux2> <5754E850.1020707@linux.intel.com> <20160606070244.GE16012@shlinux2> 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: <575527BD.6070803@linux.intel.com> Date: Mon, 6 Jun 2016 15:35:25 +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: <20160606070244.GE16012@shlinux2> 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 Peter, On 06/06/2016 03:02 PM, Peter Chen wrote: >>>> > >> But this code is better co-work with OTG/Dual-role framework, we'd >>>> > >> better have only interface that the user can know which role for the >>>> > >> current port. >>>> > >> OTG/Dual-role framework and portmux framework are not overlapped. >>>> > >> The sysfs interface shouldn't be overlapped as well. Say, I have a port >>>> > >> mux device and I have a driver for it. I am able to read the status of my >>>> > >> port mux device through sysfs. This is not part of OTG/Dual-role as far >>>> > >> as I can see. >>>> > >> >>> > > Then how the user wants to switch the role through the mux driver's >>> > > sysfs or dual-role switch sysfs? >>> > > >> > >> > It depends. If you have an OTG/DRD capable controllers, you need to >> > do this through OTG sysfs; otherwise you only need to switch the port. >> > > The user may not know the detail, they will do role switch according to > sysfs documentation. Yes, in your role switch case, only port mux is enough, > but for others, it needs other operations. So we need to make it clear in Documentation/ABI/testing/sysfs-bus-platform. > > I agree with Roger that the dual-role switch part in your code is better > to use OTG framework to reduce redundancy. I agree that we should use dual-role framework for role switch. Actually, my code doesn't do this work. It only adds a generic framework for port mux device and two mux device drivers used in Intel platform. Best regards, Lu Baolu