blob: f3307f47a76c3641ea5d73f2b45baccc9bcffe64 [file] [log] [blame]
Alexey Brodkinfee331f2015-12-14 17:18:50 +03001/*
2 * Copyright (C) 2015 Alexey Brodkin <abrodkin@synopsys.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <dm.h>
9#include "ohci.h"
10
11#if !defined(CONFIG_USB_OHCI_NEW)
12# error "Generic OHCI driver requires CONFIG_USB_OHCI_NEW"
13#endif
14
15struct generic_ohci {
16 ohci_t ohci;
17};
18
19static int ohci_usb_probe(struct udevice *dev)
20{
21 struct ohci_regs *regs = (struct ohci_regs *)dev_get_addr(dev);
22
23 return ohci_register(dev, regs);
24}
25
26static int ohci_usb_remove(struct udevice *dev)
27{
28 return ohci_deregister(dev);
29}
30
31static const struct udevice_id ohci_usb_ids[] = {
32 { .compatible = "generic-ohci" },
33 { }
34};
35
36U_BOOT_DRIVER(ohci_generic) = {
37 .name = "ohci_generic",
38 .id = UCLASS_USB,
39 .of_match = ohci_usb_ids,
40 .probe = ohci_usb_probe,
41 .remove = ohci_usb_remove,
42 .ops = &ohci_usb_ops,
43 .priv_auto_alloc_size = sizeof(struct generic_ohci),
44 .flags = DM_FLAG_ALLOC_PRIV_DMA,
45};