Commit 2df6761e authored by Felipe Balbi's avatar Felipe Balbi

usb: musb: core: call musb_platform_set_mode() during probe

This will tell glue layer which mode we want port
to be in.
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 943c1397
...@@ -1941,17 +1941,26 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) ...@@ -1941,17 +1941,26 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
switch (musb->port_mode) { switch (musb->port_mode) {
case MUSB_PORT_MODE_HOST: case MUSB_PORT_MODE_HOST:
status = musb_host_setup(musb, plat->power); status = musb_host_setup(musb, plat->power);
if (status < 0)
goto fail3;
status = musb_platform_set_mode(musb, MUSB_HOST);
break; break;
case MUSB_PORT_MODE_GADGET: case MUSB_PORT_MODE_GADGET:
status = musb_gadget_setup(musb); status = musb_gadget_setup(musb);
if (status < 0)
goto fail3;
status = musb_platform_set_mode(musb, MUSB_PERIPHERAL);
break; break;
case MUSB_PORT_MODE_DUAL_ROLE: case MUSB_PORT_MODE_DUAL_ROLE:
status = musb_host_setup(musb, plat->power); status = musb_host_setup(musb, plat->power);
if (status < 0) if (status < 0)
goto fail3; goto fail3;
status = musb_gadget_setup(musb); status = musb_gadget_setup(musb);
if (status) if (status) {
musb_host_cleanup(musb); musb_host_cleanup(musb);
goto fail3;
}
status = musb_platform_set_mode(musb, MUSB_OTG);
break; break;
default: default:
dev_err(dev, "unsupported port mode %d\n", musb->port_mode); dev_err(dev, "unsupported port mode %d\n", musb->port_mode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment