aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2015-11-19 13:15:43 -0500
committerFelipe Balbi <balbi@ti.com>2015-12-15 10:12:41 -0500
commitb084662776be8b07ab9114ff1a16a4e9bf907d35 (patch)
treea7557b02cf6c3d1c4004f8f7527bf8f04409df6d
parentf8764406a8a9a6443048f9c5c8e512504684ed1a (diff)
usb: dwc3: remove dwc3-qcom in favor of dwc3-of-simple
Now that we have a generic dwc3-of-simple.c, we can use that instead of maintaining dwc3-qcom.c which is extremely similar. Cc: Ivan T. Ivanov <iivanov@mm-sol.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/dwc3/Kconfig8
-rw-r--r--drivers/usb/dwc3/Makefile1
-rw-r--r--drivers/usb/dwc3/dwc3-qcom.c130
3 files changed, 0 insertions, 139 deletions
diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 070e704829e5..a64ce1c94d6d 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -105,12 +105,4 @@ config USB_DWC3_ST
105 inside (i.e. STiH407). 105 inside (i.e. STiH407).
106 Say 'Y' or 'M' if you have one such device. 106 Say 'Y' or 'M' if you have one such device.
107 107
108config USB_DWC3_QCOM
109 tristate "Qualcomm Platforms"
110 depends on ARCH_QCOM || COMPILE_TEST
111 default USB_DWC3
112 help
113 Recent Qualcomm SoCs ship with one DesignWare Core USB3 IP inside,
114 say 'Y' or 'M' if you have one such device.
115
116endif 108endif
diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
index 6491f9b474d4..22420e17d68b 100644
--- a/drivers/usb/dwc3/Makefile
+++ b/drivers/usb/dwc3/Makefile
@@ -38,5 +38,4 @@ obj-$(CONFIG_USB_DWC3_EXYNOS) += dwc3-exynos.o
38obj-$(CONFIG_USB_DWC3_PCI) += dwc3-pci.o 38obj-$(CONFIG_USB_DWC3_PCI) += dwc3-pci.o
39obj-$(CONFIG_USB_DWC3_KEYSTONE) += dwc3-keystone.o 39obj-$(CONFIG_USB_DWC3_KEYSTONE) += dwc3-keystone.o
40obj-$(CONFIG_USB_DWC3_OF_SIMPLE) += dwc3-of-simple.o 40obj-$(CONFIG_USB_DWC3_OF_SIMPLE) += dwc3-of-simple.o
41obj-$(CONFIG_USB_DWC3_QCOM) += dwc3-qcom.o
42obj-$(CONFIG_USB_DWC3_ST) += dwc3-st.o 41obj-$(CONFIG_USB_DWC3_ST) += dwc3-st.o
diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
deleted file mode 100644
index 088026048f49..000000000000
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ /dev/null
@@ -1,130 +0,0 @@
1/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#include <linux/clk.h>
14#include <linux/err.h>
15#include <linux/io.h>
16#include <linux/module.h>
17#include <linux/of.h>
18#include <linux/of_platform.h>
19#include <linux/platform_device.h>
20
21struct dwc3_qcom {
22 struct device *dev;
23
24 struct clk *core_clk;
25 struct clk *iface_clk;
26 struct clk *sleep_clk;
27};
28
29static int dwc3_qcom_probe(struct platform_device *pdev)
30{
31 struct device_node *node = pdev->dev.of_node;
32 struct dwc3_qcom *qdwc;
33 int ret;
34
35 qdwc = devm_kzalloc(&pdev->dev, sizeof(*qdwc), GFP_KERNEL);
36 if (!qdwc)
37 return -ENOMEM;
38
39 platform_set_drvdata(pdev, qdwc);
40
41 qdwc->dev = &pdev->dev;
42
43 qdwc->core_clk = devm_clk_get(qdwc->dev, "core");
44 if (IS_ERR(qdwc->core_clk)) {
45 dev_err(qdwc->dev, "failed to get core clock\n");
46 return PTR_ERR(qdwc->core_clk);
47 }
48
49 qdwc->iface_clk = devm_clk_get(qdwc->dev, "iface");
50 if (IS_ERR(qdwc->iface_clk)) {
51 dev_info(qdwc->dev, "failed to get optional iface clock\n");
52 qdwc->iface_clk = NULL;
53 }
54
55 qdwc->sleep_clk = devm_clk_get(qdwc->dev, "sleep");
56 if (IS_ERR(qdwc->sleep_clk)) {
57 dev_info(qdwc->dev, "failed to get optional sleep clock\n");
58 qdwc->sleep_clk = NULL;
59 }
60
61 ret = clk_prepare_enable(qdwc->core_clk);
62 if (ret) {
63 dev_err(qdwc->dev, "failed to enable core clock\n");
64 goto err_core;
65 }
66
67 ret = clk_prepare_enable(qdwc->iface_clk);
68 if (ret) {
69 dev_err(qdwc->dev, "failed to enable optional iface clock\n");
70 goto err_iface;
71 }
72
73 ret = clk_prepare_enable(qdwc->sleep_clk);
74 if (ret) {
75 dev_err(qdwc->dev, "failed to enable optional sleep clock\n");
76 goto err_sleep;
77 }
78
79 ret = of_platform_populate(node, NULL, NULL, qdwc->dev);
80 if (ret) {
81 dev_err(qdwc->dev, "failed to register core - %d\n", ret);
82 goto err_clks;
83 }
84
85 return 0;
86
87err_clks:
88 clk_disable_unprepare(qdwc->sleep_clk);
89err_sleep:
90 clk_disable_unprepare(qdwc->iface_clk);
91err_iface:
92 clk_disable_unprepare(qdwc->core_clk);
93err_core:
94 return ret;
95}
96
97static int dwc3_qcom_remove(struct platform_device *pdev)
98{
99 struct dwc3_qcom *qdwc = platform_get_drvdata(pdev);
100
101 of_platform_depopulate(&pdev->dev);
102
103 clk_disable_unprepare(qdwc->sleep_clk);
104 clk_disable_unprepare(qdwc->iface_clk);
105 clk_disable_unprepare(qdwc->core_clk);
106
107 return 0;
108}
109
110static const struct of_device_id of_dwc3_match[] = {
111 { .compatible = "qcom,dwc3" },
112 { /* Sentinel */ }
113};
114MODULE_DEVICE_TABLE(of, of_dwc3_match);
115
116static struct platform_driver dwc3_qcom_driver = {
117 .probe = dwc3_qcom_probe,
118 .remove = dwc3_qcom_remove,
119 .driver = {
120 .name = "qcom-dwc3",
121 .of_match_table = of_dwc3_match,
122 },
123};
124
125module_platform_driver(dwc3_qcom_driver);
126
127MODULE_ALIAS("platform:qcom-dwc3");
128MODULE_LICENSE("GPL v2");
129MODULE_DESCRIPTION("DesignWare USB3 QCOM Glue Layer");
130MODULE_AUTHOR("Ivan T. Ivanov <iivanov@mm-sol.com>");