> -----Original Message-----
> From: Felipe Balbi [mailto:[email protected]]
> Sent: Thursday, August 25, 2011 1:36 PM
> To: Sarah Sharp
> Cc: Felipe Balbi; Greg KH; Linux USB Mailing List; Linux OMAP Mailing List; 
> Paul Zimmerman
> Subject: Re: [PATCH 3/4] usb: Introduce DesignWare USB3 DRD Driver
> 
> Hi,
> 
> On Thu, Aug 25, 2011 at 12:15:09PM -0700, Sarah Sharp wrote:
> > On Fri, Aug 19, 2011 at 06:10:58PM +0300, Felipe Balbi wrote:
> > > +enum dwc3_link_state {
> > > + /* In SuperSpeed */
> > > + DWC3_LINK_STATE_U0              = 0x00, /* in HS, means ON */
> > > + DWC3_LINK_STATE_U1              = 0x01,
> > > + DWC3_LINK_STATE_U2              = 0x02, /* in HS, means SLEEP */
> > > + DWC3_LINK_STATE_U3              = 0x03, /* in HS, means SUSPEND */
> > > + DWC3_LINK_STATE_SS_DIS          = 0x04,
> > > + DWC3_LINK_STATE_RX_DET          = 0x05, /* in HS, means Early Suspend */
> > > + DWC3_LINK_STATE_SS_INACT        = 0x06,
> > > + DWC3_LINK_STATE_POLL            = 0x07,
> > > + DWC3_LINK_STATE_RECOV           = 0x08,
> > > + DWC3_LINK_STATE_HRESET          = 0x09,
> > > + DWC3_LINK_STATE_CMPLY           = 0x0a,
> > > + DWC3_LINK_STATE_LPBK            = 0x0b,
> > > + DWC3_LINK_STATE_MASK            = 0x0f,
> > > +};
> >
> > AFAICT, the link state values are exactly the same as the xHCI link
> > state values in the Port Link State field in the PORTSC register.  Is
> > the gadget side (xDCI side) meant to be somewhat compatible with the
> > xHCI host controller spec?
> 
> I guess Synopsys would be best to answer this question. Paul, do you
> happen to know the answer ?
> 
> > Would it make sense to share these link state macros (and any other
> > similar #defines) with the xHCI driver?  We could move them into
> > include/linux/ch11.h.
> 
> I'm not sure it makes sense to make gadget side use ch11 definitions,
> but we could move them to some other common header, maybe ?

Our USB3 core is a dual-role device, and some of the logic is shared
between xHCI mode and Device mode. So it's not a coincidence that the
link state values are the same.

However, in future the device mode will have additional states beyond
those defined for xHCI. So a completely common header file is not
possible, unless people don't mind having Synopsys-specific defines
inside it.

-- 
Paul

N�����r��y����b�X��ǧv�^�)޺{.n�+����{��f��{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�m��������zZ+�����ݢj"��!�i

Reply via email to