From da8fc1511fc83f6ba2cf0e1e1feadbe1b9b58f4d Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 7 May 2018 12:07:32 +0200 Subject: mediatek: backport upstream mediatek patches Signed-off-by: John Crispin (cherry picked from commit 050da2107a7eb2a571a8a3d0cee21cc6a44b72b8) --- ...mtu3-get-optional-vbus-for-host-only-mode.patch | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 target/linux/mediatek/patches-4.14/0110-usb-mtu3-get-optional-vbus-for-host-only-mode.patch (limited to 'target/linux/mediatek/patches-4.14/0110-usb-mtu3-get-optional-vbus-for-host-only-mode.patch') diff --git a/target/linux/mediatek/patches-4.14/0110-usb-mtu3-get-optional-vbus-for-host-only-mode.patch b/target/linux/mediatek/patches-4.14/0110-usb-mtu3-get-optional-vbus-for-host-only-mode.patch new file mode 100644 index 0000000..d55fe7d --- /dev/null +++ b/target/linux/mediatek/patches-4.14/0110-usb-mtu3-get-optional-vbus-for-host-only-mode.patch @@ -0,0 +1,45 @@ +From b6712b72d1273e792ee8a533048ba731a3709163 Mon Sep 17 00:00:00 2001 +From: Chunfeng Yun +Date: Fri, 13 Oct 2017 17:10:44 +0800 +Subject: [PATCH 110/224] usb: mtu3: get optional vbus for host only mode + +When dr_mode is set as USB_DR_MODE_HOST, it's better to try to +get optional vbus, this can increase flexibility, although we +can set vbus as always on for regulator or put it in host driver +to turn it on. + +Signed-off-by: Chunfeng Yun +Signed-off-by: Felipe Balbi +--- + drivers/usb/mtu3/mtu3_plat.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c +index 1e473b068650..7ca81f4e78a3 100644 +--- a/drivers/usb/mtu3/mtu3_plat.c ++++ b/drivers/usb/mtu3/mtu3_plat.c +@@ -300,10 +300,6 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb) + of_property_read_u32(node, "mediatek,u3p-dis-msk", + &ssusb->u3p_dis_msk); + +- if (ssusb->dr_mode != USB_DR_MODE_OTG) +- return 0; +- +- /* if dual-role mode is supported */ + vbus = devm_regulator_get(&pdev->dev, "vbus"); + if (IS_ERR(vbus)) { + dev_err(dev, "failed to get vbus\n"); +@@ -311,6 +307,10 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb) + } + otg_sx->vbus = vbus; + ++ if (ssusb->dr_mode == USB_DR_MODE_HOST) ++ return 0; ++ ++ /* if dual-role mode is supported */ + otg_sx->is_u3_drd = of_property_read_bool(node, "mediatek,usb3-drd"); + otg_sx->manual_drd_enabled = + of_property_read_bool(node, "enable-manual-drd"); +-- +2.11.0 + -- cgit v1.1