Re: [PATCH 14/14] usb: udc-core: add judgement logic for usb_gadget_connect

2013-03-18 Thread Peter Chen
On Fri, Mar 15, 2013 at 12:37:01PM +0200, Felipe Balbi wrote: Hi, On Fri, Mar 15, 2013 at 06:04:08PM +0800, Peter Chen wrote: On Fri, Mar 15, 2013 at 09:51:29AM +0200, Felipe Balbi wrote: that's all wrong and needs to be fixed. UDC-core has to be the central point for all these

Re: [PATCH 14/14] usb: udc-core: add judgement logic for usb_gadget_connect

2013-03-15 Thread Peter Chen
On Thu, Mar 14, 2013 at 12:19:04PM +0200, Felipe Balbi wrote: Hi, On Thu, Mar 14, 2013 at 05:24:39PM +0800, Peter Chen wrote: @@ -278,7 +278,10 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri driver-unbind(gadget);

Re: [PATCH 14/14] usb: udc-core: add judgement logic for usb_gadget_connect

2013-03-15 Thread Felipe Balbi
Hi, On Fri, Mar 15, 2013 at 02:06:16PM +0800, Peter Chen wrote: @@ -278,7 +278,10 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri driver-unbind(gadget); goto err1; } -

Re: [PATCH 14/14] usb: udc-core: add judgement logic for usb_gadget_connect

2013-03-15 Thread Peter Chen
On Fri, Mar 15, 2013 at 09:51:29AM +0200, Felipe Balbi wrote: that's all wrong and needs to be fixed. UDC-core has to be the central point for all these details. We start with the easiest way (call connect unconditionally after gadget driver is loaded) and optimize it as we go (making sure

Re: [PATCH 14/14] usb: udc-core: add judgement logic for usb_gadget_connect

2013-03-15 Thread Felipe Balbi
Hi, On Fri, Mar 15, 2013 at 06:04:08PM +0800, Peter Chen wrote: On Fri, Mar 15, 2013 at 09:51:29AM +0200, Felipe Balbi wrote: that's all wrong and needs to be fixed. UDC-core has to be the central point for all these details. We start with the easiest way (call connect unconditionally

Re: [PATCH 14/14] usb: udc-core: add judgement logic for usb_gadget_connect

2013-03-15 Thread Peter Chen
On Fri, Mar 15, 2013 at 12:37:01PM +0200, Felipe Balbi wrote: */ static inline int usb_gadget_disconnect(struct usb_gadget *gadget) { + int ret = 0; + if (!gadget-ops-pullup) return -EOPNOTSUPP; - return gadget-ops-pullup(gadget, 0); + + if

Re: [PATCH 14/14] usb: udc-core: add judgement logic for usb_gadget_connect

2013-03-14 Thread Peter Chen
On Thu, Mar 14, 2013 at 11:00:05AM +0200, Felipe Balbi wrote: Hi, On Thu, Mar 14, 2013 at 01:50:42PM +0800, Peter Chen wrote: - If there is no vbus control to indicate connection. and disconnect, we can pullup dp when we load gadget module. - If we have vbus control logic, the dp is

Re: [PATCH 14/14] usb: udc-core: add judgement logic for usb_gadget_connect

2013-03-14 Thread Felipe Balbi
Hi, On Thu, Mar 14, 2013 at 05:24:39PM +0800, Peter Chen wrote: @@ -278,7 +278,10 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri driver-unbind(gadget); goto err1; } - usb_gadget_connect(gadget); + if

[PATCH 14/14] usb: udc-core: add judgement logic for usb_gadget_connect

2013-03-13 Thread Peter Chen
- If there is no vbus control to indicate connection. and disconnect, we can pullup dp when we load gadget module. - If we have vbus control logic, the dp is better pull up when there is a vbus session. Signed-off-by: Peter Chen peter.c...@freescale.com --- drivers/usb/gadget/udc-core.c | 10