1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <console/console.h>
4 #include <device/mmio.h>
5 #include <device/device.h>
6 #include <device/pci_def.h>
7 #include <device/xhci.h>
9 enum cb_err
xhci_for_each_ext_cap(const struct device
*device
, void *context
,
10 void (*callback
)(void *context
,
11 const struct xhci_ext_cap
*cap
))
13 const struct resource
*res
;
18 res
= probe_resource(device
, PCI_BASE_ADDRESS_0
);
20 printk(BIOS_ERR
, "%s: Unable to find BAR resource for %s\n", __func__
,
25 return xhci_resource_for_each_ext_cap(res
, context
, callback
);
28 enum cb_err
xhci_for_each_supported_usb_cap(
29 const struct device
*device
, void *context
,
30 void (*callback
)(void *context
, const struct xhci_supported_protocol
*data
))
32 const struct resource
*res
;
37 res
= probe_resource(device
, PCI_BASE_ADDRESS_0
);
39 printk(BIOS_ERR
, "%s: Unable to find BAR resource for %s\n", __func__
,
44 return xhci_resource_for_each_supported_usb_cap(res
, context
, callback
);