/* * The controller is gadget only, the state of the host mode IRQ bits is * undefined. Mask them to make sure that the musb driver core will * never see them set
*/
musb->int_usb &= MUSB_INTR_SUSPEND | MUSB_INTR_RESUME |
MUSB_INTR_RESET | MUSB_INTR_SOF;
if (musb->int_usb || musb->int_tx || musb->int_rx)
retval = musb_interrupt(musb);
spin_unlock_irqrestore(&musb->lock, flags);
if (retval == IRQ_HANDLED || retval_dma == IRQ_HANDLED) return IRQ_HANDLED;
staticconststruct musb_hdrc_config jz4740_musb_config = { /* Silicon does not implement USB OTG. */
.multipoint = 0, /* Max EPs scanned, driver will decide which EP can be used. */
.num_eps = 4, /* RAMbits needed to configure EPs from table */
.ram_bits = 9,
.fifo_cfg = jz4740_musb_fifo_cfg,
.fifo_cfg_size = ARRAY_SIZE(jz4740_musb_fifo_cfg),
};
if (IS_ENABLED(CONFIG_GENERIC_PHY)) {
musb->phy = devm_of_phy_get_by_index(dev, dev->of_node, 0); if (IS_ERR(musb->phy)) {
err = PTR_ERR(musb->phy); if (err != -ENODEV) {
dev_err(dev, "Unable to get PHY\n"); return err;
}
musb->phy = NULL;
}
}
if (musb->phy) {
err = phy_init(musb->phy); if (err) {
dev_err(dev, "Failed to init PHY\n"); return err;
}
err = phy_power_on(musb->phy); if (err) {
dev_err(dev, "Unable to power on PHY\n"); goto err_phy_shutdown;
}
} else { if (dev->of_node)
musb->xceiv = devm_usb_get_phy_by_phandle(dev, "phys", 0); else
musb->xceiv = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); if (IS_ERR(musb->xceiv)) {
dev_err(dev, "No transceiver configured\n"); return PTR_ERR(musb->xceiv);
}
}
glue->role_sw = usb_role_switch_register(dev, &role_sw_desc); if (IS_ERR(glue->role_sw)) {
dev_err(dev, "Failed to register USB role switch\n");
err = PTR_ERR(glue->role_sw); goto err_phy_power_down;
}
/* * Silicon does not implement ConfigData register. * Set dyn_fifo to avoid reading EP config from hardware.
*/
musb->dyn_fifo = true;
musb->isr = jz4740_musb_interrupt;
return 0;
err_phy_power_down: if (musb->phy)
phy_power_off(musb->phy);
err_phy_shutdown: if (musb->phy)
phy_exit(musb->phy); return err;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.