From patchwork Wed Nov 28 09:29:53 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: 10702125 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 619FF13AD for ; Wed, 28 Nov 2018 09:30:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 522B82CE79 for ; Wed, 28 Nov 2018 09:30:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 506FF2CE80; Wed, 28 Nov 2018 09:30:12 +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 F22FA2CE79 for ; Wed, 28 Nov 2018 09:30:11 +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:References: In-Reply-To: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:List-Owner; bh=bPv+LkzE0nSdz1V4uuA3yOtKc14msXkHmpwrGQe4EY4=; b=tKE17KL3Xn/AhABmGMNjtuhdT4 y7jK/ZkBEURB2I6L8YRFjVAXTNwEBqhy/hs49A5+ScCudaRQWB02E89ANBOdUUwAjhaIkV7A5y6Zk cvG95pYa40vnltGzrW49HMXxq20SNdMz5NhLBT60ReGI6vC6PqkOjemHnTzYTS/RaQh7LYM1uPJqN L+N7u32dalZls+j3Jo9XhJVXaisyjZrYVo1auRi9/C2/gY7pgIPBflEZrJ6sUdVMP4pFUHdTMpOaa mNmE+D8jIqwbJFsY2ZdcDEL5TKJ/xuPFTGxHytFHe3uyJhiN8/81cYYn00A2ee9QZ34QzqGeL1AeA 66S1gbzw==; 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 1gRwAd-00082T-FY; Wed, 28 Nov 2018 09:30:11 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRwAb-0006lp-4t for linux-mediatek@lists.infradead.org; Wed, 28 Nov 2018 09:30:10 +0000 Received: by mail-pg1-x544.google.com with SMTP id w6so9247155pgl.6 for ; Wed, 28 Nov 2018 01:29:58 -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:in-reply-to:references; bh=bZfZFWO8LVzOeMYPieoDTbNggt+PEiM2bxAXF77bHsI=; b=WMDgsZWolkQsoERl+MdBz0avaFGJ5YhHTtfSzrjl9JJkHYMEzR4TRtej616H/kvPoL W9j4i0NtBjQgAKvPVh1/XBEV82kr1ZhlFuA3ZWNPtSNYdNSXG7hNz7kj0pYFbwWDLTAz XfBxYFNvhGCzzCvS+Og9FulVJMqigqgjPIBVI= 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:in-reply-to :references; bh=bZfZFWO8LVzOeMYPieoDTbNggt+PEiM2bxAXF77bHsI=; b=AFIgTlcfIMDkpsVQVIGQfabiDANGkxrOUA9TezJSiPrJs1IDfUGqBofG3neNt8eqXY M+sohM3PC26DMBjrYe4R1q1a8TjkaZQy6P1GOJAwKbxurHQksuO5Zeoal4jWGJ0Y33xl ZoPfnZY9Ac2UrNBIML7g3J29B1j+m3e4MtEcEec+O3rZhDRNymfShflEQeyhDgqsH7iL nnE8SQrDavhZRz+22F09vaNakQRjg9k3dBbtaO+DIuTj7swn/9A9clreDo3FbxLDwipr e0ymTsezBPUSxNshA1yfbL/9Z1M/j3+COqFgoF5BY4HTJm63nYis+O+R9NQPqc/hWt7y ZC8Q== X-Gm-Message-State: AA+aEWYi5hu6igifqYHzLv3xFwRPgMXcaRbYz2Th6doNvu2pz44aFaGA To4tzvbPYRyNM+5Xl41tL3coRw== X-Google-Smtp-Source: AFSGD/XV4jsXigI2p3fC9If+Tm7pBoVjiB0eBEexvS8sarPOwafw9wxmFI8L8aFLOtyKhImoKDzgtg== X-Received: by 2002:a63:f1f:: with SMTP id e31mr145184pgl.274.1543397398353; Wed, 28 Nov 2018 01:29:58 -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 e128sm7870444pfe.67.2018.11.28.01.29.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Nov 2018 01:29:57 -0800 (PST) From: "Hsin-Yi, Wang" To: linux-arm-kernel@lists.infradead.org Subject: [V2] usb/mtu3: power down device ip at setup Date: Wed, 28 Nov 2018 17:29:53 +0800 Message-Id: <20181128092953.41541-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20181128060412.630-1-hsinyi@chromium.org> References: <20181128060412.630-1-hsinyi@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_013009_195257_619B787A X-CRM114-Status: GOOD ( 10.02 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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_plat.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c index 46551f6d16fd..cdef66141e20 100644 --- a/drivers/usb/mtu3/mtu3_plat.c +++ b/drivers/usb/mtu3/mtu3_plat.c @@ -200,6 +200,12 @@ static void ssusb_ip_sw_reset(struct ssusb_mtk *ssusb) mtu3_setbits(ssusb->ippc_base, U3D_SSUSB_IP_PW_CTRL0, SSUSB_IP_SW_RST); udelay(1); mtu3_clrbits(ssusb->ippc_base, U3D_SSUSB_IP_PW_CTRL0, SSUSB_IP_SW_RST); + + /* + * device ip is default power-on in fact + * power down device ip, otherwise ip-sleep will fail + */ + mtu3_setbits(ssusb->ippc_base, U3D_SSUSB_IP_PW_CTRL2, SSUSB_IP_DEV_PDN); } /* ignore the error if the clock does not exist */