diff options
author | John Crispin <john@phrozen.org> | 2018-05-07 12:07:32 +0200 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-06-18 21:21:53 +0200 |
commit | da8fc1511fc83f6ba2cf0e1e1feadbe1b9b58f4d (patch) | |
tree | c8093d2f8d65636ed5a6e9b89fb68844b5ffdbc8 /target/linux/mediatek/patches-4.14/0112-usb-mtu3-set-otg_sel-for-u2port-only-if-works-as-dua.patch | |
parent | 763c0473c8137b236b6d7504b1c6df3d48f90ea4 (diff) | |
download | upstream-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/0112-usb-mtu3-set-otg_sel-for-u2port-only-if-works-as-dua.patch')
-rw-r--r-- | target/linux/mediatek/patches-4.14/0112-usb-mtu3-set-otg_sel-for-u2port-only-if-works-as-dua.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/target/linux/mediatek/patches-4.14/0112-usb-mtu3-set-otg_sel-for-u2port-only-if-works-as-dua.patch b/target/linux/mediatek/patches-4.14/0112-usb-mtu3-set-otg_sel-for-u2port-only-if-works-as-dua.patch new file mode 100644 index 0000000000..3a74fe534f --- /dev/null +++ b/target/linux/mediatek/patches-4.14/0112-usb-mtu3-set-otg_sel-for-u2port-only-if-works-as-dua.patch @@ -0,0 +1,49 @@ +From 36f70702b66cd3453b65d46b5c26ea87d8897363 Mon Sep 17 00:00:00 2001 +From: Chunfeng Yun <chunfeng.yun@mediatek.com> +Date: Fri, 13 Oct 2017 17:10:46 +0800 +Subject: [PATCH 112/224] usb: mtu3: set otg_sel for u2port only if works as + dual-role mode + +When set otg_sel(SSUSB_U2_PORT_OTG_SEL) for u2port which supports +dual-role mode, the controller will automatically switch mode +between host and device according to IDDIG signal. But if the +u2port only supports device mode, and no IDDIG pin is provided, +setting otg_sel may cause failure of detection by host. +So set it only for dual-role mode. + +Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> +Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> +--- + drivers/usb/mtu3/mtu3_core.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c +index 67f7a309aba7..7c149a7da14e 100644 +--- a/drivers/usb/mtu3/mtu3_core.c ++++ b/drivers/usb/mtu3/mtu3_core.c +@@ -115,7 +115,9 @@ static int mtu3_device_enable(struct mtu3 *mtu) + mtu3_clrbits(ibase, SSUSB_U2_CTRL(0), + (SSUSB_U2_PORT_DIS | SSUSB_U2_PORT_PDN | + SSUSB_U2_PORT_HOST_SEL)); +- mtu3_setbits(ibase, SSUSB_U2_CTRL(0), SSUSB_U2_PORT_OTG_SEL); ++ ++ if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG) ++ mtu3_setbits(ibase, SSUSB_U2_CTRL(0), SSUSB_U2_PORT_OTG_SEL); + + return ssusb_check_clocks(mtu->ssusb, check_clk); + } +@@ -130,7 +132,10 @@ static void mtu3_device_disable(struct mtu3 *mtu) + + mtu3_setbits(ibase, SSUSB_U2_CTRL(0), + SSUSB_U2_PORT_DIS | SSUSB_U2_PORT_PDN); +- mtu3_clrbits(ibase, SSUSB_U2_CTRL(0), SSUSB_U2_PORT_OTG_SEL); ++ ++ if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG) ++ mtu3_clrbits(ibase, SSUSB_U2_CTRL(0), SSUSB_U2_PORT_OTG_SEL); ++ + mtu3_setbits(ibase, U3D_SSUSB_IP_PW_CTRL2, SSUSB_IP_DEV_PDN); + } + +-- +2.11.0 + |