From patchwork Wed Nov 28 09:53:58 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: 10702207 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 B6E8B13AD for ; Wed, 28 Nov 2018 09:54:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C1242C3BC for ; Wed, 28 Nov 2018 09:54:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 904C02C5B0; Wed, 28 Nov 2018 09:54:17 +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 5A4372C3BC for ; Wed, 28 Nov 2018 09:54:16 +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=NBi+T+7A6J3lqDJYDKdjRxpdCKfQiWoKTAZQ9b9tCa0=; b=N76MtiB4EipN8xpv9tqErhPiWT gVHVsLjfWTXwg2mUFlubxRXk2sji69uofRWX2oHMvCffWvyGpGJO6Tch1EH41Wz8doSt5EPSwD5KS A8CI8MMFmDyjJ4AZCePYSYNq99rlRB7qdn4EhoYT6NY8lfGd4QQNdh4FrY1ofN2fw+32sl5OHQUXV BwvPF3v7KXv78igyp4+iKzTYdqYRHMlxtXh+opSFkfoKcGnPRPhRaT5ZsRykzT9OPyEDr+teQ+Ws0 p3Q54vqmzxwVQlRy2AnyCej41yNeAM9Ldo/rzkCIWFWHfyg1m0b47vLLyPQTgqWiKUtXBDc+1iuxl XNqAlmhA==; 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 1gRwXv-0005vZ-TQ; Wed, 28 Nov 2018 09:54:15 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRwXt-0005uX-QT for linux-mediatek@lists.infradead.org; Wed, 28 Nov 2018 09:54:15 +0000 Received: by mail-pg1-x543.google.com with SMTP id t13so9258975pgr.11 for ; Wed, 28 Nov 2018 01:54:03 -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=phuOQIHhtaiR8GKkWxLxlxfb87tGYPgu+E8hPrCYdbs=; b=jbgq0hX/OBEwP9H7k7pO2RwzvNfpvBVKnjj80CGRXEdMwt9Y/1vhBdGPxhL292ua2g LKTgHYfYER+ZLzOMfQhCwfA40Q82Q+c4Y9knDBVM15zD/b7Ol2jlfAqLs0a2LdRps/v9 jzMGR9cyccdeJ+hp2/k4XzzBVqqZJSBJQduCs= 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=phuOQIHhtaiR8GKkWxLxlxfb87tGYPgu+E8hPrCYdbs=; b=eKVDkC2oauiJvjew10003KnZUIwMzWHPPzZEZ900xik66KCd9sNN3FAXfiF3XdT3AM dQfW1GagrgCJYL5Egh5e99tQHNo68Akd/xI+eIlnyXFUUf7y0DEM9Fjy4I25ASxZkYgL Z9RUZrhWOqrBu4ELr6gvICyYGkpkAAHUO1RoJ9hOdANI0Zho+s63Xl/VFZaQbLhXk450 6x23TRTY8CNa4GEqfancsoZB3xKtrcW6RkQmy+UMIOLUixDnLSAdoqt8mHhlm2Df1pVb DVFoiuFmHIvFhk0QhMj1ufyAfakFDUshsGdQupCZuYg4w9xtGU2Uq+pKqut7AiKWiGDK 7gRQ== X-Gm-Message-State: AA+aEWY7R9nDfmPmQiMjMlPlWroN3fCudKUixb95OfTPbWbKohYbYe88 Q1jYJpnX9uYyweLxaImK/VgJWg== X-Google-Smtp-Source: AFSGD/U6fm79MyS8kX8LQgobST9zhr3DlMly+JetZVc4psrEkCAiLkRG75+VGUt+EtDzk64sNRfl7g== X-Received: by 2002:a62:6e07:: with SMTP id j7mr20472163pfc.135.1543398842768; Wed, 28 Nov 2018 01:54:02 -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 r130sm11223806pfr.48.2018.11.28.01.54.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Nov 2018 01:54:02 -0800 (PST) From: "Hsin-Yi, Wang" To: linux-arm-kernel@lists.infradead.org Subject: [V3] usb/mtu3: power down device ip at setup Date: Wed, 28 Nov 2018 17:53:58 +0800 Message-Id: <20181128095358.42498-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20181128092953.41541-1-hsinyi@chromium.org> References: <20181128092953.41541-1-hsinyi@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_015413_918467_C129A1B8 X-CRM114-Status: UNSURE ( 9.96 ) X-CRM114-Notice: Please train this message. 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c index 46551f6d16fd..792c420fd4ad 100644 --- a/drivers/usb/mtu3/mtu3_plat.c +++ b/drivers/usb/mtu3/mtu3_plat.c @@ -200,6 +200,13 @@ 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 maybe poweron in LK/BROM stage before enter kernel stage; + * power down device ip, otherwise ip-sleep will fail when works 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 */