[<prev] [next>] [day] [month] [year] [list]
Message-ID: <AM4PR04MB2130F384BDB0BFF95C6EE59F895E0@AM4PR04MB2130.eurprd04.prod.outlook.com>
Date: Wed, 8 Jun 2016 06:20:15 +0000
From: Jun Li <jun.li@....com>
To: Lu Baolu <baolu.lu@...ux.intel.com>,
Felipe Balbi <felipe.balbi@...ux.intel.com>,
Roger Quadros <rogerq@...com>,
Peter Chen <hzpeterchen@...il.com>
CC: Mathias Nyman <mathias.nyman@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Lee Jones <lee.jones@...aro.org>,
"Heikki Krogerus" <heikki.krogerus@...ux.intel.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v10 2/7] usb: mux: add generic code for dual role port mux
Hi, Baolu
From: Lu Baolu [mailto:baolu.lu@...ux.intel.com]
Sent: Wednesday, June 08, 2016 1:11 PM
To: Jun Li <jun.li@....com>; Felipe Balbi <felipe.balbi@...ux.intel.com>; Roger Quadros <rogerq@...com>; Peter Chen <hzpeterchen@...il.com>
Cc: Mathias Nyman <mathias.nyman@...el.com>; Greg Kroah-Hartman <gregkh@...uxfoundation.org>; Lee Jones <lee.jones@...aro.org>; Heikki Krogerus <heikki.krogerus@...ux.intel.com>; Liam Girdwood <lgirdwood@...il.com>; Mark Brown <broonie@...nel.org>; linux-usb@...r.kernel.org; linux-kernel@...r.kernel.org
Subject: Re: [PATCH v10 2/7] usb: mux: add generic code for dual role port mux
Hi,
[I have to resend my reply. The previous reply was failed to deliver
to usb mailing list. Sorry for inconvenience.]
On 06/08/2016 11:04 AM, Jun Li wrote:
Whether controller drivers want to use it or not is upto the driver
> > maintainers but we should at least ensure that user space ABI if any,
> > is consistent across different implementations.
>
> Role decisions should not be exposed to userspace unless as debug feature
> (using e.g. DebugFS). That should be done either by the HW or within the
> kernel.
> In many cases the role decision is made by usersapce, this also should be
> covered.
> This patchset also expose it to userspace but I think it isn't for debug:
> /sys/bus/platform/devices/.../portmux.N/state
> Please don't use this interface for host/gadget role switch, and the
> document doesn't tell you to do so as well. This is only designed to
> put the port mux device to a right direction. Host/gadget dual
> role switch includes other elements, like ID pin detection, type-c
> events, VBUS management and so on.
Confused, then what's the purpose of it? How to use it?
Below is all about it in document, it's seems telling me can do that,
but you say no:)
+What: /sys/bus/platform/devices/.../portmux.N/name
+ /sys/bus/platform/devices/.../portmux.N/state
+Date: April 2016
+Contact: Lu Baolu <baolu.lu@...ux.intel.com>
+Description:
+ In some platforms, a single USB port is shared between a USB host
+ controller and a device controller. A USB mux driver is needed to
+ handle the port mux. Read-only attribute "name" shows the name of
+ the port mux device. "state" attribute shows and stores the mux
+ state.
+ For read:
+ 'unknown' - the mux hasn't been set yet;
+ 'peripheral' - mux has been switched to PERIPHERAL controller;
+ 'host' - mux has been switched to HOST controller.
+ For write:
+ 'peripheral' - mux will be switched to PERIPHERAL controller;
+ 'host' - mux will be switched to HOST controller.
> Best regards,
> Lu Baolu
Powered by blists - more mailing lists