Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Baolin Wang
On 18 May 2016 at 19:21, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> @@ -1748,15 +1754,25 @@ static int dwc3_gadget_start(struct usb_gadget >> *g, >> * even though host mode might be active. Don't actually perform >> * device-specific initialization u

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Felipe Balbi
Hi, Baolin Wang writes: > @@ -1748,15 +1754,25 @@ static int dwc3_gadget_start(struct usb_gadget *g, > * even though host mode might be active. Don't actually perform > * device-specific initialization until device mode is activated. > */ > > +

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Baolin Wang
Hi, On 18 May 2016 at 18:22, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: @@ -1485,16 +1490,11 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend) { u32 reg; u32 timeout = 500, i; >>

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Felipe Balbi
Hi, Baolin Wang writes: >>> @@ -1485,16 +1490,11 @@ static int dwc3_gadget_run_stop(struct dwc3 >>> *dwc, int is_on, int suspend) >>> { >>> u32 reg; >>> u32 timeout = 500, i; >>> >>> + if (pm_runtime_suspended(dwc->dev)) >>> +

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Baolin Wang
On 18 May 2016 at 18:12, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: Baolin Wang writes: > Make sense. cool, if you wanna work on it, let me know and I can give some details of what I have in mind. >>> >>> Could you explain details to me, a

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Felipe Balbi
Hi, Baolin Wang writes: >>> Baolin Wang writes: Make sense. >>> >>> cool, if you wanna work on it, let me know and I can give some details >>> of what I have in mind. >> >> Could you explain details to me, and I wanna continue to optimize the >> power management

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Baolin Wang
Hi Felipe, On 17 May 2016 at 18:47, Baolin Wang wrote: > On 17 May 2016 at 17:25, Felipe Balbi wrote: >> >> Hi, >> >> Baolin Wang writes: >>> Make sense. >> >> cool, if you wanna work on it, let me know and I can give some details >> of what I have in mind. > > Could you

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-17 Thread Baolin Wang
On 17 May 2016 at 17:25, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> Make sense. > > cool, if you wanna work on it, let me know and I can give some details > of what I have in mind. Could you explain details to me, and I wanna continue to optimize the pow

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-17 Thread Felipe Balbi
Hi, Baolin Wang writes: > Make sense. cool, if you wanna work on it, let me know and I can give some details of what I have in mind. >>> >>> Could you explain details to me, and I wanna continue to optimize the >>> power management things. Thanks. >> >> I have it half-way done

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-17 Thread Baolin Wang
On 17 May 2016 at 16:00, Felipe Balbi wrote: > > Hi > > Baolin Wang writes: >> Hi Felipe, >> >> On 13 May 2016 at 20:46, Felipe Balbi wrote: >>> >>> Hi, >>> >>> Baolin Wang writes: >>> why does it need restart? Why is dwc3 powered off? Who powers it off? >> >> Because when the dwc3

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-17 Thread Felipe Balbi
Hi Baolin Wang writes: > Hi Felipe, > > On 13 May 2016 at 20:46, Felipe Balbi wrote: >> >> Hi, >> >> Baolin Wang writes: >> why does it need restart? Why is dwc3 powered off? Who powers it off? > > Because when the dwc3 Vbus is off (no cable pluging in now), > especially for so

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-17 Thread Baolin Wang
Hi Felipe, On 13 May 2016 at 20:46, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: > why does it need restart? Why is dwc3 powered off? Who powers it off? Because when the dwc3 Vbus is off (no cable pluging in now), especially for some mobile device, the system need to po

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-14 Thread Baolin Wang
On 13 May 2016 at 20:46, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: > why does it need restart? Why is dwc3 powered off? Who powers it off? Because when the dwc3 Vbus is off (no cable pluging in now), especially for some mobile device, the system need to power off the

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-13 Thread Felipe Balbi
Hi, Baolin Wang writes: why does it need restart? Why is dwc3 powered off? Who powers it off? >>> >>> Because when the dwc3 Vbus is off (no cable pluging in now), >>> especially for some mobile device, the system need to power off the >>> dwc3 to save power in this situation. >> >> but dwc3

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-13 Thread Baolin Wang
On 13 May 2016 at 20:09, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 6254b2f..dada5c6 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -734,6 +734,9 @@ struct dwc3_scratchpad

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-13 Thread Felipe Balbi
Hi, Baolin Wang writes: >>> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h >>> index 6254b2f..dada5c6 100644 >>> --- a/drivers/usb/dwc3/core.h >>> +++ b/drivers/usb/dwc3/core.h >>> @@ -734,6 +734,9 @@ struct dwc3_scratchpad_array { >>> * 1 - -3.5dB de-emphasis >>> *

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-13 Thread Baolin Wang
Hi Felipe, On 13 May 2016 at 18:40, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> Currently on some platforms, the gadget device can be power off to >> save power when the Vbus is off, which means no cable plugging in >> now. In this situation we should defer starting the gadget until t

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-13 Thread Felipe Balbi
Hi, Baolin Wang writes: > Currently on some platforms, the gadget device can be power off to > save power when the Vbus is off, which means no cable plugging in > now. In this situation we should defer starting the gadget until the > gadget device is power on by connecting host. okay, you need

[PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-13 Thread Baolin Wang
Currently on some platforms, the gadget device can be power off to save power when the Vbus is off, which means no cable plugging in now. In this situation we should defer starting the gadget until the gadget device is power on by connecting host. Signed-off-by: Baolin Wang --- drivers/usb/dwc3/