* [PATCH 1/2] USB: dwc3-exynos: Add support for device tree
2012-10-13 13:47 [PATCH 0/2] USB: dwc3-exynos: Adding device tree support Vivek Gautam
@ 2012-10-13 13:47 ` Vivek Gautam
2012-10-13 13:54 ` kishon
2012-10-13 13:47 ` [PATCH 2/2] USB: DWC3: EXYNOS: Remove platform data for dwc3-exynos Vivek Gautam
1 sibling, 1 reply; 4+ messages in thread
From: Vivek Gautam @ 2012-10-13 13:47 UTC (permalink / raw)
To: linux-usb, linux-omap, devicetree-discuss
Cc: gregkh, balbi, rob.herring, thomas.abraham, kishon, av.tikhomirov
This patch adds support to parse probe data for
dwc3 driver for exynos using device tree
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
---
drivers/usb/dwc3/dwc3-exynos.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index ca65978..78e6219 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -21,6 +21,7 @@
#include <linux/clk.h>
#include <linux/usb/otg.h>
#include <linux/usb/nop-usb-xceiv.h>
+#include <linux/of.h>
#include "core.h"
@@ -87,6 +88,8 @@ err1:
return ret;
}
+static u64 dwc3_exynos_dma_mask = DMA_BIT_MASK(32);
+
static int __devinit dwc3_exynos_probe(struct platform_device *pdev)
{
struct dwc3_exynos_data *pdata = pdev->dev.platform_data;
@@ -103,6 +106,16 @@ static int __devinit dwc3_exynos_probe(struct platform_device *pdev)
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;
+ if (!pdev->dev.coherent_dma_mask)
+ pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+
platform_set_drvdata(pdev, exynos);
devid = dwc3_get_device_id();
@@ -200,11 +213,20 @@ static int __devexit dwc3_exynos_remove(struct platform_device *pdev)
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 = {
.probe = dwc3_exynos_probe,
.remove = __devexit_p(dwc3_exynos_remove),
.driver = {
.name = "exynos-dwc3",
+ .of_match_table = of_match_ptr(exynos_dwc3_match),
},
};
--
1.7.6.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] USB: DWC3: EXYNOS: Remove platform data for dwc3-exynos
2012-10-13 13:47 [PATCH 0/2] USB: dwc3-exynos: Adding device tree support Vivek Gautam
2012-10-13 13:47 ` [PATCH 1/2] USB: dwc3-exynos: Add support for device tree Vivek Gautam
@ 2012-10-13 13:47 ` Vivek Gautam
1 sibling, 0 replies; 4+ messages in thread
From: Vivek Gautam @ 2012-10-13 13:47 UTC (permalink / raw)
To: linux-usb, linux-omap, devicetree-discuss
Cc: gregkh, balbi, rob.herring, thomas.abraham, kishon, av.tikhomirov
We are removing plat data which was used till now to init and
exit phy. We no longer need this since dwc3-core takes care of
initializing and shutting-down the phy using usb_phy_init()
and usb_phy_shutdown().
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
---
drivers/usb/dwc3/dwc3-exynos.c | 16 ----------------
1 files changed, 0 insertions(+), 16 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index 78e6219..2796c1a 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -92,7 +92,6 @@ static u64 dwc3_exynos_dma_mask = DMA_BIT_MASK(32);
static int __devinit dwc3_exynos_probe(struct platform_device *pdev)
{
- struct dwc3_exynos_data *pdata = pdev->dev.platform_data;
struct platform_device *dwc3;
struct dwc3_exynos *exynos;
struct clk *clk;
@@ -152,14 +151,6 @@ static int __devinit dwc3_exynos_probe(struct platform_device *pdev)
clk_enable(exynos->clk);
- /* PHY initialization */
- if (!pdata) {
- dev_dbg(&pdev->dev, "missing platform data\n");
- } else {
- if (pdata->phy_init)
- pdata->phy_init(pdev, pdata->phy_type);
- }
-
ret = platform_device_add_resources(dwc3, pdev->resource,
pdev->num_resources);
if (ret) {
@@ -176,9 +167,6 @@ static int __devinit dwc3_exynos_probe(struct platform_device *pdev)
return 0;
err4:
- if (pdata && pdata->phy_exit)
- pdata->phy_exit(pdev, pdata->phy_type);
-
clk_disable(clk);
clk_put(clk);
err3:
@@ -194,7 +182,6 @@ err0:
static int __devexit dwc3_exynos_remove(struct platform_device *pdev)
{
struct dwc3_exynos *exynos = platform_get_drvdata(pdev);
- struct dwc3_exynos_data *pdata = pdev->dev.platform_data;
platform_device_unregister(exynos->dwc3);
platform_device_unregister(exynos->usb2_phy);
@@ -202,9 +189,6 @@ static int __devexit dwc3_exynos_remove(struct platform_device *pdev)
dwc3_put_device_id(exynos->dwc3->id);
- if (pdata && pdata->phy_exit)
- pdata->phy_exit(pdev, pdata->phy_type);
-
clk_disable(exynos->clk);
clk_put(exynos->clk);
--
1.7.6.5
^ permalink raw reply related [flat|nested] 4+ messages in thread