aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorVivek Gautam <gautam.vivek@samsung.com>2012-11-03 08:30:27 -0400
committerFelipe Balbi <balbi@ti.com>2012-11-06 06:44:15 -0500
commitaccefdd4b234f029a530928ee930b9dcac88fe84 (patch)
treebde0b8305905a3a99338b94f796f7ac8519a45b7 /drivers/usb/dwc3
parent124dafde8f8174caf5cef1c3eaba001657d66f4f (diff)
usb: dwc3: exynos: add support for device tree
This patch adds support to parse probe data for dwc3-exynos driver using device tree. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/dwc3-exynos.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index 586f1051b059..6471d786b3cf 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -21,6 +21,7 @@
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/usb/otg.h> 22#include <linux/usb/otg.h>
23#include <linux/usb/nop-usb-xceiv.h> 23#include <linux/usb/nop-usb-xceiv.h>
24#include <linux/of.h>
24 25
25#include "core.h" 26#include "core.h"
26 27
@@ -87,6 +88,8 @@ err1:
87 return ret; 88 return ret;
88} 89}
89 90
91static u64 dwc3_exynos_dma_mask = DMA_BIT_MASK(32);
92
90static int __devinit dwc3_exynos_probe(struct platform_device *pdev) 93static int __devinit dwc3_exynos_probe(struct platform_device *pdev)
91{ 94{
92 struct dwc3_exynos_data *pdata = pdev->dev.platform_data; 95 struct dwc3_exynos_data *pdata = pdev->dev.platform_data;
@@ -102,6 +105,14 @@ static int __devinit dwc3_exynos_probe(struct platform_device *pdev)
102 goto err0; 105 goto err0;
103 } 106 }
104 107
108 /*
109 * Right now device-tree probed devices don't get dma_mask set.
110 * Since shared usb code relies on it, set it here for now.
111 * Once we move to full device tree support this will vanish off.
112 */
113 if (!pdev->dev.dma_mask)
114 pdev->dev.dma_mask = &dwc3_exynos_dma_mask;
115
105 platform_set_drvdata(pdev, exynos); 116 platform_set_drvdata(pdev, exynos);
106 117
107 ret = dwc3_exynos_register_phys(exynos); 118 ret = dwc3_exynos_register_phys(exynos);
@@ -191,11 +202,20 @@ static int __devexit dwc3_exynos_remove(struct platform_device *pdev)
191 return 0; 202 return 0;
192} 203}
193 204
205#ifdef CONFIG_OF
206static const struct of_device_id exynos_dwc3_match[] = {
207 { .compatible = "samsung,exynos-dwc3" },
208 {},
209};
210MODULE_DEVICE_TABLE(of, exynos_dwc3_match);
211#endif
212
194static struct platform_driver dwc3_exynos_driver = { 213static struct platform_driver dwc3_exynos_driver = {
195 .probe = dwc3_exynos_probe, 214 .probe = dwc3_exynos_probe,
196 .remove = __devexit_p(dwc3_exynos_remove), 215 .remove = __devexit_p(dwc3_exynos_remove),
197 .driver = { 216 .driver = {
198 .name = "exynos-dwc3", 217 .name = "exynos-dwc3",
218 .of_match_table = of_match_ptr(exynos_dwc3_match),
199 }, 219 },
200}; 220};
201 221