Re: [PATCH v2 2/3] usb: udc: add usb_udc_vbus_handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 10, 2015 at 04:26:58PM -0500, Felipe Balbi wrote:
> hi,
> 
> On Fri, Mar 06, 2015 at 10:36:03AM +0800, Peter Chen wrote:
> > @@ -145,6 +148,34 @@ EXPORT_SYMBOL_GPL(usb_gadget_set_state);
> >  
> >  /* ------------------------------------------------------------------------- */
> >  
> > +static void usb_udc_connect_control(struct usb_udc *udc)
> > +{
> > +	if (udc->vbus)
> > +		usb_gadget_connect(udc->gadget);
> > +	else
> > +		usb_gadget_disconnect(udc->gadget);
> > +}
> > +
> > +/**
> > + * usb_udc_vbus_handler - updates the udc core vbus status, and try to
> > + * connect or disconnect gadget
> > + * @gadget: The gadget which vbus change occurs
> > + * @status: The vbus status
> > + *
> > + * The udc driver calls it when it wants to connect or disconnect gadget
> > + * according to vbus status.
> > + */
> > +void usb_udc_vbus_handler(struct usb_gadget *gadget, bool status)
> 
> I have a feeling we need more bits for status here. If we ever want to
> treat different VBUS levels (vbus valid, session valid, session end,
> etc). But maybe we can just change this prototype when that's really
> needed ?
> 

Controller glue layer should decide it, isn't it? And it should be
decided at the driver initialization, and only one time. The host
only cares about CONNECT, and the CONNECT should be later than session
valid.

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux