ohci-generic.c 905 B

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