Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp764227imu; Tue, 27 Nov 2018 22:05:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/UxYXP2XPIjd7IK1HJQJlcTRKz67ZHj3fkFBoVCCwS0hnUhRI3Y3TIKLrtcrAm8YcRNajo/ X-Received: by 2002:a63:1157:: with SMTP id 23mr32249877pgr.245.1543385110674; Tue, 27 Nov 2018 22:05:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543385110; cv=none; d=google.com; s=arc-20160816; b=tO09mqWvPGO5Yu9qdOYAXjzkM9CsHC0ikkGcr0usLah52TgL8n4osSKYVphtOiMeUD 19hgHzeAopwAhOK9D2OAlavxYRJS6X+a3r7qnTv0+lnG5zLH3KF1JmnID2/l/Du0+v5W Ux2J8D2x7sRy70hyKmV11XnP0NqnbVkplVLUI6XgOo8KgwoJLwBfF1QQEZ3LLkybT+ps dVf3jAVPhET28xK54k5YqHsSCO47uIVVbusRG8hAk+mkACmRJb2pveaLsRVA8doMkC7a 2qZli6cMHs3AEX6/K5IVrzENWpzVI9PfeUvWuJItuNxosKQxoDct48qQFqSizh60Dyye T9Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=CP0ZZK7SqB43zKSvumuMlYKiaZyMxI0xBVfIYtC5CkA=; b=CcTN7RBZHg8NFIBxi6nKmgrc6x1Z2q4xFu64Ddzm5SNYIMHfNsrVTclrQ/U7qkKlGO kiDJo+1AhT8WLOB9mK3pOJihIJZpvnjbkTACkyebTJHZTgS8tb4wT2+rFDVyC9FhY+0A QTPydgfeiH9PB3vcO9VSxskQRlpAYI0xbS/a6jsLYvw/0uQNTLp1bsbAd1R/hNMZLQLY IPhw2fklGzqHVeJR90aWXYZOwdoi2HA4h1nmFKKrUAQYrIKdqYEejIcDaiyIx4kXaEr1 1jfAdd6l6T+yWYA6lVeqHnGXaeL1ba+BWuXaGlBRVdLPWEbJRHd+yLlxQCm8s106/TVd FahQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=D1IamjTX; 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 e1-v6si6342808plk.4.2018.11.27.22.04.55; Tue, 27 Nov 2018 22:05:10 -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=D1IamjTX; 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 S1727426AbeK1REp (ORCPT + 99 others); Wed, 28 Nov 2018 12:04:45 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34049 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727249AbeK1REp (ORCPT ); Wed, 28 Nov 2018 12:04:45 -0500 Received: by mail-pf1-f196.google.com with SMTP id h3so9654877pfg.1 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=J1shaFHGQNXgGh2Lgs26mFXtJqla6BFsgZR3OywScBLZ93JcZxyobQFRkARRe702cq MKxNu4yacWCV293YauMDbeLF0vK/uKC8O12MpARQS1jBkTw0cFdGZnY+I1YlmOoL0foN Ew/U9RPsGSxarnKMxyEQymU8HJvhOn30JSDmfFwk+qkvoeR8OtAwS3k5W13bMxWQ8aSe ddnACk6eNBiUS42+zSKFfZRR4lTz7UEgPziWnOdJo0y0XepTEagj8QyntRMXsD/Rdn4D YdrlUF9JNuI6btCduJbcMpVmDsmaH7xjLoWeW3FQhUYRvgkg2dovF3oyyVdzP13xodBo 5+TA== X-Gm-Message-State: AA+aEWZ9PAb55lip7w68u/nHgfJE9lWjlBCqlOTb2myF6d4w8l8FzmL/ DCwL3rIH/8Cga7pXW0CXXkU+3w== 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-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_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 -- 2.18.1