summaryrefslogtreecommitdiff
path: root/drivers/usb/mtu3/mtu3_plat.c
diff options
context:
space:
mode:
authorChunfeng Yun <chunfeng.yun@mediatek.com>2019-08-29 17:22:38 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-03 20:02:15 +0200
commit1ac91ac5d097c1928efe6691d72c619462a9e3c5 (patch)
tree24b7dbf1cccdcb71b8679f21b3447fb91ebda012 /drivers/usb/mtu3/mtu3_plat.c
parent4602f3bff2669012c1147eecfe74c121765f5c56 (diff)
downloadlinux-1ac91ac5d097c1928efe6691d72c619462a9e3c5.tar.gz
linux-1ac91ac5d097c1928efe6691d72c619462a9e3c5.tar.bz2
linux-1ac91ac5d097c1928efe6691d72c619462a9e3c5.zip
usb: mtu3: register a USB Role Switch for dual role mode
Because extcon is not allowed for new bindings, and the dual role switch is supported by USB Role Switch, especially for Type-C drivers, so register a USB Role Switch to support the new way Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Link: https://lore.kernel.org/r/1567070558-29417-12-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/mtu3/mtu3_plat.c')
-rw-r--r--drivers/usb/mtu3/mtu3_plat.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c
index fd0f6c5dfbc1..9c256ea3cdf5 100644
--- a/drivers/usb/mtu3/mtu3_plat.c
+++ b/drivers/usb/mtu3/mtu3_plat.c
@@ -299,8 +299,9 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
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");
+ otg_sx->role_sw_used = of_property_read_bool(node, "usb-role-switch");
- if (of_property_read_bool(node, "extcon")) {
+ if (!otg_sx->role_sw_used && of_property_read_bool(node, "extcon")) {
otg_sx->edev = extcon_get_edev_by_phandle(ssusb->dev, 0);
if (IS_ERR(otg_sx->edev)) {
dev_err(ssusb->dev, "couldn't get extcon device\n");