drivers/usb/host/xhci-ext-caps.c

Source file repositories/reference/linux-study-clean/drivers/usb/host/xhci-ext-caps.c

File Facts

System
Linux kernel
Corpus path
drivers/usb/host/xhci-ext-caps.c
Extension
.c
Size
2601 bytes
Lines
111
Domain
Driver Families
Bucket
drivers/usb
Inferred role
Driver Families: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (ret) {
			dev_err(dev, "failed to register device properties\n");
			platform_device_put(pdev);
			return ret;
		}
	}

	pdev->dev.parent = dev;

	ret = platform_device_add(pdev);
	if (ret) {
		dev_err(dev, "couldn't register intel_xhci_usb_sw pdev\n");
		platform_device_put(pdev);
		return ret;
	}

	ret = devm_add_action_or_reset(dev, xhci_intel_unregister_pdev, pdev);
	if (ret) {
		dev_err(dev, "couldn't add unregister action for intel_xhci_usb_sw pdev\n");
		return ret;
	}

	return 0;
}

int xhci_ext_cap_init(struct xhci_hcd *xhci)
{
	void __iomem *base = &xhci->cap_regs->hc_capbase;
	u32 offset, val;
	int ret;

	offset = xhci_find_next_ext_cap(base, 0, 0);

	while (offset) {
		val = readl(base + offset);

		switch (XHCI_EXT_CAPS_ID(val)) {
		case XHCI_EXT_CAPS_VENDOR_INTEL:
			if (xhci->quirks & XHCI_INTEL_USB_ROLE_SW) {
				ret = xhci_create_intel_xhci_sw_pdev(xhci,
								     offset);
				if (ret)
					return ret;
			}
			break;
		}
		offset = xhci_find_next_ext_cap(base, offset, 0);
	}

	return 0;
}
EXPORT_SYMBOL_GPL(xhci_ext_cap_init);

Annotation

Implementation Notes