[PATCH 1/3 v3] usb: host: fotg2: add device tree probing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Add device tree probing for fotg2-hcd driver
This device in a dual role hcd/otg device and it's used on Gemini Soc.

Currently all Gemini Soc based devices uses only the hcd part.

v2:
fix wrong name in MODULE_DEVICE_TABLE()

v3:
better commit message
remove dma_coerce_mask_and_coherent() suggested by Arnd

Acked-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
Signed-off-by: Hans Ulli Kroll <ulli.kroll@xxxxxxxxxxxxxx>
---
 drivers/usb/host/fotg210-hcd.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/usb/host/fotg210-hcd.c 
b/drivers/usb/host/fotg210-hcd.c
index 9d0b0518290a..ff6e4275fcf6 100644
--- a/drivers/usb/host/fotg210-hcd.c
+++ b/drivers/usb/host/fotg210-hcd.c
@@ -23,6 +23,7 @@
  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/device.h>
 #include <linux/dmapool.h>
 #include <linux/kernel.h>
@@ -5676,9 +5677,18 @@ static int fotg210_hcd_remove(struct 
platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id fotg210_ehci_match[] = {
+	{ .compatible = "faraday,fotg210-hcd" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, fotg210_ehci_match);
+#endif
+
 static struct platform_driver fotg210_hcd_driver = {
 	.driver = {
 		.name   = "fotg210-hcd",
+		.of_match_table = of_match_ptr(fotg210_ehci_match),
 	},
 	.probe  = fotg210_hcd_probe,
 	.remove = fotg210_hcd_remove,
-- 
2.11.0
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux