linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arun Parameswaran <arun.parameswaran@broadcom.com>
To: "David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>, Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	bcm-kernel-feedback-list@broadcom.com,
	Arun Parameswaran <arun.parameswaran@broadcom.com>
Subject: [PATCH v2 7/7] net: phy: Add pm support to Broadcom iProc mdio mux driver
Date: Fri, 27 Jul 2018 14:23:33 -0700	[thread overview]
Message-ID: <1532726613-6483-8-git-send-email-arun.parameswaran@broadcom.com> (raw)
In-Reply-To: <1532726613-6483-1-git-send-email-arun.parameswaran@broadcom.com>

Add support for suspend and resume to the Broadcom iProc mdio
mux driver.

Signed-off-by: Arun Parameswaran <arun.parameswaran@broadcom.com>
---
 drivers/net/phy/mdio-mux-bcm-iproc.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/net/phy/mdio-mux-bcm-iproc.c b/drivers/net/phy/mdio-mux-bcm-iproc.c
index 51d1003..d89dce0 100644
--- a/drivers/net/phy/mdio-mux-bcm-iproc.c
+++ b/drivers/net/phy/mdio-mux-bcm-iproc.c
@@ -290,6 +290,33 @@ 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 iproc_mdiomux_desc *md = dev_get_drvdata(dev);
+
+	if (md->core_clk)
+		clk_disable_unprepare(md->core_clk);
+
+	return 0;
+}
+
+static int mdio_mux_iproc_resume(struct device *dev)
+{
+	struct iproc_mdiomux_desc *md = dev_get_drvdata(dev);
+
+	if (md->core_clk)
+		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",
@@ -302,6 +329,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,
-- 
1.9.1


  parent reply	other threads:[~2018-07-27 21:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27 21:23 [PATCH v2 0/7] Add clock config and pm support to bcm iProc mdio mux Arun Parameswaran
2018-07-27 21:23 ` [PATCH v2 1/7] dt-bindings: net: Fix Broadcom iProc mdio mux driver base address Arun Parameswaran
2018-07-28 21:09   ` Andrew Lunn
2018-07-30 22:48   ` Florian Fainelli
2018-07-31 20:47   ` Rob Herring
2018-07-27 21:23 ` [PATCH v2 2/7] net: phy: Fix the register offsets in Broadcom iProc mdio mux driver Arun Parameswaran
2018-07-28 21:10   ` Andrew Lunn
2018-07-30 22:50   ` Florian Fainelli
2018-07-27 21:23 ` [PATCH v2 3/7] arm64: dts: Fix the base address of the Broadcom iProc mdio mux Arun Parameswaran
2018-07-28 21:11   ` Andrew Lunn
2018-07-30 22:50   ` Florian Fainelli
2018-07-27 21:23 ` [PATCH v2 4/7] net: phy: Disable external master access in bcm mdio mux driver Arun Parameswaran
2018-07-28 21:13   ` Andrew Lunn
2018-07-30 22:51   ` Florian Fainelli
2018-07-27 21:23 ` [PATCH v2 5/7] dt-bindings: net: Add clock handle to Broadcom iProc mdio mux Arun Parameswaran
2018-07-28 21:15   ` Andrew Lunn
2018-07-30 22:51   ` Florian Fainelli
2018-07-31 20:48   ` Rob Herring
2018-07-27 21:23 ` [PATCH v2 6/7] net: phy: Add support to configure clock in " Arun Parameswaran
2018-07-28  0:03   ` Andrew Lunn
2018-07-30 16:47     ` Arun Parameswaran
2018-07-28 21:22   ` Andrew Lunn
2018-07-30 16:49     ` Arun Parameswaran
2018-07-30 18:04       ` Andrew Lunn
2018-07-31 17:57   ` Florian Fainelli
2018-07-27 21:23 ` Arun Parameswaran [this message]
2018-07-28 21:27   ` [PATCH v2 7/7] net: phy: Add pm support to Broadcom iProc mdio mux driver Andrew Lunn
2018-07-30 22:53   ` Florian Fainelli
2018-07-31 17:51     ` Arun Parameswaran
2018-07-28 21:32 ` [PATCH v2 0/7] Add clock config and pm support to bcm iProc mdio mux Andrew Lunn
2018-07-30 16:57   ` Arun Parameswaran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1532726613-6483-8-git-send-email-arun.parameswaran@broadcom.com \
    --to=arun.parameswaran@broadcom.com \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).