From patchwork Wed Nov 28 06:04:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 10701995 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 0885813BF for ; Wed, 28 Nov 2018 06:04:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC1B32CC93 for ; Wed, 28 Nov 2018 06:04:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E06722CCA8; Wed, 28 Nov 2018 06:04:40 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8BD322CC93 for ; Wed, 28 Nov 2018 06:04:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=/kkzrsjCXF/eREx+eMc12KgeOGkQPaWkIlS3Mawhm6s=; b=ZIc vj2E7YI6nY8H9hbQ6Tqgj/ck5A8PEV65gjZieXJzhI03qM5UHKPWymaP9F/zf5NTk9QUubEYtZZCA TPCYHTkhhfSW0toXZfu2ELdONSOnWZGy9nKXn1xJBZxCixm6tYnkwFbgNgx3R9t/LGYY8eczcK6P/ bzkloXaaiaBZTVP/sWJ1zldj1XdpWCB1yoGfJcH2MHpIQ6hoiQ3P9LNVhCQIHeP9y8JOd0+s8I5G+ Awvr22DNE0nxxTrSNrAOs/MfFM735lnIYZwGEPy1AevwhW9Xo18igkFrWiHMRnKJgR2ZwkXqXFYP+ mJblgrivZD9QStoc9aD+q41niK4m4hg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRsxc-0001qE-As; Wed, 28 Nov 2018 06:04:32 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRsxY-0001pG-GQ for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 06:04:29 +0000 Received: by mail-pf1-x444.google.com with SMTP id y126so1758411pfb.4 for ; Tue, 27 Nov 2018 22:04:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=CP0ZZK7SqB43zKSvumuMlYKiaZyMxI0xBVfIYtC5CkA=; b=D1IamjTXkEXtalGe/CAe5Tfj4HAw4u1TftWQ5QZru+RLNmGqft2uZo1f0MgRbgfBUU EHsdzo7ncC0DiUQouXjCN47aXgiNGi//IvzoH/NnXY+Rvl40q3aPLVXBr352jojKWZ5j JhydCMxHTvi/hFhwVV8gNTw4O0qLxq1ve6G7U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CP0ZZK7SqB43zKSvumuMlYKiaZyMxI0xBVfIYtC5CkA=; b=nTLbpMwg8D1HbTnAa4ef33Rw2+7LJocAotriKWtvgYd+1rrUbGwpE+E94gmyL/GLn4 6kooS+p68pKRmfznROEufFN3lpprZ1Ksm8OY5zE0MoUQG2lJ0VIrCwTZYHxJV0ddKhyS mJuzF9IinN+kvoNa3KBCLjDp6cHck5+8Qjg4KXobnzxN/dB0BQcF9vG+DdtzsX9CwHBZ /4mu1hnIXpK+4YkTwv7Xvd2p3AeEPys4FQCaRZCmErU3SJ/Qh+KHRz77SlOnA61vXcNi ECD+j89V4Rx95n5T+v8pC0uxlmEU5M2jMuoh6RdCPgfI85UN7SdNGQak86emb+amZGzE 63SA== X-Gm-Message-State: AA+aEWYSpQg3CnmLiSJI0RP8UCfMlbSlCS/a0sTEJXqI4L9L50PCKlQE 392Hk1jUpFN1fT0XWJXEYPwImQyZlWbCbg== X-Google-Smtp-Source: AFSGD/Upc7VGPqDgAmd1BSZnB+zR3FOjHi3jqz/rHjnH4jQsb3qI8+/8eR6N0Aa3KQdfamknOC7YQw== X-Received: by 2002:a63:1d1d:: with SMTP id d29mr30798324pgd.49.1543385057493; Tue, 27 Nov 2018 22:04:17 -0800 (PST) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:b852:bd51:9305:4261]) by smtp.gmail.com with ESMTPSA id l85sm6598368pfg.161.2018.11.27.22.04.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Nov 2018 22:04:17 -0800 (PST) From: "Hsin-Yi, Wang" To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] usb/mtu3: power down device ip at setup Date: Wed, 28 Nov 2018 14:04:12 +0800 Message-Id: <20181128060412.630-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.18.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181127_220428_541663_784FC4E4 X-CRM114-Status: GOOD ( 11.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chunfeng Yun , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Originally, when dr_mode is USB_DR_MODE_HOST, it didn't power down device ip, so host ip sleep will fail at ssusb_host_disable. Power down device ip at ssusb_host_setup. Signed-off-by: Hsin-Yi, Wang --- drivers/usb/mtu3/mtu3_host.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/usb/mtu3/mtu3_host.c b/drivers/usb/mtu3/mtu3_host.c index c871b94f3e6f..d17cf43305db 100644 --- a/drivers/usb/mtu3/mtu3_host.c +++ b/drivers/usb/mtu3/mtu3_host.c @@ -192,9 +192,17 @@ int ssusb_host_disable(struct ssusb_mtk *ssusb, bool suspend) static void ssusb_host_setup(struct ssusb_mtk *ssusb) { struct otg_switch_mtk *otg_sx = &ssusb->otg_switch; + void __iomem *ibase = ssusb->ippc_base; host_ports_num_get(ssusb); + /* + * device ip is default power-on in fact + * power down device ip, otherwise ip-sleep will fail + */ + if (ssusb->dr_mode == USB_DR_MODE_HOST) + mtu3_setbits(ibase, U3D_SSUSB_IP_PW_CTRL2, SSUSB_IP_DEV_PDN); + /* * power on host and power on/enable all ports * if support OTG, gadget driver will switch port0 to device mode