From patchwork Wed Aug 1 17:56:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Parameswaran X-Patchwork-Id: 10552777 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2AA5E14E2 for ; Wed, 1 Aug 2018 17:58:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23E612B857 for ; Wed, 1 Aug 2018 17:58:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17B9E2B8A5; Wed, 1 Aug 2018 17:58:04 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 B8FA82B861 for ; Wed, 1 Aug 2018 17:58:03 +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: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=sHUa4BvEowDUYmNQblqx0HmUoha3R5smzm6cr+pDrws=; b=cb4zy6ub6omtdu4uALtZ+VIUj0 DR+Wqycojux8u2O5CY9P0PxKtUDOQjkR/ZI0EwwsiX70dj2FP/qrry2BCXzN2RytuBWErnnFUEDED kB2mbAmt3FwBnFdp1vaPlmBeKnTwL3YK5tJZU5vJrPRzKRqC64sidRi5NyZNIgfH3NN7jf6uCvyUv tn1ikcrIltj4H6ZaFljxbr+CTcm0cNa3wZ21zd2Pa9KVC4oe7dVTH3K7pG7X0rnJZAnYWWdcfUEoL l5i1mnDvNbt+mWqSJNxJNbejc+8IQpE2VcLaz3z7C0xqKYp8BdVbg97bfPDafktxTheHdbwTAxiRD fYxO/etA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkvNl-0003qq-33; Wed, 01 Aug 2018 17:57:57 +0000 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkvMf-00023C-T2 for linux-arm-kernel@lists.infradead.org; Wed, 01 Aug 2018 17:57:15 +0000 Received: by mail-qk0-x242.google.com with SMTP id x192-v6so208433qkb.3 for ; Wed, 01 Aug 2018 10:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=N+kIkDYP/D6+lxFIQ9EfJw/C6zC9oAhfDWWx9Ovhv9M=; b=Pl4NRqznZj2NDw6bs7H/bqjnS85Wyvn78vtXuUXvlkBENaHlrDcYgUTzSgM4noQNM1 xZEB+siPZ+Ex9+zDjdNz/hHo940Z9oxdbg6uu+6ckmQ7vFlQdA380pIPRVgo7nLbA3gh syF0QIE/9xG/40Et0WqrHlhYgIG/dlrGynAmA= 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:in-reply-to :references; bh=N+kIkDYP/D6+lxFIQ9EfJw/C6zC9oAhfDWWx9Ovhv9M=; b=KnMVrQcoPUDs81iOPgK+SXLZMX8vPeuDBXPwWybAvLJL5GIsc5WLl9VuMXgX/dCtVU uYXdyO3POTMejQc6LoBx1/MJRNwfiZSJaQ8dVpdRnrX1ibJ3CLEW4fkgIEFkRrKu9Daf atQqsiK8JPWlIZjbFARfKI64Z+d2YDs4Dl0M4J+kqcV99c9BtkDTkAYtSdjAeZ+5Pe3H qWz/xizFH6tTAzCxb1dHEyZBcCpUyq3SSCfUmcxru/uG24ns39YiiUVzJuwgDXLhMsnj 5kLFxIFijcwanEcHW1Si4fCxc2Ed+QhRVVGeATqe4GL/AoD1KTPgePTce72EkOIxmItu NMnQ== X-Gm-Message-State: AOUpUlEtTz3hs1giozFhcSC/DE3n1DYCq/BT1TAWPYBKNxJUcBX2jUvq 4ZSnDiVwo13U/ddb72alkaU0kw== X-Google-Smtp-Source: AAOMgpe9uSYp6c9j+Uxd8IGvbG+6SpQRgHfeVJq+EmgDcblIju84GsC4WsmGnBYbTZwq6T0QEMrABQ== X-Received: by 2002:a37:1194:: with SMTP id 20-v6mr26087359qkr.379.1533146198648; Wed, 01 Aug 2018 10:56:38 -0700 (PDT) Received: from lbrmn-lnxub86.ric.broadcom.com ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id m12-v6sm14401729qkl.54.2018.08.01.10.56.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Aug 2018 10:56:38 -0700 (PDT) From: Arun Parameswaran To: "David S. Miller" , Florian Fainelli , Andrew Lunn , Rob Herring , Mark Rutland , Ray Jui , Scott Branden , Catalin Marinas , Will Deacon Subject: [PATCH v3 8/8] net: phy: Add pm support to Broadcom iProc mdio mux driver Date: Wed, 1 Aug 2018 10:56:26 -0700 Message-Id: <1533146186-8374-9-git-send-email-arun.parameswaran@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1533146186-8374-1-git-send-email-arun.parameswaran@broadcom.com> References: <1533146186-8374-1-git-send-email-arun.parameswaran@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180801_105650_601213_2410A49E X-CRM114-Status: GOOD ( 15.99 ) 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: devicetree@vger.kernel.org, netdev@vger.kernel.org, Arun Parameswaran , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 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 Add support for suspend and resume to the Broadcom iProc mdio mux driver. Signed-off-by: Arun Parameswaran Reviewed-by: Florian Fainelli --- drivers/net/phy/mdio-mux-bcm-iproc.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/net/phy/mdio-mux-bcm-iproc.c b/drivers/net/phy/mdio-mux-bcm-iproc.c index 5127010..4e2c51b 100644 --- a/drivers/net/phy/mdio-mux-bcm-iproc.c +++ b/drivers/net/phy/mdio-mux-bcm-iproc.c @@ -289,6 +289,32 @@ static int mdio_mux_iproc_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_PM_SLEEP +static int mdio_mux_iproc_suspend(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct iproc_mdiomux_desc *md = platform_get_drvdata(pdev); + + clk_disable_unprepare(md->core_clk); + + return 0; +} + +static int mdio_mux_iproc_resume(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct iproc_mdiomux_desc *md = platform_get_drvdata(pdev); + + clk_prepare_enable(md->core_clk); + mdio_mux_iproc_config(md); + + return 0; +} +#endif + +static SIMPLE_DEV_PM_OPS(mdio_mux_iproc_pm_ops, + mdio_mux_iproc_suspend, mdio_mux_iproc_resume); + static const struct of_device_id mdio_mux_iproc_match[] = { { .compatible = "brcm,mdio-mux-iproc", @@ -301,6 +327,7 @@ static int mdio_mux_iproc_remove(struct platform_device *pdev) .driver = { .name = "mdio-mux-iproc", .of_match_table = mdio_mux_iproc_match, + .pm = &mdio_mux_iproc_pm_ops, }, .probe = mdio_mux_iproc_probe, .remove = mdio_mux_iproc_remove,