aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/patches-4.14/0105-usb-mtu3-remove-dummy-wakeup-debounce-clocks.patch
diff options
context:
space:
mode:
authorJohn Crispin <john@phrozen.org>2018-05-07 12:07:32 +0200
committerJohn Crispin <john@phrozen.org>2018-06-18 21:21:53 +0200
commitda8fc1511fc83f6ba2cf0e1e1feadbe1b9b58f4d (patch)
treec8093d2f8d65636ed5a6e9b89fb68844b5ffdbc8 /target/linux/mediatek/patches-4.14/0105-usb-mtu3-remove-dummy-wakeup-debounce-clocks.patch
parent763c0473c8137b236b6d7504b1c6df3d48f90ea4 (diff)
downloadupstream-da8fc1511fc83f6ba2cf0e1e1feadbe1b9b58f4d.tar.gz
upstream-da8fc1511fc83f6ba2cf0e1e1feadbe1b9b58f4d.tar.bz2
upstream-da8fc1511fc83f6ba2cf0e1e1feadbe1b9b58f4d.zip
mediatek: backport upstream mediatek patches
Signed-off-by: John Crispin <john@phrozen.org> (cherry picked from commit 050da2107a7eb2a571a8a3d0cee21cc6a44b72b8)
Diffstat (limited to 'target/linux/mediatek/patches-4.14/0105-usb-mtu3-remove-dummy-wakeup-debounce-clocks.patch')
-rw-r--r--target/linux/mediatek/patches-4.14/0105-usb-mtu3-remove-dummy-wakeup-debounce-clocks.patch126
1 files changed, 126 insertions, 0 deletions
diff --git a/target/linux/mediatek/patches-4.14/0105-usb-mtu3-remove-dummy-wakeup-debounce-clocks.patch b/target/linux/mediatek/patches-4.14/0105-usb-mtu3-remove-dummy-wakeup-debounce-clocks.patch
new file mode 100644
index 0000000000..adf1cec90b
--- /dev/null
+++ b/target/linux/mediatek/patches-4.14/0105-usb-mtu3-remove-dummy-wakeup-debounce-clocks.patch
@@ -0,0 +1,126 @@
+From 50005796f146351dc9c34bbf8898b305c562e964 Mon Sep 17 00:00:00 2001
+From: Chunfeng Yun <chunfeng.yun@mediatek.com>
+Date: Fri, 13 Oct 2017 17:10:39 +0800
+Subject: [PATCH 105/224] usb: mtu3: remove dummy wakeup debounce clocks
+
+The wakeup debounce clocks for each ports in fact are not
+needed, so remove them.
+
+Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
+Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
+---
+ drivers/usb/mtu3/mtu3.h | 4 ----
+ drivers/usb/mtu3/mtu3_host.c | 57 ++++----------------------------------------
+ 2 files changed, 4 insertions(+), 57 deletions(-)
+
+diff --git a/drivers/usb/mtu3/mtu3.h b/drivers/usb/mtu3/mtu3.h
+index 112723d6e7bc..6d3278e46431 100644
+--- a/drivers/usb/mtu3/mtu3.h
++++ b/drivers/usb/mtu3/mtu3.h
+@@ -214,8 +214,6 @@ struct otg_switch_mtk {
+ * disable u3port0, bit1==1 to disable u3port1,... etc
+ * @dbgfs_root: only used when supports manual dual-role switch via debugfs
+ * @wakeup_en: it's true when supports remote wakeup in host mode
+- * @wk_deb_p0: port0's wakeup debounce clock
+- * @wk_deb_p1: it's optional, and depends on port1 is supported or not
+ */
+ struct ssusb_mtk {
+ struct device *dev;
+@@ -238,8 +236,6 @@ struct ssusb_mtk {
+ struct dentry *dbgfs_root;
+ /* usb wakeup for host mode */
+ bool wakeup_en;
+- struct clk *wk_deb_p0;
+- struct clk *wk_deb_p1;
+ struct regmap *pericfg;
+ };
+
+diff --git a/drivers/usb/mtu3/mtu3_host.c b/drivers/usb/mtu3/mtu3_host.c
+index 4dd9508a60b5..edcc59148171 100644
+--- a/drivers/usb/mtu3/mtu3_host.c
++++ b/drivers/usb/mtu3/mtu3_host.c
+@@ -79,20 +79,6 @@ int ssusb_wakeup_of_property_parse(struct ssusb_mtk *ssusb,
+ if (!ssusb->wakeup_en)
+ return 0;
+
+- ssusb->wk_deb_p0 = devm_clk_get(dev, "wakeup_deb_p0");
+- if (IS_ERR(ssusb->wk_deb_p0)) {
+- dev_err(dev, "fail to get wakeup_deb_p0\n");
+- return PTR_ERR(ssusb->wk_deb_p0);
+- }
+-
+- if (of_property_read_bool(dn, "wakeup_deb_p1")) {
+- ssusb->wk_deb_p1 = devm_clk_get(dev, "wakeup_deb_p1");
+- if (IS_ERR(ssusb->wk_deb_p1)) {
+- dev_err(dev, "fail to get wakeup_deb_p1\n");
+- return PTR_ERR(ssusb->wk_deb_p1);
+- }
+- }
+-
+ ssusb->pericfg = syscon_regmap_lookup_by_phandle(dn,
+ "mediatek,syscon-wakeup");
+ if (IS_ERR(ssusb->pericfg)) {
+@@ -103,36 +89,6 @@ int ssusb_wakeup_of_property_parse(struct ssusb_mtk *ssusb,
+ return 0;
+ }
+
+-static int ssusb_wakeup_clks_enable(struct ssusb_mtk *ssusb)
+-{
+- int ret;
+-
+- ret = clk_prepare_enable(ssusb->wk_deb_p0);
+- if (ret) {
+- dev_err(ssusb->dev, "failed to enable wk_deb_p0\n");
+- goto usb_p0_err;
+- }
+-
+- ret = clk_prepare_enable(ssusb->wk_deb_p1);
+- if (ret) {
+- dev_err(ssusb->dev, "failed to enable wk_deb_p1\n");
+- goto usb_p1_err;
+- }
+-
+- return 0;
+-
+-usb_p1_err:
+- clk_disable_unprepare(ssusb->wk_deb_p0);
+-usb_p0_err:
+- return -EINVAL;
+-}
+-
+-static void ssusb_wakeup_clks_disable(struct ssusb_mtk *ssusb)
+-{
+- clk_disable_unprepare(ssusb->wk_deb_p1);
+- clk_disable_unprepare(ssusb->wk_deb_p0);
+-}
+-
+ static void host_ports_num_get(struct ssusb_mtk *ssusb)
+ {
+ u32 xhci_cap;
+@@ -286,19 +242,14 @@ void ssusb_host_exit(struct ssusb_mtk *ssusb)
+
+ int ssusb_wakeup_enable(struct ssusb_mtk *ssusb)
+ {
+- int ret = 0;
+-
+- if (ssusb->wakeup_en) {
+- ret = ssusb_wakeup_clks_enable(ssusb);
++ if (ssusb->wakeup_en)
+ ssusb_wakeup_ip_sleep_en(ssusb);
+- }
+- return ret;
++
++ return 0;
+ }
+
+ void ssusb_wakeup_disable(struct ssusb_mtk *ssusb)
+ {
+- if (ssusb->wakeup_en) {
++ if (ssusb->wakeup_en)
+ ssusb_wakeup_ip_sleep_dis(ssusb);
+- ssusb_wakeup_clks_disable(ssusb);
+- }
+ }
+--
+2.11.0
+