From patchwork Wed Aug 31 06:13:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caesar Wang X-Patchwork-Id: 9306337 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 A7AEC601C0 for ; Wed, 31 Aug 2016 06:14:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 99EF628E32 for ; Wed, 31 Aug 2016 06:14:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E92628E36; Wed, 31 Aug 2016 06:14:36 +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=-3.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 560D028E32 for ; Wed, 31 Aug 2016 06:14:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1beynD-0000aW-Oz; Wed, 31 Aug 2016 06:14:35 +0000 Received: from mail-pf0-f195.google.com ([209.85.192.195]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1beymx-0000TQ-8a for linux-rockchip@lists.infradead.org; Wed, 31 Aug 2016 06:14:20 +0000 Received: by mail-pf0-f195.google.com with SMTP id g202so2206978pfb.1 for ; Tue, 30 Aug 2016 23:13:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YyM/bMarVJWSAxXqm70rtvOnUNVQI/MebRxXoXvaQqY=; b=LNDlxQqnPY2aOYj4K0/OhEpHWReEHzjexTUp6u8Y543NuRoR4IPwo3H8RkyFHDDWJs ekA8iJ2Yqpjw9KQkXN5T80iTMS+jNAZQndi3rziUQxuU0Jo1wXuD9pvwC3p4OZr7d+0f jEh4fqeZw0Peq2rKA9PM9m+5ouUjpOa/qF5q0qS231lXuJVVKdbowkgn/dGPc5U3/X0O OZNl/buBXMcOKEb/yHT7yfnmzpwXey1HCNwb9cngNytGcl0eUotrL1QreeLY+lV7xMYf oWxJhb5MRcQwHtFNGhnteisiZPXsNEkVmPcUdf7r0+0Wmt5EHWM7ywctuvjGeZ7Bxg35 Vq4A== X-Gm-Message-State: AE9vXwO6DaF0FNA8haaEcVxuYJeTiyNKDzjOIO8FDAnMW81gM6zZkop0M2N4ocZtiNu58w== X-Received: by 10.98.71.140 with SMTP id p12mr13720782pfi.93.1472624037921; Tue, 30 Aug 2016 23:13:57 -0700 (PDT) Received: from localhost.localdomain (50-196-170-193-static.hfc.comcastbusiness.net. [50.196.170.193]) by smtp.gmail.com with ESMTPSA id n80sm61618441pfi.19.2016.08.30.23.13.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Aug 2016 23:13:57 -0700 (PDT) From: Caesar Wang To: Heiko Stuebner , netdev@vger.kernel.org Subject: [RESEND PATCH 2/4] net: stmmac: dwmac-rk: add pd_gmac support for rk3399 Date: Wed, 31 Aug 2016 14:13:46 +0800 Message-Id: <1472624028-7082-3-git-send-email-wxt@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472624028-7082-1-git-send-email-wxt@rock-chips.com> References: <1472624028-7082-1-git-send-email-wxt@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160830_231419_392709_A4A0DB4C X-CRM114-Status: GOOD ( 10.32 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Brian Norris , Alexandre Torgue , dbasehore@chromium.org, Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, David Wu , Giuseppe Cavallaro , Caesar Wang 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 From: David Wu Add the gmac power domain support for rk3399, in order to save more power consumption. Signed-off-by: David Wu Signed-off-by: Caesar Wang --- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c index 289e7a6..406573d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "stmmac_platform.h" @@ -659,11 +660,19 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv) if (ret) return ret; + pm_runtime_enable(dev); + pm_runtime_get_sync(dev); + return 0; } static void rk_gmac_powerdown(struct rk_priv_data *gmac) { + struct device *dev = &gmac->pdev->dev; + + pm_runtime_put_sync(dev); + pm_runtime_disable(dev); + phy_power_on(gmac, false); gmac_clk_enable(gmac, false); }