Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp920662imu; Wed, 28 Nov 2018 01:32:11 -0800 (PST) X-Google-Smtp-Source: AJdET5eAekDRDql2RZwbNLej6QM+BZZz2JKDgo3dv8ncb3JZDF3pxXkQ59TLvmnqFeZJmASVDDmD X-Received: by 2002:a62:c101:: with SMTP id i1mr36806738pfg.80.1543397531338; Wed, 28 Nov 2018 01:32:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543397531; cv=none; d=google.com; s=arc-20160816; b=i9vBXQiQR+RccPrCEhrFiWsyjAXIu868ldqQ8U2mtfIn24jt5Qg/fAHBLfaR+Pfnw1 yMsNUAkM4NwDnkvkERZkrCKLHpCTtYFurH/titI9Uz/72JfsAX+kRzjqYYvoMCmU9ToP h59OqaDLZ7Zfdn3zWdZh4ojpGmLYUKY8P3bm01aemGkZmH/DQjqazn77YvOGrj7D2fq1 dU9H6rDzjFcTLPx17zIVRdA1xAvLrZLT2bazeXOtIFh5pHDbcH8PlsrmLIE9GHTXK5JU h+vaJFfDzErGBzh9s53G8H6RrDb0lNntw0/cVoLcdA9bMd86Tw7TH9LkxsaVWrgFTcHr hp7Q== 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=bZfZFWO8LVzOeMYPieoDTbNggt+PEiM2bxAXF77bHsI=; b=GT0xS2IXkgVqwq576uHaCNEPnbXGTy5Z3PR3E1L3byfyap1Do+aKGCrraBTAqJvOYv FB7BYPoNr0BLhb3FMr2mJJljxuylmqH+L4AozSPjOZRlw2hm6WYV5EO0BVBJcph8F7Li 7RreUIybhGOJk7uRwy/ml4zLwjiAC1GYudT+dgPLm4AR2YjuH2faTB5mM4gOHFH79IMA +hrUL/4EDr1YnRh0vR9DA81O83aRGDOEDfoVMqNQe5eSQ5KwnB8ZTCBLPU8y0VMlqGo4 b2/sNx+XEKhkGeq2SOi2i/qC00oSt62/hLuRjJ3Yd5Cux5FocYxbRSCsdf1KseMVH6fx Mihw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=WMDgsZWo; 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 l3si6891595pld.229.2018.11.28.01.31.56; Wed, 28 Nov 2018 01:32:11 -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=WMDgsZWo; 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 S1728078AbeK1Ua6 (ORCPT + 99 others); Wed, 28 Nov 2018 15:30:58 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38199 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727585AbeK1Ua5 (ORCPT ); Wed, 28 Nov 2018 15:30:57 -0500 Received: by mail-pg1-f194.google.com with SMTP id g189so9254161pgc.5 for ; Wed, 28 Nov 2018 01:29:58 -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=mVD69Gds5L5VqjqEW3q0oK+Ns+5PfCog9/f3tSQsciPa2bawsY+Z9KTpstJAqk+stu ZdaLxZR47EMrJIIahBVeOy+NzA27U3z764ACmybdb8+C3V3RgSeiOS/d6NfPda5HckW/ 9GfoTjHWXZ0kH7wiUR80XdjEzzy0eZK5VFz6Juvx+qmKx0EvnFDb4C3GauvCrt6NrMJb NqDaVb/Pvh3l+7v1JfpLkPcbs2xS5SwJMTD1hA0iAQKu2al6JdkvRanL2MThh0ErcU4O vuvFgHG/xQjq0bB4WhqOSvscLEa7VJUZPxtACYweaAiD0jJtF6+2qVBaq5kTyx5VFv0N 3i9Q== X-Gm-Message-State: AA+aEWasWLLTcpwGtO2RziDJQUr8KNIFg/X5py+uteOIde0qa2bXbNBl vMdqGNdL7MiRlAnqP83s/DFYNw== 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 Cc: Chunfeng Yun , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.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> 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 | 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 */ -- 2.18.1