void __iomem *base = musb->ctrl_base;
u32 reg;
+ /*
+ * Keep clock active when enabled. Note that this is not tied to
+ * drawing VBUS, as with OTG mA can be less than musb->min_power.
+ */
+ if (musb->set_clock)
+ if (mA)
+ musb->set_clock(musb->clock, 1);
+ else
+ musb->set_clock(musb->clock, 0);
+
/* tps65030 seems to consume max 100mA, with maybe 60mA available
* (measured on one board) for things other than tps and tusb.
*
reg = musb_readl(base, TUSB_PRCM_MNGMT);
if (mA) {
- if (musb->set_clock)
- musb->set_clock(musb->clock, 1);
musb->is_bus_powered = 1;
reg |= TUSB_PRCM_MNGMT_15_SW_EN | TUSB_PRCM_MNGMT_33_SW_EN;
} else {
musb->is_bus_powered = 0;
reg &= ~(TUSB_PRCM_MNGMT_15_SW_EN | TUSB_PRCM_MNGMT_33_SW_EN);
- if (musb->set_clock)
- musb->set_clock(musb->clock, 0);
}
musb_writel(base, TUSB_PRCM_MNGMT, reg);