summaryrefslogtreecommitdiff
path: root/drivers/usb/musb/jz4740.c
diff options
context:
space:
mode:
authorPaul Cercueil <paul@crapouillou.net>2019-02-11 11:14:48 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-12 08:54:44 +0100
commite2d5e09485fc5363d4be58ae04303e54a5956aa7 (patch)
treef2f089eb102665e1599125e6c19f0cd55df3c904 /drivers/usb/musb/jz4740.c
parentecd927ab7c8d513f1e7ebbc32d27b2919208bf4a (diff)
downloadlwn-e2d5e09485fc5363d4be58ae04303e54a5956aa7.tar.gz
lwn-e2d5e09485fc5363d4be58ae04303e54a5956aa7.zip
usb: musb: jz4740: Add support for devicetree
Add support for probing the driver from devicetree. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/musb/jz4740.c')
-rw-r--r--drivers/usb/musb/jz4740.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/musb/jz4740.c b/drivers/usb/musb/jz4740.c
index 04d8b2bc205a..a60627bf7be3 100644
--- a/drivers/usb/musb/jz4740.c
+++ b/drivers/usb/musb/jz4740.c
@@ -10,6 +10,7 @@
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/usb/usb_phy_generic.h>
@@ -188,11 +189,20 @@ static int jz4740_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_OF
+static const struct of_device_id jz4740_musb_of_match[] = {
+ { .compatible = "ingenic,jz4740-musb" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, jz4740_musb_of_match);
+#endif
+
static struct platform_driver jz4740_driver = {
.probe = jz4740_probe,
.remove = jz4740_remove,
.driver = {
.name = "musb-jz4740",
+ .of_match_table = of_match_ptr(jz4740_musb_of_match),
},
};