Re: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-10 Thread Julius Werner
>> The contract for bus_suspend() is that it will suspend all ports not >> yet suspended, keep track of those ports and then only resume those in >> bus_resume() (compare, for example, how XHCI keeps track of that with >> xhci_bus_state.bus_suspended in xhci_bus_suspend/resume()). So you >> need

Re: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-10 Thread Kever Yang
Hi Julius, On 11/07/2014 06:11 AM, Julius Werner wrote: On Wed, Nov 5, 2014 at 5:30 PM, Kever Yang wrote: Hcd controller needs bus_suspend/resume, dwc2 controller make root hub generate suspend/resume signal with hprt0 register when work in host mode. After the root hub enter suspend, we can

Re: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-10 Thread Kever Yang
Hi Julius, On 11/07/2014 06:11 AM, Julius Werner wrote: On Wed, Nov 5, 2014 at 5:30 PM, Kever Yang kever.y...@rock-chips.com wrote: Hcd controller needs bus_suspend/resume, dwc2 controller make root hub generate suspend/resume signal with hprt0 register when work in host mode. After the root

Re: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-10 Thread Julius Werner
The contract for bus_suspend() is that it will suspend all ports not yet suspended, keep track of those ports and then only resume those in bus_resume() (compare, for example, how XHCI keeps track of that with xhci_bus_state.bus_suspended in xhci_bus_suspend/resume()). So you need something

Re: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-06 Thread Julius Werner
On Wed, Nov 5, 2014 at 5:30 PM, Kever Yang wrote: > Hcd controller needs bus_suspend/resume, dwc2 controller make > root hub generate suspend/resume signal with hprt0 register > when work in host mode. > After the root hub enter suspend, we can make controller enter > low power state with PCGCTL

Re: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-06 Thread Felipe Balbi
Hi, On Thu, Nov 06, 2014 at 06:35:53PM +, Paul Zimmerman wrote: > > From: Felipe Balbi [mailto:ba...@ti.com] > > Sent: Thursday, November 06, 2014 9:40 AM > > > > On Thu, Nov 06, 2014 at 06:21:42PM +0100, Romain Perier wrote: > > > > > > 2014-11-06 2:30 GMT+01:00 Kever Yang : > > > > > > > >

RE: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-06 Thread Paul Zimmerman
> From: Felipe Balbi [mailto:ba...@ti.com] > Sent: Thursday, November 06, 2014 9:40 AM > > On Thu, Nov 06, 2014 at 06:21:42PM +0100, Romain Perier wrote: > > > > 2014-11-06 2:30 GMT+01:00 Kever Yang : > > > > > > +static int _dwc2_hcd_suspend(struct usb_hcd *hcd) > > > +{ > > > + struct

Re: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-06 Thread Felipe Balbi
On Thu, Nov 06, 2014 at 06:21:42PM +0100, Romain Perier wrote: > Hi Kever, > > > 2014-11-06 2:30 GMT+01:00 Kever Yang : > > > > +static int _dwc2_hcd_suspend(struct usb_hcd *hcd) > > +{ > > + struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd); > > + u32 hprt0; > > + > > + if

Re: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-06 Thread Romain Perier
Hi Kever, 2014-11-06 2:30 GMT+01:00 Kever Yang : > > +static int _dwc2_hcd_suspend(struct usb_hcd *hcd) > +{ > + struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd); > + u32 hprt0; > + > + if (!((hsotg->op_state == OTG_STATE_B_HOST) || > + (hsotg->op_state ==

Re: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-06 Thread Romain Perier
Hi Kever, 2014-11-06 2:30 GMT+01:00 Kever Yang kever.y...@rock-chips.com: +static int _dwc2_hcd_suspend(struct usb_hcd *hcd) +{ + struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd); + u32 hprt0; + + if (!((hsotg-op_state == OTG_STATE_B_HOST) || +

Re: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-06 Thread Felipe Balbi
On Thu, Nov 06, 2014 at 06:21:42PM +0100, Romain Perier wrote: Hi Kever, 2014-11-06 2:30 GMT+01:00 Kever Yang kever.y...@rock-chips.com: +static int _dwc2_hcd_suspend(struct usb_hcd *hcd) +{ + struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd); + u32 hprt0; + +

RE: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-06 Thread Paul Zimmerman
From: Felipe Balbi [mailto:ba...@ti.com] Sent: Thursday, November 06, 2014 9:40 AM On Thu, Nov 06, 2014 at 06:21:42PM +0100, Romain Perier wrote: 2014-11-06 2:30 GMT+01:00 Kever Yang kever.y...@rock-chips.com: +static int _dwc2_hcd_suspend(struct usb_hcd *hcd) +{ +

Re: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-06 Thread Felipe Balbi
Hi, On Thu, Nov 06, 2014 at 06:35:53PM +, Paul Zimmerman wrote: From: Felipe Balbi [mailto:ba...@ti.com] Sent: Thursday, November 06, 2014 9:40 AM On Thu, Nov 06, 2014 at 06:21:42PM +0100, Romain Perier wrote: 2014-11-06 2:30 GMT+01:00 Kever Yang kever.y...@rock-chips.com:

Re: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-06 Thread Julius Werner
On Wed, Nov 5, 2014 at 5:30 PM, Kever Yang kever.y...@rock-chips.com wrote: Hcd controller needs bus_suspend/resume, dwc2 controller make root hub generate suspend/resume signal with hprt0 register when work in host mode. After the root hub enter suspend, we can make controller enter low

[PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-05 Thread Kever Yang
Hcd controller needs bus_suspend/resume, dwc2 controller make root hub generate suspend/resume signal with hprt0 register when work in host mode. After the root hub enter suspend, we can make controller enter low power state with PCGCTL register. We also update the lx_state for hsotg state. This

[PATCH v2] usb: dwc2: add bus suspend/resume for dwc2

2014-11-05 Thread Kever Yang
Hcd controller needs bus_suspend/resume, dwc2 controller make root hub generate suspend/resume signal with hprt0 register when work in host mode. After the root hub enter suspend, we can make controller enter low power state with PCGCTL register. We also update the lx_state for hsotg state. This