From patchwork Wed Aug 29 17:02:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grigor Tovmasyan X-Patchwork-Id: 10580671 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E541B5A4 for ; Wed, 29 Aug 2018 17:02:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF11B2B6FD for ; Wed, 29 Aug 2018 17:02:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C23192B71A; Wed, 29 Aug 2018 17:02:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C7FE2B6FD for ; Wed, 29 Aug 2018 17:02:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727988AbeH2VA1 (ORCPT ); Wed, 29 Aug 2018 17:00:27 -0400 Received: from smtprelay4.synopsys.com ([198.182.47.9]:38678 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727836AbeH2VA1 (ORCPT ); Wed, 29 Aug 2018 17:00:27 -0400 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 3C8E124E0543; Wed, 29 Aug 2018 10:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1535562157; bh=YFq//iR75W4TtkcZzONR+g5x3LlaVHo8TxNQQLDoBPs=; h=Date:In-Reply-To:References:From:Subject:To:CC:From; b=hZDhFv3/ASgVXHMCrKQedKj2dH9mYoOsXQMMROTYDiQr7RDo6iqXccBWeCYv9fCKp rehdevhupORcQNUhFtTJkg9nCXkOxkyLedV9MapBh0x2/gc0SfMp8WKBCWlLoz9FD7 1lCrC6nVYPf3CP+4ceIIbgbNUh903fjm3a1ZvssFRPVE+hcS3fatCLIfIjS/5UWhMp ObwQuVNHapZmO+HsHVe2lDnRjfmpwNsPIvDILrG/9eATjZjqJ2WvX0MDp9/0KzMTMu GmiGZx9YYom18iG+L0HH8cqjSNj8mgdMUOX+qy+AzgQmezPS8LCOYAiboc2kHEm785 hQIFFX5YKe+aQ== Received: from us01wehtc1.internal.synopsys.com (us01wehtc1-vip.internal.synopsys.com [10.12.239.236]) by mailhost.synopsys.com (Postfix) with ESMTP id 2DC945B25; Wed, 29 Aug 2018 10:02:37 -0700 (PDT) Received: from US01WEHTC2.internal.synopsys.com (10.12.239.238) by us01wehtc1.internal.synopsys.com (10.12.239.235) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 29 Aug 2018 10:02:36 -0700 Received: from tovmasya (10.13.184.20) by US01WEHTC2.internal.synopsys.com (10.12.239.238) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 29 Aug 2018 10:02:32 -0700 Received: by tovmasya (sSMTP sendmail emulation); Wed, 29 Aug 2018 21:02:28 +0400 Date: Wed, 29 Aug 2018 21:02:28 +0400 Message-ID: <32a922df379136102ace0e6e0e7d964fa1f59e3a.1535561828.git.tovmasya@synopsys.com> In-Reply-To: References: From: Grigor Tovmasyan Subject: [PATCH 8/9] usb: dwc2: gadget: enable WKUP_ALERT interrupt To: Felipe Balbi , Greg Kroah-Hartman , Minas Harutyunyan , CC: John Youn , Grigor Tovmasyan MIME-Version: 1.0 X-Originating-IP: [10.13.184.20] Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP WKUP_ALERT interrupt should be unmask when lpm mode is enabled. This interrupt is asserted when the device is in L1 for the duration mentioned in GREFCLK.SOF_CNN_WKUP_ALERT. This is used to alert SW to initiate Remote wake up so that the device resumes in time in order not to lose sync with the host frame number. Signed-off-by: Grigor Tovmasyan --- drivers/usb/dwc2/gadget.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 66401ffeb5a2..4f99f2e44a5b 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -4987,6 +4987,10 @@ void dwc2_gadget_init_lpm(struct dwc2_hsotg *hsotg) val |= hsotg->params.besl ? GLPMCFG_ENBESL : 0; dwc2_writel(hsotg, val, GLPMCFG); dev_dbg(hsotg->dev, "GLPMCFG=0x%08x\n", dwc2_readl(hsotg, GLPMCFG)); + + /* Unmask WKUP_ALERT Interrupt */ + if (hsotg->params.service_interval) + dwc2_set_bit(hsotg, GINTMSK2, GINTMSK2_WKUP_ALERT_INT_MSK); } /**