From patchwork Tue Nov 14 12:04:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Gonzalez X-Patchwork-Id: 10057461 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 304486023A for ; Tue, 14 Nov 2017 12:18:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3B9229743 for ; Tue, 14 Nov 2017 12:18:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E898829752; Tue, 14 Nov 2017 12:18:14 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED 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 9EDB429743 for ; Tue, 14 Nov 2017 12:18:14 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:Subject:References:To:From:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wl7XNYH3syAaJDeVWbtEF8dO9QAlrznYVU/gVHLhGzc=; b=UUhvBDKmNlMRqJ IfKiquvFavYoY0Hiyqoqg7wjaaauDRnRoqjQ+g208JRjRn/yI0Kw8uZoi3B++4zDHnM7U5dYHOc4h ya12Cy586mo1erHO81g7HxP3JqYZIhgyrcg4y3zfXn/HEqJdaP/uef2W+kPdfI4eI+dtdN9vtugY+ XFfvHBUi1M/Qb1PM+uwYkuCc1Lj5qjLzl9K+yIlljmcTQ6l+/BsmDSy2vidggjU039imFaTwLLBvI o8YN2dVy6yoDiNY7n+YqEbqlkYaSqp5JARBd7Zeg6eHxvjQK856UfMyh8zTkwQNvSW8aGVbx0OLP1 qA32bT1TLMmaucjgf27w==; 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 1eEaAL-0005Mp-IL; Tue, 14 Nov 2017 12:18:09 +0000 Received: from us-smtp-delivery-107.mimecast.com ([216.205.24.107]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eEZzv-00086U-CH for linux-arm-kernel@lists.infradead.org; Tue, 14 Nov 2017 12:07:31 +0000 Received: from CPH-EX1.SDESIGNS.COM (195-215-56-170-static.dk.customer.tdc.net [195.215.56.170]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-141-FSVzQyalPF-NJQJoUTxBIA-1; Tue, 14 Nov 2017 07:07:04 -0500 X-MC-Unique: FSVzQyalPF-NJQJoUTxBIA-1 Received: from [172.27.0.114] (172.27.0.114) by CPH-EX1.sdesigns.com (192.168.10.36) with Microsoft SMTP Server (TLS) id 14.3.294.0; Tue, 14 Nov 2017 13:07:01 +0100 From: Marc Gonzalez To: David Miller , Mans Rullgard References: <230165aa-eaf1-6e2b-7ff3-45b3ee4ffc62@sigmadesigns.com> Subject: [PATCH v3 4/4] net: nb8800: Add support for suspend/resume Message-ID: Date: Tue, 14 Nov 2017 13:04:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.1 MIME-Version: 1.0 In-Reply-To: <230165aa-eaf1-6e2b-7ff3-45b3ee4ffc62@sigmadesigns.com> X-Originating-IP: [172.27.0.114] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171114_040724_167371_57918BA7 X-CRM114-Status: UNSURE ( 9.45 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev , Thibaud Cornic , Florian Fainelli , Linux ARM , Mason Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Marc Gonzalez --- drivers/net/ethernet/aurora/nb8800.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c index b71d8fb80610..9af2423aed03 100644 --- a/drivers/net/ethernet/aurora/nb8800.c +++ b/drivers/net/ethernet/aurora/nb8800.c @@ -1437,6 +1437,26 @@ static int nb8800_remove(struct platform_device *pdev) return 0; } +static int nb8800_suspend(struct platform_device *pdev, pm_message_t state) +{ + struct net_device *dev = platform_get_drvdata(pdev); + + if (netif_running(dev)) + return nb8800_stop(dev); + + return 0; +} + +static int nb8800_resume(struct platform_device *pdev) +{ + struct net_device *dev = platform_get_drvdata(pdev); + + if (netif_running(dev)) + return nb8800_open(dev); + + return 0; +} + static struct platform_driver nb8800_driver = { .driver = { .name = "nb8800", @@ -1444,6 +1464,8 @@ static struct platform_driver nb8800_driver = { }, .probe = nb8800_probe, .remove = nb8800_remove, + .suspend = nb8800_suspend, + .resume = nb8800_resume, }; module_platform_driver(nb8800_driver);