Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 218C1C433DB for ; Mon, 8 Feb 2021 06:30:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9E45564DC4 for ; Mon, 8 Feb 2021 06:30:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E45564DC4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=C5mZkfkVlKks80Mnz2Btted9lrSNj19sSBJz25ht7Aw=; b=FY17wmc0MWRLbDBG3RnUsTlUt pnyzwN1Pl+Axz+XuAm35F4xt7DYfzw3zQCOAMxznpB72MDIILxexVsEW4jabn2PzIz4NIjk6JGEFE JjCnUG+JsoLBTeDhKq46fsWZ5S6hcvOOqTKjy8ObSYRrsRUIVKRCRxRyl1iT5HaTRCcCV01jN6eTw ChvktPOdtf9CnicIic1E/xej9mR7OtXsPfMFv0hzOU/8/jzoNXsNMDoHmq9cb9BN/0NwdgcoPYud/ nh0iZmJay7Pso5XOx+auelvVYCa41F/sAOnxwcGS9xIEtcpZkH8JRFg1oAmy3yu5BGQ0WLlbOqgwr V59nfcLTQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l902z-0005xs-VK; Mon, 08 Feb 2021 06:29:22 +0000 Received: from new3-smtp.messagingengine.com ([66.111.4.229]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l902m-0005uu-Me for linux-arm-kernel@lists.infradead.org; Mon, 08 Feb 2021 06:29:11 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id A4E0D58021F; Mon, 8 Feb 2021 01:29:04 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 08 Feb 2021 01:29:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=daqee4/YfWrBT wdQcL/9RUOofu39a/j2M6J+Y7w578s=; b=mOCETWsRHXK4ll6tgx3PBs5WM8BVP Zs68YVF+dr/9lrPoJCJEdqjdPXR2VH9s83/iTQ3KWoNpHuWEoNBsUpAbd1ZOZta9 RV5CHm6CrLjSR7dboVOlXlwV3fFDHSXCIUBYDYpvwSRI1YtYKu2lwWRbWB3c+H0S ZQoFsLf4g1H9MPDhvm0sBQ9cfUIEVfUdME5y6iZ/sdUE4grlXXwwPoAvLWrx5Oh9 BawilUWLAZqRfZq0MEC0glVWE2kdjE8RAZDpvUE3TidIOINH+RMYDzZLlkkLWGgb PIbf5NgsgEUfk1nK0NvOJCGD6NAdj05k1pwDnqOjp8IVEpFpgJCK0y1ww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=daqee4/YfWrBTwdQcL/9RUOofu39a/j2M6J+Y7w578s=; b=SkxXEBDU XYW9Lht4IOQH8B4AePpTXdKNRNIRVSbSNMdA7fBqYy0WAsv3sZxh6LvXbKoI9CcX Zp79b9bCLCgmwvge0Y5PSHnTsqgTbgtV71cQAmWTA22EmQYgABKhJHOv3xy6r86O Q1SES6deavq0VgDXFBiwylBY0/PaKPRniK3xBbGTAo3VmsWnbWtbgmBgHwfTnrlj fdBnFoZrb1dMPJKX5c9QWR5LkaRf6SjJ9L7boUetvepRT3DvjGlV20nZGvv4DuDm cuX5f4d/1+UxCEB66ikInwLs6L80rb6KZ6Q5fLIntTvjrNEUQLFJx70iA27ApOAF dCIciEAzQ1nxEA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrhedvgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepudfhjeefvdfhgfefheetgffhieeigfefhefgvddvveefgeejheejvdfg jeehueeinecukfhppeejtddrudefhedrudegkedrudehudenucevlhhushhtvghrufhiii gvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgrnhgu rdhorhhg X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id E0BAE1080057; Mon, 8 Feb 2021 01:29:03 -0500 (EST) From: Samuel Holland To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Corentin Labbe Subject: [PATCH net-next RESEND 5/5] net: stmmac: dwmac-sun8i: Add a shutdown callback Date: Mon, 8 Feb 2021 00:28:59 -0600 Message-Id: <20210208062859.11429-7-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210208062859.11429-1-samuel@sholland.org> References: <20210208062859.11429-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210208_012908_873908_0C546B51 X-CRM114-Status: GOOD ( 12.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ondrej Jirman , Samuel Holland , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The Ethernet MAC and PHY are usually major consumers of power on boards which may not be able to fully power off (those with no PMIC). Powering down the MAC and internal PHY saves power while these boards are "off". Reviewed-by: Chen-Yu Tsai Signed-off-by: Samuel Holland --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 4638d4203af5..926e8d5e8963 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1282,6 +1282,15 @@ static int sun8i_dwmac_remove(struct platform_device *pdev) return 0; } +static void sun8i_dwmac_shutdown(struct platform_device *pdev) +{ + struct net_device *ndev = platform_get_drvdata(pdev); + struct stmmac_priv *priv = netdev_priv(ndev); + struct sunxi_priv_data *gmac = priv->plat->bsp_priv; + + sun8i_dwmac_exit(pdev, gmac); +} + static const struct of_device_id sun8i_dwmac_match[] = { { .compatible = "allwinner,sun8i-h3-emac", .data = &emac_variant_h3 }, @@ -1302,6 +1311,7 @@ MODULE_DEVICE_TABLE(of, sun8i_dwmac_match); static struct platform_driver sun8i_dwmac_driver = { .probe = sun8i_dwmac_probe, .remove = sun8i_dwmac_remove, + .shutdown = sun8i_dwmac_shutdown, .driver = { .name = "dwmac-sun8i", .pm = &stmmac_pltfr_pm_ops, -- 2.26.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel