Re: [RFC/PATCH 1/2] usb: gadget: introduce gadget status tracking

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

 



On Mon, Dec 19, 2011 at 02:06:17PM +0200, Felipe Balbi wrote:
> On Mon, Dec 19, 2011 at 01:04:44PM +0100, Sebastian Andrzej Siewior wrote:
> > * Felipe Balbi | 2011-12-19 13:04:05 [+0200]:
> > 
> > >--- a/include/linux/usb/gadget.h
> > >+++ b/include/linux/usb/gadget.h
> > >@@ -478,6 +478,53 @@ struct usb_gadget_ops {
> > > 	int	(*stop)(struct usb_gadget_driver *);
> > > };
> > > 
> > >+enum usb_device_status {
> > >+	USB_STATUS_IDLE,
> > >+	USB_STATUS_CONNECTED,
> > >+	USB_STATUS_RESETTING,
> > >+
> > >+	USB_STATUS_DEFAULT,
> > >+	USB_STATUS_ADDRESSED,
> > >+	USB_STATUS_UNCONFIGURED,
> > >+	USB_STATUS_CONFIGURED,
> > >+
> > >+	USB_STATUS_SUSPENDING,
> > >+	USB_STATUS_SUSPENDED,
> > >+	USB_STATUS_RESUMING,
> > >+	USB_STATUS_RESUMED,
> > >+};

Please connect me if my understanding is wrong

	USB_STATUS_IDLE, /* default state */
	USB_STATUS_CONNECTED, /* when get vbus rising interrupt */
	USB_STATUS_RESETTING, /* when receive BUS_RESET */

	USB_STATUS_DEFAULT,  /* ??? */
	USB_STATUS_ADDRESSED, /* after receive SET_ADDRESS */
	USB_STATUS_UNCONFIGURED, /* ??? */
	USB_STATUS_CONFIGURED, /* after receive SET_CONFIGRUTION */

	USB_STATUS_SUSPENDING, /* bus idle 3ms */
	USB_STATUS_SUSPENDED,
	USB_STATUS_RESUMING,  /* after receive resuming signal */
	USB_STATUS_RESUMED,

1. when the status will be used I have marked with /* ??? */ above?
2. Any differences between USB_STATUS_SUSPENDING and USB_STATUS_SUSPENDED?

> > 
> > Those look simple enough. Could add little doc when each state should be
> > set. So one knows the difference betweend USB_STATUS_CONNECTED,
> > USB_STATUS_DEFAULT and USB_STATUS_CONFIGURED.
> > The flow is 
> > 
> >   idle -> connected -> reset -> addressed -> configured
> 
> idle -> connected -> resetting -> default -> addressed -> configured
> 
> -- 
> balbi



-- 

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