staticint exynos_ohci_phy_enable(struct device *dev)
{ struct usb_hcd *hcd = dev_get_drvdata(dev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); int i; int ret = 0;
for (i = 0; ret == 0 && i < PHY_NUMBER; i++)
ret = phy_power_on(exynos_ohci->phy[i]); if (ret) for (i--; i >= 0; i--)
phy_power_off(exynos_ohci->phy[i]);
for (i = 0; i < PHY_NUMBER; i++)
phy_power_off(exynos_ohci->phy[i]);
}
staticint exynos_ohci_probe(struct platform_device *pdev)
{ struct exynos_ohci_hcd *exynos_ohci; struct usb_hcd *hcd; struct resource *res; int irq; int err;
/* * Right now device-tree probed devices don't get dma_mask set. * Since shared usb code relies on it, set it here for now. * Once we move to full device tree support this will vanish off.
*/
err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); if (err) return err;
hcd = usb_create_hcd(&exynos_ohci_hc_driver,
&pdev->dev, dev_name(&pdev->dev)); if (!hcd) {
dev_err(&pdev->dev, "Unable to create HCD\n"); return -ENOMEM;
}
exynos_ohci = to_exynos_ohci(hcd);
err = exynos_ohci_get_phy(&pdev->dev, exynos_ohci); if (err) goto fail_io;
err = exynos_ohci_phy_enable(&pdev->dev); if (err) {
dev_err(&pdev->dev, "Failed to enable USB phy\n"); goto fail_io;
}
/* * Workaround: reset of_node pointer to avoid conflict between legacy * Exynos OHCI port subnodes and generic USB device bindings
*/
exynos_ohci->of_node = pdev->dev.of_node; if (exynos_ohci->legacy_phy)
pdev->dev.of_node = NULL;
err = usb_add_hcd(hcd, irq, IRQF_SHARED); if (err) {
dev_err(&pdev->dev, "Failed to add USB HCD\n"); goto fail_add_hcd;
}
device_wakeup_enable(hcd->self.controller); return 0;
MODULE_ALIAS("platform:exynos-ohci");
MODULE_AUTHOR("Jingoo Han ");
MODULE_DESCRIPTION("OHCI support for Samsung S5P/Exynos SoC Series");
MODULE_LICENSE("GPL v2");
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.