summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorMohammed Javid <mjavid@codeaurora.org>2017-11-22 19:40:38 +0530
committerMohammed Javid <mjavid@codeaurora.org>2017-12-01 10:55:48 +0530
commite0f095e4203ab0d86261004a0fbbdf7dc87bea32 (patch)
treeee96be183b5f3f963d720ad22eb0ffcb3bbeab49 /drivers/platform
parent5ae2acd95cfb47d0b301cb0fc86b1ac7c7d895d2 (diff)
msm: ipa3: Remove ep_delay on disconnect sequence
When device in Low Power Mode, usb driver invokes suspend and then disconnect upon cable disconnection. Remove the ep_delay if it is set. Change-Id: I203d57d70e8c189a2f3bc7f7830392fac98cfbb1 Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/msm/ipa/ipa_clients/ipa_usb.c1
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/ipa_client.c42
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/ipa_i.h2
3 files changed, 45 insertions, 0 deletions
diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c b/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c
index 8142a5923855..a7c6a321340b 100644
--- a/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c
+++ b/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c
@@ -2220,6 +2220,7 @@ static int ipa_usb_xdci_dismiss_channels(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
}
if (!IPA3_USB_IS_TTYPE_DPL(ttype)) {
+ ipa3_xdci_ep_delay_rm(ul_clnt_hdl); /* Remove ep_delay if set */
/* Reset UL channel */
result = ipa3_reset_gsi_channel(ul_clnt_hdl);
if (result) {
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_client.c b/drivers/platform/msm/ipa/ipa_v3/ipa_client.c
index 97b9f04f51de..1ec73c4a35de 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_client.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_client.c
@@ -1770,6 +1770,48 @@ exit:
return result;
}
+void ipa3_xdci_ep_delay_rm(u32 clnt_hdl)
+{
+ struct ipa3_ep_context *ep;
+ struct ipa_ep_cfg_ctrl ep_cfg_ctrl;
+ int result;
+
+ if (clnt_hdl >= ipa3_ctx->ipa_num_pipes ||
+ ipa3_ctx->ep[clnt_hdl].valid == 0) {
+ IPAERR("bad parm.\n");
+ return;
+ }
+
+ ep = &ipa3_ctx->ep[clnt_hdl];
+
+ if (ep->ep_delay_set == true) {
+
+ memset(&ep_cfg_ctrl, 0, sizeof(struct ipa_ep_cfg_ctrl));
+ ep_cfg_ctrl.ipa_ep_delay = false;
+
+ if (!ep->keep_ipa_awake)
+ IPA_ACTIVE_CLIENTS_INC_EP
+ (ipa3_get_client_mapping(clnt_hdl));
+
+ result = ipa3_cfg_ep_ctrl(clnt_hdl,
+ &ep_cfg_ctrl);
+
+ if (!ep->keep_ipa_awake)
+ IPA_ACTIVE_CLIENTS_DEC_EP
+ (ipa3_get_client_mapping(clnt_hdl));
+
+ if (result) {
+ IPAERR
+ ("client (ep: %d) failed to remove delay result=%d\n",
+ clnt_hdl, result);
+ } else {
+ IPADBG("client (ep: %d) delay removed\n",
+ clnt_hdl);
+ ep->ep_delay_set = false;
+ }
+ }
+}
+
int ipa3_xdci_disconnect(u32 clnt_hdl, bool should_force_clear, u32 qmi_req_id)
{
struct ipa3_ep_context *ep;
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h
index a4c5e425dc83..7bf56688a9e7 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h
@@ -1536,6 +1536,8 @@ int ipa3_xdci_connect(u32 clnt_hdl);
int ipa3_xdci_disconnect(u32 clnt_hdl, bool should_force_clear, u32 qmi_req_id);
+void ipa3_xdci_ep_delay_rm(u32 clnt_hdl);
+
int ipa3_xdci_suspend(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
bool should_force_clear, u32 qmi_req_id, bool is_dpl);