From patchwork Thu Nov 29 03:16:27 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: 10703859 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 60D5A13BB for ; Thu, 29 Nov 2018 03:16:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FD332E7C8 for ; Thu, 29 Nov 2018 03:16:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FC652E80A; Thu, 29 Nov 2018 03:16:59 +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 CAFCB2E7C8 for ; Thu, 29 Nov 2018 03:16:58 +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=z4889MrEe11+g/AlAetPe32Vt4VWf4iPIO9kvLdYgkI=; b=BKJe98W8Dk77GVXjatTlufQJb+ IYOQTJ91nmzkRD0EeShZ/dK6A3X1VgySCPLr5vh4JimrolL0tG4hJqGBSZsJhzliG2M4b6+3YFMLr ETY3TLnOWO9BRcRUIISlcXFpAQFuHa8fR6kfzuq2zbqm9LgSpe40w1ORIaKGgX6hDAMuxpM7PZG3e p4FrlPt3FUZ8vUHdQUgDmnc79lXBJgOzz/J8KSqN0wuZ5uS4mmGfFbqxys8NknZtsp0D90LqFfNtd KhGArZ/VQwM+hZhPXxkEFZQyNca+8Yh0y0rkxfGo/sbZymfSxQI7stfD5NiO8cQ0HfuBn5/sF/0vz HVe7WI6g==; 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 1gSCoq-0007dC-Vx; Thu, 29 Nov 2018 03:16:49 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gSCon-0007bj-2Q for linux-arm-kernel@lists.infradead.org; Thu, 29 Nov 2018 03:16:46 +0000 Received: by mail-pl1-x644.google.com with SMTP id p8so289642plo.2 for ; Wed, 28 Nov 2018 19:16:33 -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=FfEaTpIexbfNgh3WA2OcVxQfootPIVWg5nn9CpgLyKI=; b=cF8sPaPd3LzOZgGC0TgpjarH3LcnuzT+OH+UW20hnr3dVGkCPvaGO7/TCjUNNB7a0F N0s0Oi+VlRBCApTveTJH30/2eAabgKxm0SqgkljgpnEyDUG256ZTCii9XJSHlYEnQ4yW es9QzxAgQtq1cF5DrMsMRzok4CXaSXEEKZ3JQ= 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=FfEaTpIexbfNgh3WA2OcVxQfootPIVWg5nn9CpgLyKI=; b=UxREi9DEEqem6r6+i2WZFvd4F0/8ErpffE5XQ8UdfArz2xgTVRsV/6d3Jy9dKhvWTC GUPUxPaXp/7bk7ex33VOqymOC8lkmG0ldgan23Y8uX85xjLG8N+WUq3kzqbJWhBagMEh A1HDPUE028rSLHj6iL2/Mwycsd9Otmk1eBMsYCUBw9nbXrBgYBUAz1f/ywPCuIlfENtM QHLIO/pCjUZuwo0o1hP8sN5OBQ+bf1lUQ65etkKd9abeWbI6U6ZH6+C1l23l0oKdADSE vSq6IyofrwPVjSQgTzsO+v4uY2HjZHaYExUZh/mwwOw9f+fV99KdYYn8irimOUNMe1zp RfBg== X-Gm-Message-State: AA+aEWY0PCD1amdNUrO+z9A9JAb4FyW0R9aMkk3XnS2HMJn3rtSn7aSL 4kFZg4JFe0uOTf+1l43+EyWZwNHEizLDsA== X-Google-Smtp-Source: AFSGD/WWVh5yoCU3KyQUXD36gGUJZ09GN2NPvsKU0c6SJWSKUJRoV2L3noF9Rfh3VwruvTnRWy0QEQ== X-Received: by 2002:a17:902:584:: with SMTP id f4mr27947535plf.28.1543461393071; Wed, 28 Nov 2018 19:16:33 -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 z62sm555644pfi.4.2018.11.28.19.16.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Nov 2018 19:16:32 -0800 (PST) From: "Hsin-Yi, Wang" To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v4] usb/mtu3: power down device ip at setup Date: Thu, 29 Nov 2018 11:16:27 +0800 Message-Id: <20181129031627.45006-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20181128095358.42498-1-hsinyi@chromium.org> References: <20181128095358.42498-1-hsinyi@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_191645_104920_DF861055 X-CRM114-Status: GOOD ( 12.86 ) 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 Acked-by: Chunfeng Yun --- ChangeLog: V3->V4: *update comment --- drivers/usb/mtu3/mtu3_plat.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c index 46551f6d16fd..e086630e41a9 100644 --- a/drivers/usb/mtu3/mtu3_plat.c +++ b/drivers/usb/mtu3/mtu3_plat.c @@ -200,6 +200,14 @@ 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 may be powered on in firmware/BROM stage before entering + * kernel stage; + * power down device ip, otherwise ip-sleep will fail when working as + * host only mode + */ + mtu3_setbits(ssusb->ippc_base, U3D_SSUSB_IP_PW_CTRL2, SSUSB_IP_DEV_PDN); } /* ignore the error if the clock does not exist */