mediatek: more v5.4 fixes
[openwrt/staging/jow.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 --- a/drivers/usb/host/xhci-mtk.c
19 +++ b/drivers/usb/host/xhci-mtk.c
20 @@ -237,25 +237,8 @@ static int xhci_mtk_clks_enable(struct x
21 goto sys_clk_err;
22 }
23
24 - if (mtk->wakeup_src) {
25 - ret = clk_prepare_enable(mtk->wk_deb_p0);
26 - if (ret) {
27 - dev_err(mtk->dev, "failed to enable wk_deb_p0\n");
28 - goto usb_p0_err;
29 - }
30 -
31 - ret = clk_prepare_enable(mtk->wk_deb_p1);
32 - if (ret) {
33 - dev_err(mtk->dev, "failed to enable wk_deb_p1\n");
34 - goto usb_p1_err;
35 - }
36 - }
37 return 0;
38
39 -usb_p1_err:
40 - clk_disable_unprepare(mtk->wk_deb_p0);
41 -usb_p0_err:
42 - clk_disable_unprepare(mtk->sys_clk);
43 sys_clk_err:
44 clk_disable_unprepare(mtk->ref_clk);
45 ref_clk_err:
46 @@ -264,10 +247,6 @@ ref_clk_err:
47
48 static void xhci_mtk_clks_disable(struct xhci_hcd_mtk *mtk)
49 {
50 - if (mtk->wakeup_src) {
51 - clk_disable_unprepare(mtk->wk_deb_p1);
52 - clk_disable_unprepare(mtk->wk_deb_p0);
53 - }
54 clk_disable_unprepare(mtk->sys_clk);
55 clk_disable_unprepare(mtk->ref_clk);
56 }
57 @@ -371,18 +350,6 @@ static int usb_wakeup_of_property_parse(
58 if (!mtk->wakeup_src)
59 return 0;
60
61 - mtk->wk_deb_p0 = devm_clk_get(dev, "wakeup_deb_p0");
62 - if (IS_ERR(mtk->wk_deb_p0)) {
63 - dev_err(dev, "fail to get wakeup_deb_p0\n");
64 - return PTR_ERR(mtk->wk_deb_p0);
65 - }
66 -
67 - mtk->wk_deb_p1 = devm_clk_get(dev, "wakeup_deb_p1");
68 - if (IS_ERR(mtk->wk_deb_p1)) {
69 - dev_err(dev, "fail to get wakeup_deb_p1\n");
70 - return PTR_ERR(mtk->wk_deb_p1);
71 - }
72 -
73 mtk->pericfg = syscon_regmap_lookup_by_phandle(dn,
74 "mediatek,syscon-wakeup");
75 if (IS_ERR(mtk->pericfg)) {
76 --- a/drivers/usb/host/xhci-mtk.h
77 +++ b/drivers/usb/host/xhci-mtk.h
78 @@ -126,8 +126,6 @@ struct xhci_hcd_mtk {
79 struct regulator *vbus;
80 struct clk *sys_clk; /* sys and mac clock */
81 struct clk *ref_clk;
82 - struct clk *wk_deb_p0; /* port0's wakeup debounce clock */
83 - struct clk *wk_deb_p1;
84 struct regmap *pericfg;
85 struct phy **phys;
86 int num_phys;