Commit 9b753764 authored by Bin Liu's avatar Bin Liu Committed by Felipe Balbi

usb: musb: set the controller speed based on the config setting

Set the Power register HSENAB bit based on musb->config->maximum_speed,
so that the glue layer can control MUSB to work in high- or full-speed.
Signed-off-by: default avatarBin Liu <b-liu@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent f35fe4be
...@@ -1028,18 +1028,22 @@ void musb_start(struct musb *musb) ...@@ -1028,18 +1028,22 @@ void musb_start(struct musb *musb)
{ {
void __iomem *regs = musb->mregs; void __iomem *regs = musb->mregs;
u8 devctl = musb_readb(regs, MUSB_DEVCTL); u8 devctl = musb_readb(regs, MUSB_DEVCTL);
u8 power;
dev_dbg(musb->controller, "<== devctl %02x\n", devctl); dev_dbg(musb->controller, "<== devctl %02x\n", devctl);
musb_enable_interrupts(musb); musb_enable_interrupts(musb);
musb_writeb(regs, MUSB_TESTMODE, 0); musb_writeb(regs, MUSB_TESTMODE, 0);
/* put into basic highspeed mode and start session */ power = MUSB_POWER_ISOUPDATE;
musb_writeb(regs, MUSB_POWER, MUSB_POWER_ISOUPDATE /*
| MUSB_POWER_HSENAB * treating UNKNOWN as unspecified maximum speed, in which case
/* ENSUSPEND wedges tusb */ * we will default to high-speed.
/* | MUSB_POWER_ENSUSPEND */ */
); if (musb->config->maximum_speed == USB_SPEED_HIGH ||
musb->config->maximum_speed == USB_SPEED_UNKNOWN)
power |= MUSB_POWER_HSENAB;
musb_writeb(regs, MUSB_POWER, power);
musb->is_active = 0; musb->is_active = 0;
devctl = musb_readb(regs, MUSB_DEVCTL); devctl = musb_readb(regs, MUSB_DEVCTL);
......
...@@ -95,7 +95,7 @@ struct musb_hdrc_config { ...@@ -95,7 +95,7 @@ struct musb_hdrc_config {
/* musb CLKIN in Blackfin in MHZ */ /* musb CLKIN in Blackfin in MHZ */
unsigned char clkin; unsigned char clkin;
#endif #endif
u32 maximum_speed;
}; };
struct musb_hdrc_platform_data { struct musb_hdrc_platform_data {
......
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