Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp940492imu; Wed, 28 Nov 2018 01:56:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/UvcFLx8s+fwYLZADf+sW/g18SRv8LMaWOPESQCd3hd/PHX4ozgPLytaAzrc7sytBxH20iH X-Received: by 2002:a17:902:6b83:: with SMTP id p3mr16450843plk.118.1543398985217; Wed, 28 Nov 2018 01:56:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543398985; cv=none; d=google.com; s=arc-20160816; b=eMbNjXPrXb+izpEon6vIdrZXX/mklEwUMvqdfekZ8bT4HQPj/5QsM4hYfryW/O60UX a2kA9PTdbIhprHl/4owiAil1/3JrocCq/biMlGk/J4zV0Pr73KKmEGdWhutBnw2dkJuc IkTeKwndIXh7n5JhAwTwwtu6OCf14TJNrmzukCqSfnyv66TTdFn+ajI61eE8S81/FUoz Q6l/bM1ZoZCl5/QU1bSRwLwS/rQWFy221TgbIVa9x+Kds4kmH5bAryFNjC10SrMZ4Fyf RYw/BDel6jJHEssHkbQelkLabJkqfY0+vWh+lnnDiLQFTCX+sT2uiQ+IiThPGBH3zPQt 1Paw== 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=phuOQIHhtaiR8GKkWxLxlxfb87tGYPgu+E8hPrCYdbs=; b=e9+uIV6WEw5p7BLq+k9gG7c7K9AzEaZwMukkZQBUiZpOWTgzCkoc/wRlUDpk5pyvVg OYqZG6fXZF+2G2O8a6t8wkxjF+WIbMzAjIYhll9mdDdW+09jkUU7uT088oNfDTkoXrN3 VfoZfvsUjFG2qoDu4MrF+vhMHfXqgPxO+KqTm8sFWCEaKh8D+v4QUR20gVXHLVyUe8c5 9wZ82/fhLreUwJolY2zmwd7SOYmPKSYhCKT072SKxj/faGSfbqZ8d0DW9EBRiiRiO1qL W70Pyb6EbkoPsHIZtLpUiFvQhM1Vc++aUMQaJev5yl+bszaCq604sySI0BLPzsFU6dlG j3qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="jbgq0hX/"; 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 r12si6746160pgk.520.2018.11.28.01.56.10; Wed, 28 Nov 2018 01:56: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="jbgq0hX/"; 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 S1728183AbeK1UzH (ORCPT + 99 others); Wed, 28 Nov 2018 15:55:07 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:36569 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727541AbeK1UzG (ORCPT ); Wed, 28 Nov 2018 15:55:06 -0500 Received: by mail-pg1-f196.google.com with SMTP id n2so9276029pgm.3 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=WAwaGh5V6jgpXZXTin3UelNqG2sjClx1mot69ZC9pzaqfswNdYwch2vBrEmyX3Eguy TTcts4Sy55vRjUu3No8ePPA/vJfiMLIedFro4+749/bFivu+pw7cB5K3fc0ALyUX0heQ OupLPPKTWS80Kge8CPFuCEuFNqNTWFq5CElgHS183VbpvnYugptfcSC88BAHK82QJlMB efaE3CVo5hCQWQ0LouCpPrcDeM4dhAIiR3wqYYTJAz4ftidNs6cELkQrbCG86mxApkOb hr2f8hPPhPo1RmU171wbYMfc2Ng1T8zRM/gKSlUX9fFgyrhYgQI7ei0S4d1AitedaCVf jJUg== X-Gm-Message-State: AA+aEWY+6l9XobKFlew7RNJL9k5F1eqkNoMF1LlJPBXrstnENJ7XcxIR eOqhCIuu8/lsd9aRQ3SRhDByGQ== 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 Cc: Chunfeng Yun , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.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> 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 --- 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 */ -- 2.18.1