Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: ohci-omap3: Add device tree support and binding information

Allows the OHCI controller found in OMAP3 and later chips to
be specified via device tree.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Roger Quadros and committed by
Greg Kroah-Hartman
5867320d 8c3ec385

+34
+15
Documentation/devicetree/bindings/usb/ohci-omap3.txt
··· 1 + OMAP HS USB OHCI controller (OMAP3 and later) 2 + 3 + Required properties: 4 + 5 + - compatible: should be "ti,ohci-omap3" 6 + - reg: should contain one register range i.e. start and length 7 + - interrupts: description of the interrupt line 8 + 9 + Example for OMAP4: 10 + 11 + usbhsohci: ohci@4a064800 { 12 + compatible = "ti,ohci-omap3", "usb-ohci"; 13 + reg = <0x4a064800 0x400>; 14 + interrupts = <0 76 0x4>; 15 + };
+19
drivers/usb/host/ohci-omap3.c
··· 31 31 32 32 #include <linux/platform_device.h> 33 33 #include <linux/pm_runtime.h> 34 + #include <linux/of.h> 35 + #include <linux/dma-mapping.h> 34 36 35 37 /*-------------------------------------------------------------------------*/ 36 38 ··· 114 112 115 113 /*-------------------------------------------------------------------------*/ 116 114 115 + static u64 omap_ohci_dma_mask = DMA_BIT_MASK(32); 116 + 117 117 /* 118 118 * configure so an HC device and id are always provided 119 119 * always called with process context; sleeping is OK ··· 163 159 return -ENOMEM; 164 160 } 165 161 162 + /* 163 + * Right now device-tree probed devices don't get dma_mask set. 164 + * Since shared usb code relies on it, set it here for now. 165 + * Once we have dma capability bindings this can go away. 166 + */ 167 + if (!pdev->dev.dma_mask) 168 + pdev->dev.dma_mask = &omap_ohci_dma_mask; 166 169 167 170 hcd = usb_create_hcd(&ohci_omap3_hc_driver, dev, 168 171 dev_name(dev)); ··· 239 228 hcd->driver->shutdown(hcd); 240 229 } 241 230 231 + static const struct of_device_id omap_ohci_dt_ids[] = { 232 + { .compatible = "ti,ohci-omap3" }, 233 + { } 234 + }; 235 + 236 + MODULE_DEVICE_TABLE(of, omap_ohci_dt_ids); 237 + 242 238 static struct platform_driver ohci_hcd_omap3_driver = { 243 239 .probe = ohci_hcd_omap3_probe, 244 240 .remove = ohci_hcd_omap3_remove, 245 241 .shutdown = ohci_hcd_omap3_shutdown, 246 242 .driver = { 247 243 .name = "ohci-omap3", 244 + .of_match_table = of_match_ptr(omap_ohci_dt_ids), 248 245 }, 249 246 }; 250 247