sunxi: otg: Fix peripheral mode
Peripheral mode needs us to signal vusb high to the phy for it to work, just like the host mode does. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
This commit is contained in:
parent
51637afe98
commit
b1b912ddf3
|
|
@ -145,16 +145,6 @@ static void USBC_ForceIdToHigh(__iomem void *base)
|
||||||
musb_writel(base, USBC_REG_o_ISCR, reg_val);
|
musb_writel(base, USBC_REG_o_ISCR, reg_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void USBC_ForceVbusValidDisable(__iomem void *base)
|
|
||||||
{
|
|
||||||
u32 reg_val;
|
|
||||||
|
|
||||||
reg_val = musb_readl(base, USBC_REG_o_ISCR);
|
|
||||||
reg_val &= ~(0x03 << USBC_BP_ISCR_FORCE_VBUS_VALID);
|
|
||||||
reg_val = USBC_WakeUp_ClearChangeDetect(reg_val);
|
|
||||||
musb_writel(base, USBC_REG_o_ISCR, reg_val);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void USBC_ForceVbusValidToHigh(__iomem void *base)
|
static void USBC_ForceVbusValidToHigh(__iomem void *base)
|
||||||
{
|
{
|
||||||
u32 reg_val;
|
u32 reg_val;
|
||||||
|
|
@ -248,12 +238,11 @@ static int sunxi_musb_init(struct musb *musb)
|
||||||
if (is_host_enabled(musb)) {
|
if (is_host_enabled(musb)) {
|
||||||
/* Host mode */
|
/* Host mode */
|
||||||
USBC_ForceIdToLow(musb->mregs);
|
USBC_ForceIdToLow(musb->mregs);
|
||||||
USBC_ForceVbusValidToHigh(musb->mregs);
|
|
||||||
} else {
|
} else {
|
||||||
/* Peripheral mode */
|
/* Peripheral mode */
|
||||||
USBC_ForceIdToHigh(musb->mregs);
|
USBC_ForceIdToHigh(musb->mregs);
|
||||||
USBC_ForceVbusValidDisable(musb->mregs);
|
|
||||||
}
|
}
|
||||||
|
USBC_ForceVbusValidToHigh(musb->mregs);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue