Skip to content

usb: add HCD providers

Rafał Miłecki linux-devicetree linux-leds lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest0 of 1 patch 14 repliesIn review

Patches in v2 No applies recorded yet

The patch the cover letter announces is not in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH V2 0/1] usb: add HCD providers

Hi again,

This is my second try of getting HCD providers into usb subsystem.

During discussion of V1 I realized there are about 26 drivers adding a single HCD and all of them would need to be modified. So instead I decided to put relevant code in usb_add_hcd. It checks if the HCD we register is a primary one and if so, it registers a proper provider.

Please note that of_hcd_xlate_simple was also extended to allow getting shared HCD (which is used e.g. in case of XHCI).

So now you can have something like:

ohci: ohci@21000 {
	#usb-cells = <0>;
	compatible = "generic-ohci";
	reg = <0x00001000 0x1000>;
	interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
};
ehci: ehci@22000 {
	#usb-cells = <0>;
	compatible = "generic-ehci";
	reg = <0x00002000 0x1000>;
	interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
};
xhci: xhci@23000 {
	#usb-cells = <1>;
	compatible = "generic-xhci";
	reg = <0x00003000 0x1000>;
	interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
};

The last (second) patch is not supposed to be applied, it's used only as a proof and example of how providers can be used.

Rafał Miłecki (1):
usb: core: add support for HCD providers

 drivers/usb/core/Makefile     |  1 +
 drivers/usb/core/hcd.c        |  8 ++++
 drivers/usb/core/provider.c   | 99 +++++++++++++++++++++++++++++++++++++++++++
 include/dt-bindings/usb/usb.h |  7 +++
 include/linux/usb/hcd.h       |  2 +
 include/linux/usb/provider.h  | 39 +++++++++++++++++
 6 files changed, 156 insertions(+)
 create mode 100644 drivers/usb/core/provider.c
 create mode 100644 include/dt-bindings/usb/usb.h
 create mode 100644 include/linux/usb/provider.h
Signature · 6 lines
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html