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: 10702127 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 EC6F913AD for ; Wed, 28 Nov 2018 09:30:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBFB72CE78 for ; Wed, 28 Nov 2018 09:30:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF6D72CE60; Wed, 28 Nov 2018 09:30:14 +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 887222CE70 for ; Wed, 28 Nov 2018 09:30:14 +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=C6oFZ0KzifWKMDvKJ+gPhdlCxdjS6wTQhtK+UUqJadM=; b=eSqT/mp2eYTLGxXb4h1bYacTs/ cd0C5N+sT3cuGT2IaryqDof/l5T16IRp6wJ6QHBrgEeBp8jyNE0J5edk+dvpgzWjno7fns9Oy1LWA BAiNmLGc2ELCfAza3eClZiCqrPP1BZhcQkpQyorgvSpFyUY6LZoweF/R8ZldO+Ciag7Qx4fI+CU1g tqCDQrqkSJC1eUa9Enm3baAu8PyO5/42uwa79vyZFBcylx22Co4ErRBl3Mg0Y6Bt6Z5Sk3tDTCQbZ ZxxUIe6V9xP2W1Vkvl3Ux3NS4AiAiocqPkW/5xD+7g/rxp1h/Mh9+I9hnzO9rGLg5yZDD4vb/cFHN 4r50ob7Q==; 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 1gRwAe-00082o-52; Wed, 28 Nov 2018 09:30:12 +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-0006lq-4w for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 09:30:10 +0000 Received: by mail-pg1-x544.google.com with SMTP id 80so9249281pge.4 for ; Wed, 28 Nov 2018 01:29:59 -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=B8ZsC5BA9oaTSpg6FYKUQoMsAPF3UwgSOMqUUunBN0rOWz20odpC94LqNpJO3wdBss GxtoAtGiHPTdBu2zZ4I/RbtNQi63zeMO1ExOTCbOYV1D2GRMlYEQLoNjeitffCwhujtu RFcFYNlEBKEC5eUHqW2N+aVuHeRAwb9FJlr5NmQ4pejpSRUl6xZ+T7Cq9C9ahqtgb2Jr S/zB3K/SY0I5oHswsSdFjU08rRShEEdKPHqKH2SBGI5TodxdUMH1upq4kK9HAc8Yb+WO szOcp2CQ4NSgV5jDR1wqedDc/yKXeWZPwgCg9E/ROWn+Ob4/k2syX1+IktcPuPLrjvL7 7eyg== X-Gm-Message-State: AA+aEWaoRY9vgpInNcp/7zOCb+g1aJBa1ucN/yRGVHeG04J1Ne7QUSPV rnmqza++CYQ9Uo4ldBj/J55nqgnlwrL28Q== 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_253472_AC1BC671 X-CRM114-Status: GOOD ( 12.00 ) 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_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 */