From e3f86bb93a4756d797593b3f044e405c8ae98a8b Mon Sep 17 00:00:00 2001 From: Sankeerth Billakanti Date: Wed, 23 Sep 2020 12:53:33 +0530 Subject: [PATCH] disp: msm: dp: inform multi-func support to usb driver The usb controller driver does not know if DP is supported / connected and whether it is operating in concurrent mode. So, whenever there is a ucsi role switch call to the usb controller driver, it will reset the usb phy irrespective of DP connection. The phy reset while DP driver is still processing cable connect or disconnect will cause aux timeout or NOC errors. This change will inform the usb controller driver about the multi_func mode support to convey how many lanes DP will be using. Change-Id: I9e96ed399e879820ddd238cf0fbed7069f1de60d Signed-off-by: Sankeerth Billakanti --- msm/dp/dp_altmode.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/msm/dp/dp_altmode.c b/msm/dp/dp_altmode.c index 52d954f4a37a..0f09ddda36bf 100644 --- a/msm/dp/dp_altmode.c +++ b/msm/dp/dp_altmode.c @@ -40,7 +40,8 @@ enum dp_altmode_pin_assignment { DPAM_HPD_F, }; -static int dp_altmode_release_ss_lanes(struct dp_altmode_private *altmode) +static int dp_altmode_release_ss_lanes(struct dp_altmode_private *altmode, + bool multi_func) { int rc; struct device_node *np; @@ -69,7 +70,7 @@ static int dp_altmode_release_ss_lanes(struct dp_altmode_private *altmode) } while (timeout) { - rc = dwc3_msm_release_ss_lane(&usb_pdev->dev); + rc = dwc3_msm_release_ss_lane(&usb_pdev->dev, multi_func); if (rc != -EBUSY) break; @@ -178,11 +179,10 @@ static int dp_altmode_notify(void *priv, void *data, size_t len) altmode->dp_altmode.base.orientation = orientation; - if (!altmode->dp_altmode.base.multi_func) { - rc = dp_altmode_release_ss_lanes(altmode); - if (rc) - goto ack; - } + rc = dp_altmode_release_ss_lanes(altmode, + altmode->dp_altmode.base.multi_func); + if (rc) + goto ack; if (altmode->dp_cb && altmode->dp_cb->configure) altmode->dp_cb->configure(altmode->dev);