Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1972238imu; Wed, 28 Nov 2018 19:17:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/VPMdzRjt7IBMQ5IKc182csSRrzJXrByO6ULAkbEV7ldE0IssmSwtkPCmMWmW6LmrRf1WLV X-Received: by 2002:a63:cd17:: with SMTP id i23mr35158595pgg.13.1543461445115; Wed, 28 Nov 2018 19:17:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543461445; cv=none; d=google.com; s=arc-20160816; b=QCr0Qhq7GnDomkvlNB8nonvRqvzSQg5o5kjE34AVwk37pgW4IUjoB1fjBkY4Yx2Tgg RsIgvHnx7t/KBFELs/qqCQws4u/WtVjNTta01aYwtdmP5RXC3LPVnXHLwEQCcbQw5xyH Tj7bk2MbuxNQEwX54vTKZIWBiYrGgUqcKU692QJv4nHn8ny5zHw2HLHiaJPiMbxulHfd /pks86ADumY6b4uoX8m4aXjxi/kMWooiPTmR81LFQYkakFHJ3pg3j+d5GKAWnsxh7ea6 rICNdw0siFUJjArJCC19MQONVv59sa4Ms8JaTNQyhJMFFZ3MYQwfdgkMsOoW1quJNP1w 6YWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=FfEaTpIexbfNgh3WA2OcVxQfootPIVWg5nn9CpgLyKI=; b=q2oP7/aNqClscwZfJc/tfkB5GQz4PhuoyjhvEHqP3hHlyV4uVLHfD4U6NRQwDfZjDt aDNtpcgp3gcX3K1mLqUH1N1JoFZQY4keMLmywdrPJg2BG9hQpUEgWi4oHJlhhu1NunOd kJnkvT9MpcEEHyggV6NH1NWxTLm20MvEUROsi2YTmFosqI+RAb42M5qGgMSE1YlMy3W6 CRqTamGa11cIvb3nlHhlX9BNnrHV5LjmWGxsgppgiKsqc4b8i5oDn+gDVM+nGXLLTVRU 6q7BudJsMLrZwHcMXq1HFDMFDbhsaUURvaj6npBl21vcvdtNfCQIMAqYl8i/Q75+Cesd Sw4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cF8sPaPd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o184si543804pgo.591.2018.11.28.19.17.08; Wed, 28 Nov 2018 19:17:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cF8sPaPd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727359AbeK2OUY (ORCPT + 99 others); Thu, 29 Nov 2018 09:20:24 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:42435 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727171AbeK2OUY (ORCPT ); Thu, 29 Nov 2018 09:20:24 -0500 Received: by mail-pl1-f193.google.com with SMTP id x21-v6so272441pln.9 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=HCWy16tfodotq+/3Hv1JqSvG34HXOjEPi7LaH91KXurh5DSY4Y9p8mlncHgoHyMldY lm67w8hWrp4XS5OGfwYIw0dsMQP/Px3/mOs03+h1svJJa2SjXUBGzBON/grfWhjiPjKM NjjbZThmfielfH2BrKXvOF4nslm0CzzcSBOs5NYFsQUH9zWB76xVdhCw+65CYM+3ezMa LNnCKIzarY7t2y7xnq4HXX/xMoY8lmONWAk1xxPeGHizUoujWzrSgATSavEIUcBxiR5Y 0E7SSisKzaeRSMdoKUk/g9l9IYNGKGNL94OMVouyzBcKzgaSCE5UTiyn46QM5aeMAuBY 7DTQ== X-Gm-Message-State: AA+aEWapDufcpbPFoP5BbRuFhrHvSFdgE2/YJnOK1+BdvVRJUYdNqigM poynrngGN76ja1nCT5ex9Agv0g== 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 Cc: Chunfeng Yun , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 */ -- 2.18.1