Commit accefdd4 authored by Vivek Gautam's avatar Vivek Gautam Committed by Felipe Balbi

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: default avatarVivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 124dafde
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/usb/otg.h> #include <linux/usb/otg.h>
#include <linux/usb/nop-usb-xceiv.h> #include <linux/usb/nop-usb-xceiv.h>
#include <linux/of.h>
#include "core.h" #include "core.h"
...@@ -87,6 +88,8 @@ static int __devinit dwc3_exynos_register_phys(struct dwc3_exynos *exynos) ...@@ -87,6 +88,8 @@ static int __devinit dwc3_exynos_register_phys(struct dwc3_exynos *exynos)
return ret; return ret;
} }
static u64 dwc3_exynos_dma_mask = DMA_BIT_MASK(32);
static int __devinit dwc3_exynos_probe(struct platform_device *pdev) static int __devinit dwc3_exynos_probe(struct platform_device *pdev)
{ {
struct dwc3_exynos_data *pdata = pdev->dev.platform_data; struct dwc3_exynos_data *pdata = pdev->dev.platform_data;
...@@ -102,6 +105,14 @@ static int __devinit dwc3_exynos_probe(struct platform_device *pdev) ...@@ -102,6 +105,14 @@ static int __devinit dwc3_exynos_probe(struct platform_device *pdev)
goto err0; goto err0;
} }
/*
* Right now device-tree probed devices don't get dma_mask set.
* Since shared usb code relies on it, set it here for now.
* Once we move to full device tree support this will vanish off.
*/
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &dwc3_exynos_dma_mask;
platform_set_drvdata(pdev, exynos); platform_set_drvdata(pdev, exynos);
ret = dwc3_exynos_register_phys(exynos); ret = dwc3_exynos_register_phys(exynos);
...@@ -191,11 +202,20 @@ static int __devexit dwc3_exynos_remove(struct platform_device *pdev) ...@@ -191,11 +202,20 @@ static int __devexit dwc3_exynos_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_OF
static const struct of_device_id exynos_dwc3_match[] = {
{ .compatible = "samsung,exynos-dwc3" },
{},
};
MODULE_DEVICE_TABLE(of, exynos_dwc3_match);
#endif
static struct platform_driver dwc3_exynos_driver = { static struct platform_driver dwc3_exynos_driver = {
.probe = dwc3_exynos_probe, .probe = dwc3_exynos_probe,
.remove = __devexit_p(dwc3_exynos_remove), .remove = __devexit_p(dwc3_exynos_remove),
.driver = { .driver = {
.name = "exynos-dwc3", .name = "exynos-dwc3",
.of_match_table = of_match_ptr(exynos_dwc3_match),
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment