From patchwork Tue Jun 8 07:57:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 456063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E2DEC48BD1 for ; Tue, 8 Jun 2021 07:58:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BC3B6128B for ; Tue, 8 Jun 2021 07:58:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230458AbhFHH77 (ORCPT ); Tue, 8 Jun 2021 03:59:59 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:49289 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229556AbhFHH76 (ORCPT ); Tue, 8 Jun 2021 03:59:58 -0400 X-UUID: c72503c1d3b94a7faa17b529fecce6e5-20210608 X-UUID: c72503c1d3b94a7faa17b529fecce6e5-20210608 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 927584645; Tue, 08 Jun 2021 15:58:02 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 8 Jun 2021 15:58:01 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 8 Jun 2021 15:58:00 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring , Felipe Balbi CC: Chunfeng Yun , Matthias Brugger , Thinh Nguyen , , , , , , Yuwen Ng , Eddie Hung Subject: [PATCH 05/23] usb: mtu3: power down device IP by default Date: Tue, 8 Jun 2021 15:57:31 +0800 Message-ID: <1623139069-8173-6-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1623139069-8173-1-git-send-email-chunfeng.yun@mediatek.com> References: <1623139069-8173-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Power down device IP by default until @udc_start is called. Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3_core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c index 6b5da98de648..e306b93c007d 100644 --- a/drivers/usb/mtu3/mtu3_core.c +++ b/drivers/usb/mtu3/mtu3_core.c @@ -921,16 +921,15 @@ int ssusb_gadget_init(struct ssusb_mtk *ssusb) device_init_wakeup(dev, true); + /* power down device IP for power saving by default */ + mtu3_stop(mtu); + ret = mtu3_gadget_setup(mtu); if (ret) { dev_err(dev, "mtu3 gadget init failed:%d\n", ret); goto gadget_err; } - /* init as host mode, power down device IP for power saving */ - if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG) - mtu3_stop(mtu); - ssusb_dev_debugfs_init(ssusb); dev_dbg(dev, " %s() done...\n", __func__);