From patchwork Tue May 2 07:31:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 9707537 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9FAEA60245 for ; Tue, 2 May 2017 07:47:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D923205FD for ; Tue, 2 May 2017 07:47:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E6C821E5A; Tue, 2 May 2017 07:47:52 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2BE4E205FD for ; Tue, 2 May 2017 07:47:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=2lxNdnvhCs4OlfCu8sIlZQJT9yPXblUTyT+kPJAFx6M=; b=mEf bLnlzySa7koIDsM6cTB6E35UJQgFftZX6o0O9xTJrz/ZhYmyThpn2clTx0uY1NgNG1DUaWMVr3qN3 sDve4+KEXA56Onb2m33nL/P3qdkiN1YfSIwg7QGAotbhHU7ituHfZ4D/6GXuJAdB+6wrGCAgCI7MT 3KXupmS6PXKgBqzrvvbKS9My3yy9R5FbNHitMYxZgmnUVjds/LZbMaj790KW7vWUnIBVBBCdaZDsS lfEFVkNRFPibFv9GTd5mZ328kyvSAx9LYKSMhyoogk1Gs0XZxzTzOdwe4BKp1XELpZpR/nCEISSEQ FhH7e6D0lFxxQ5b5dDp9spVYD5Hkxvw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d5SXH-0002A9-4V; Tue, 02 May 2017 07:47:51 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d5SXF-00025J-V8 for linux-rockchip@bombadil.infradead.org; Tue, 02 May 2017 07:47:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hpKXVjvHaaa6qHdn7LQ1Bch1bLnPqBxqMbM+biSenEY=; b=ZcUZJkv0gnu9mFmqOVuLjMEz1 xny7zEFjCZ7xJ4cT/AlLHxQYOlqrvnmflsTidxmdK56zzBdRPgwtUiSjIO76pdDJuSGEEtDDT/WnL LkoekgCbwXoouziHSvZUbBKpAWJjhdpoaXtAdDiEx6eT2Ibo1Okx/OsDrte0lfvg46g2NtYaifLYn 7goJrosWvL3koxRnQBB506F+//uT1pGxGIId62OXNfzudyfcoAGgJDvTNBbLjnbB/XEDgjeFe5V6+ Xs+9oZX5o/DeIOIMLoBNrgzxAAK0WCJqKBnm38sES82ZT7WObAz8naYNHuLwl5kSVpb5hwc/v9v1J tZ4+wbBvw==; Received: from lucky1.263xmail.com ([211.157.147.134]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d5SIt-0007n5-E3 for linux-rockchip@lists.infradead.org; Tue, 02 May 2017 07:33:02 +0000 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.129]) by lucky1.263xmail.com (Postfix) with ESMTP id 42D151044; Tue, 2 May 2017 15:32:19 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 565A2372; Tue, 2 May 2017 15:32:18 +0800 (CST) X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: bhelgaas@google.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: <8a1d1936fc1a8019f12e5e74bab20fc1> X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 108746CRP5; Tue, 02 May 2017 15:32:19 +0800 (CST) From: Shawn Lin To: Bjorn Helgaas Subject: [PATCH] PCI: rockchip: control vpcie0v9 for system PM Date: Tue, 2 May 2017 15:31:23 +0800 Message-Id: <1493710283-164065-1-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170502_083300_533618_7C74B113 X-CRM114-Status: UNSURE ( 8.99 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jeffy Chen , linux-pci@vger.kernel.org, Shawn Lin , Brian Norris , linux-rockchip@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP vpcie0v9 is used for PHY, so we could disable it as we don't need PHY to work then in S3 if folks assign it DT. But we should note that there is a side effect that we could not support beacon wakeup if we disable vpcie0v9 for aggressive power-saving. Cc: Brian Norris Cc: Jeffy Chen Signed-off-by: Shawn Lin --- drivers/pci/host/pcie-rockchip.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c index 0e020b6..c8ca796 100644 --- a/drivers/pci/host/pcie-rockchip.c +++ b/drivers/pci/host/pcie-rockchip.c @@ -1251,6 +1251,9 @@ static int __maybe_unused rockchip_pcie_suspend_noirq(struct device *dev) clk_disable_unprepare(rockchip->aclk_perf_pcie); clk_disable_unprepare(rockchip->aclk_pcie); + if (!IS_ERR(rockchip->vpcie0v9)) + regulator_disable(rockchip->vpcie0v9); + return ret; } @@ -1259,6 +1262,14 @@ static int __maybe_unused rockchip_pcie_resume_noirq(struct device *dev) struct rockchip_pcie *rockchip = dev_get_drvdata(dev); int err; + if (!IS_ERR(rockchip->vpcie0v9)) { + err = regulator_enable(rockchip->vpcie0v9); + if (err) { + dev_err(dev, "fail to enable vpcie0v9 regulator\n"); + return err; + } + } + clk_prepare_enable(rockchip->clk_pcie_pm); clk_prepare_enable(rockchip->hclk_pcie); clk_prepare_enable(rockchip->aclk_perf_pcie);