mediatek: backport upstream mediatek patches
[openwrt/openwrt.git] / target / linux / mediatek / patches-4.14 / 0130-usb-xhci-mtk-remove-dummy-wakeup-debounce-clocks.patch
1 From 25adaf94e0fcbf6c1b47cb610edb7f5c23c53139 Mon Sep 17 00:00:00 2001
2 From: Chunfeng Yun <chunfeng.yun@mediatek.com>
3 Date: Fri, 13 Oct 2017 16:26:37 +0800
4 Subject: [PATCH 130/224] usb: xhci-mtk: remove dummy wakeup debounce clocks
5
6 The wakeup debounce clocks for each ports in fact are not
7 needed, so remove them.
8
9 Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
10 Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
11 Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
12 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 ---
14 drivers/usb/host/xhci-mtk.c | 33 ---------------------------------
15 drivers/usb/host/xhci-mtk.h | 2 --
16 2 files changed, 35 deletions(-)
17
18 diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
19 index 97ba51e4e149..d60463c07c54 100644
20 --- a/drivers/usb/host/xhci-mtk.c
21 +++ b/drivers/usb/host/xhci-mtk.c
22 @@ -237,25 +237,8 @@ static int xhci_mtk_clks_enable(struct xhci_hcd_mtk *mtk)
23 goto sys_clk_err;
24 }
25
26 - if (mtk->wakeup_src) {
27 - ret = clk_prepare_enable(mtk->wk_deb_p0);
28 - if (ret) {
29 - dev_err(mtk->dev, "failed to enable wk_deb_p0\n");
30 - goto usb_p0_err;
31 - }
32 -
33 - ret = clk_prepare_enable(mtk->wk_deb_p1);
34 - if (ret) {
35 - dev_err(mtk->dev, "failed to enable wk_deb_p1\n");
36 - goto usb_p1_err;
37 - }
38 - }
39 return 0;
40
41 -usb_p1_err:
42 - clk_disable_unprepare(mtk->wk_deb_p0);
43 -usb_p0_err:
44 - clk_disable_unprepare(mtk->sys_clk);
45 sys_clk_err:
46 clk_disable_unprepare(mtk->ref_clk);
47 ref_clk_err:
48 @@ -264,10 +247,6 @@ static int xhci_mtk_clks_enable(struct xhci_hcd_mtk *mtk)
49
50 static void xhci_mtk_clks_disable(struct xhci_hcd_mtk *mtk)
51 {
52 - if (mtk->wakeup_src) {
53 - clk_disable_unprepare(mtk->wk_deb_p1);
54 - clk_disable_unprepare(mtk->wk_deb_p0);
55 - }
56 clk_disable_unprepare(mtk->sys_clk);
57 clk_disable_unprepare(mtk->ref_clk);
58 }
59 @@ -371,18 +350,6 @@ static int usb_wakeup_of_property_parse(struct xhci_hcd_mtk *mtk,
60 if (!mtk->wakeup_src)
61 return 0;
62
63 - mtk->wk_deb_p0 = devm_clk_get(dev, "wakeup_deb_p0");
64 - if (IS_ERR(mtk->wk_deb_p0)) {
65 - dev_err(dev, "fail to get wakeup_deb_p0\n");
66 - return PTR_ERR(mtk->wk_deb_p0);
67 - }
68 -
69 - mtk->wk_deb_p1 = devm_clk_get(dev, "wakeup_deb_p1");
70 - if (IS_ERR(mtk->wk_deb_p1)) {
71 - dev_err(dev, "fail to get wakeup_deb_p1\n");
72 - return PTR_ERR(mtk->wk_deb_p1);
73 - }
74 -
75 mtk->pericfg = syscon_regmap_lookup_by_phandle(dn,
76 "mediatek,syscon-wakeup");
77 if (IS_ERR(mtk->pericfg)) {
78 diff --git a/drivers/usb/host/xhci-mtk.h b/drivers/usb/host/xhci-mtk.h
79 index db55a12f1585..67783a7af509 100644
80 --- a/drivers/usb/host/xhci-mtk.h
81 +++ b/drivers/usb/host/xhci-mtk.h
82 @@ -126,8 +126,6 @@ struct xhci_hcd_mtk {
83 struct regulator *vbus;
84 struct clk *sys_clk; /* sys and mac clock */
85 struct clk *ref_clk;
86 - struct clk *wk_deb_p0; /* port0's wakeup debounce clock */
87 - struct clk *wk_deb_p1;
88 struct regmap *pericfg;
89 struct phy **phys;
90 int num_phys;
91 --
92 2.11.0
93