Hi, On Tue, Feb 26, 2013 at 07:23:01PM -0800, Paul Zimmerman wrote: > Add a usb_otg_state_string() routine to print the OTG state for > debugging > > Signed-off-by: Paul Zimmerman <paulz@xxxxxxxxxxxx> > --- > drivers/usb/usb-common.c | 26 ++++++++++++++++++++++++++ > include/linux/usb/phy.h | 8 ++++++++ > 2 files changed, 34 insertions(+) > > diff --git a/drivers/usb/usb-common.c b/drivers/usb/usb-common.c > index d29503e..6499c1f 100644 > --- a/drivers/usb/usb-common.c > +++ b/drivers/usb/usb-common.c > @@ -14,6 +14,7 @@ > #include <linux/kernel.h> > #include <linux/module.h> > #include <linux/usb/ch9.h> > +#include <linux/usb/phy.h> > > const char *usb_speed_string(enum usb_device_speed speed) > { > @@ -32,4 +33,29 @@ const char *usb_speed_string(enum usb_device_speed speed) > } > EXPORT_SYMBOL_GPL(usb_speed_string); > > +const char *usb_otg_state_string(enum usb_otg_state state) > +{ > + static const char *const names[] = { > + [OTG_STATE_UNDEFINED] = "UNDEFINED", > + [OTG_STATE_B_IDLE] = "B_IDLE", > + [OTG_STATE_B_SRP_INIT] = "B_SRP_INIT", > + [OTG_STATE_B_PERIPHERAL] = "B_PERIPHERAL", > + [OTG_STATE_B_WAIT_ACON] = "B_WAIT_ACON", > + [OTG_STATE_B_HOST] = "B_HOST", > + [OTG_STATE_A_IDLE] = "A_IDLE", > + [OTG_STATE_A_WAIT_VRISE] = "A_WAIT_VRISE", > + [OTG_STATE_A_WAIT_BCON] = "A_WAIT_BCON", > + [OTG_STATE_A_HOST] = "A_HOST", > + [OTG_STATE_A_SUSPEND] = "A_SUSPEND", > + [OTG_STATE_A_PERIPHERAL] = "A_PERIPHERAL", > + [OTG_STATE_A_WAIT_VFALL] = "A_WAIT_VFALL", > + [OTG_STATE_A_VBUS_ERR] = "A_VBUS_ERR", please follow the convention of the other functions and print lower case except for UNDEFINED. other than that: Acked-by: Felipe Balbi <balbi@xxxxxx> -- balbi
Attachment:
signature.asc
Description: Digital signature