summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ohci-generic.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2015-12-17 21:46:04 -0500
committerTom Rini <trini@konsulko.com>2015-12-17 21:46:04 -0500
commit123b70177931a5aed92beca76bb622b2f4005be8 (patch)
tree83955f114744e2450e828ee5a183962287f43038 /drivers/usb/host/ohci-generic.c
parent9cddb4fe0266484aab9babdd2ebe650021644ea9 (diff)
parente4b70d80350c1238fa07872d71c19e3ddbf53b76 (diff)
Merge branch 'master' of git://git.denx.de/u-boot-usb
Diffstat (limited to 'drivers/usb/host/ohci-generic.c')
-rw-r--r--drivers/usb/host/ohci-generic.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/usb/host/ohci-generic.c b/drivers/usb/host/ohci-generic.c
new file mode 100644
index 0000000000..f3307f47a7
--- /dev/null
+++ b/drivers/usb/host/ohci-generic.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2015 Alexey Brodkin <abrodkin@synopsys.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include "ohci.h"
+
+#if !defined(CONFIG_USB_OHCI_NEW)
+# error "Generic OHCI driver requires CONFIG_USB_OHCI_NEW"
+#endif
+
+struct generic_ohci {
+ ohci_t ohci;
+};
+
+static int ohci_usb_probe(struct udevice *dev)
+{
+ struct ohci_regs *regs = (struct ohci_regs *)dev_get_addr(dev);
+
+ return ohci_register(dev, regs);
+}
+
+static int ohci_usb_remove(struct udevice *dev)
+{
+ return ohci_deregister(dev);
+}
+
+static const struct udevice_id ohci_usb_ids[] = {
+ { .compatible = "generic-ohci" },
+ { }
+};
+
+U_BOOT_DRIVER(ohci_generic) = {
+ .name = "ohci_generic",
+ .id = UCLASS_USB,
+ .of_match = ohci_usb_ids,
+ .probe = ohci_usb_probe,
+ .remove = ohci_usb_remove,
+ .ops = &ohci_usb_ops,
+ .priv_auto_alloc_size = sizeof(struct generic_ohci),
+ .flags = DM_FLAG_ALLOC_PRIV_DMA,
+};