From 26f78f4bc6f7af7b07072f0f694c6914c9cd8e80 Mon Sep 17 00:00:00 2001 From: Devdutt Patnaik Date: Fri, 12 Feb 2016 18:51:44 -0800 Subject: [PATCH] usb: f_gsi: Send Function Suspend state to GSI EP OP for suspend We need to skip checking for link state being in U3 when we receive a Function Suspend. Pass in this information to GSI EP OP that checks if we are good to suspend channels with IPA. We skip the check for U3 if we are handling Function Suspend and check for U3 when we are handling Bus Suspend. CRs-Fixed: 966352 Change-Id: I29ee0326edbe33b02884495ddc89484bef21e7e0 Signed-off-by: Devdutt Patnaik --- drivers/usb/gadget/function/f_gsi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_gsi.c b/drivers/usb/gadget/function/f_gsi.c index f6aaf658bffc..ea86bd9aad60 100644 --- a/drivers/usb/gadget/function/f_gsi.c +++ b/drivers/usb/gadget/function/f_gsi.c @@ -467,10 +467,11 @@ static void ipa_disconnect_work_handler(struct gsi_data_port *d_port) static int ipa_suspend_work_handler(struct gsi_data_port *d_port) { int ret = 0; - bool block_db; + bool block_db, f_suspend; struct f_gsi *gsi = d_port_to_gsi(d_port); - if (!usb_gsi_ep_op(gsi->d_port.in_ep, NULL, + f_suspend = gsi->function.func_wakeup_allowed; + if (!usb_gsi_ep_op(gsi->d_port.in_ep, (void *) &f_suspend, GSI_EP_OP_CHECK_FOR_SUSPEND)) { ret = -EFAULT; goto done;