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: 10701991 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 02CE714BD for ; Wed, 28 Nov 2018 06:04:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6C0A2CC93 for ; Wed, 28 Nov 2018 06:04:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAF6C2CCB4; Wed, 28 Nov 2018 06:04:25 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59AD52CC93 for ; Wed, 28 Nov 2018 06:04:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727290AbeK1REp (ORCPT ); Wed, 28 Nov 2018 12:04:45 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:35846 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727082AbeK1REp (ORCPT ); Wed, 28 Nov 2018 12:04:45 -0500 Received: by mail-pg1-f193.google.com with SMTP id n2so9011502pgm.3 for ; Tue, 27 Nov 2018 22:04:17 -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=JUt1U8U9QL8Fj2r2sTkmGBVUDEzZjP5VDOQUVQ+NzZaqSlgv35CXslPUGWfC0Eb1/A 93sQYcvAyFVTJDll05v6nuOvGQTUqoF6DN+ce/JbraSe6Og8ytDBZXhvUbdGZpa5QtOx GvHTr0zt7Lk9X8UPcKbgm2guTozoi/giiX9i61f9CMPX9mArdT8NU2NfpKTRy2qIhSKp QQ0I5LwMB6UJtB3T3hITgdi30HdMSVvH2vWoZHsdm/TebKWMJDxZlbPiQaliFQMA9OGv mr7d87d1OzL5ASkdDdldEC1A7ttwRnAoUbezBkVzi/GXX11SBH4DDPLdH8OoT8axf2eP iYRA== X-Gm-Message-State: AA+aEWZzqG7/AXpRAFBT1aTjS1V6PZI1v4x8SkxhHSKdMnO4Q3KziN7b cJvDsBFMfBzFpcTanEZpr/MNbw== 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 Cc: Chunfeng Yun , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.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 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.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