[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1565681434.23705.66.camel@mhfsdcap03>
Date: Tue, 13 Aug 2019 15:30:34 +0800
From: Chunfeng Yun <chunfeng.yun@...iatek.com>
To: Roger Quadros <rogerq@...com>
CC: Felipe Balbi <felipe.balbi@...ux.intel.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Pawel Laszczak <pawell@...ence.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"jbergsagel@...com" <jbergsagel@...com>,
"nsekhar@...com" <nsekhar@...com>, "nm@...com" <nm@...com>,
Suresh Punnoose <sureshp@...ence.com>,
Jayshri Dajiram Pawar <jpawar@...ence.com>,
"Rahul Kumar" <kurahul@...ence.com>,
Anil Joy Varughese <aniljoy@...ence.com>
Subject: Re: [PATCH v10 5/6] usb:cdns3 Add Cadence USB3 DRD Driver
On Mon, 2019-08-12 at 16:04 +0300, Roger Quadros wrote:
>
> On 12/08/2019 15:46, Felipe Balbi wrote:
> >
> > Hi,
> >
> > Roger Quadros <rogerq@...com> writes:
> >>> The sysfs file we expose from the class for the role switches is
> >>> primarily meant for supporting proprietary protocols that require us
> >>> to basically override the connector USB data role. The default role
> >>> should always be selected in the drivers.
> >>
> >> OK. Let's take this example
> >> - Port is dual-role port micro AB.
> >> - microAB to type-A adapter is connected which pulls ID low. port transitions
> >> to "host" role by the controller driver.
> >> - proprietary protocol want to switch role to device role so writes "device" to
> >> mode switch sysfs. port transitions to "device" role.
> >>
> >> Now, how does controller driver know to fall back to HW based role switching?
> >
> > Use a 'disconnect' or 'suspend' event to go reset it? But that should,
> > probably, be done at kernel space, no?
> >
>
> Yes that could be one option.
> So after a disconnect, sysfs role should reflect actual hardware role. correct?
Maybe it's difficult to support both HW based role switch and SW based
role switch by sysfs at the same if the HW's FSM rely on, such as, the
state of Vbus pin or ID pin. Likes the upper example, when user writes
"device" to mode switch sysfs, the driver should skip the HW state of ID
pin, due to it's state is Low, or force it as High.
Another option way is that introduces a property in DTS to indicate the
way the driver want to use (HW based or SW based, usb_role_switch
doesn't provide this information for the controller driver), but is not
flexible enough.
>
> cheers,
> -roger
Powered by blists - more mailing lists