diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 18da746ae6bf6cd5983bca137765fb9e56dc19c7..a1aa75eb51e27f3c8149be899d36d41bf228b697 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1813,6 +1813,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) musb->board_set_power = plat->set_power; musb->min_power = plat->min_power; musb->ops = plat->platform_ops; + musb->port_mode = plat->mode; /* The musb_platform_init() call: * - adjusts musb->mregs diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index e633fce787fbe75cfc87b6f0b47e6d0b337762a0..7d341c387eab94e4148cba0e8db0e2bf25130811 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -77,6 +77,12 @@ struct musb_ep; #define is_peripheral_active(m) (!(m)->is_host) #define is_host_active(m) ((m)->is_host) +enum { + MUSB_PORT_MODE_HOST = 1, + MUSB_PORT_MODE_GADGET, + MUSB_PORT_MODE_DUAL_ROLE, +}; + #ifdef CONFIG_PROC_FS #include #define MUSB_CONFIG_PROC_FS @@ -356,6 +362,7 @@ struct musb { u8 min_power; /* vbus for periph, in mA/2 */ + int port_mode; /* MUSB_PORT_MODE_* */ bool is_host; int a_wait_bcon; /* VBUS timeout in msecs */