mb/google/brya/var/orisa: Update Type C DisplayPort HPD Configuration
[coreboot2.git] / src / device / xhci.c
blob0961d0c988d4ca561e79c66a979d106e78f3fd8c
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;
15 if (!device)
16 return CB_ERR;
18 res = probe_resource(device, PCI_BASE_ADDRESS_0);
19 if (!res) {
20 printk(BIOS_ERR, "%s: Unable to find BAR resource for %s\n", __func__,
21 dev_path(device));
22 return CB_ERR;
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;
34 if (!device)
35 return CB_ERR;
37 res = probe_resource(device, PCI_BASE_ADDRESS_0);
38 if (!res) {
39 printk(BIOS_ERR, "%s: Unable to find BAR resource for %s\n", __func__,
40 dev_path(device));
41 return CB_ERR;
44 return xhci_resource_for_each_supported_usb_cap(res, context, callback);