Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1312983

[PATCH 3/4] net: mvneta: mmc: get optional axi clk

From Jisheng Zhang <jszhang@marvell.com>
Newsgroups linux.kernel
Subject [PATCH 3/4] net: mvneta: mmc: get optional axi clk
Date 2016-01-20 09:20 +0100
Message-ID <qSW9I-3JP-13@gated-at.bofh.it> (permalink)
References <qSW9I-3JP-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Some platforms may provide more than one clk for the mvneta IP, for
example Marvell BG4CT provides "core" clk for the mac core, and
"axi" clk for the AXI bus logic. Obviously this "axi" clk also need to
be enabled. This patch adds this optional "axi" clk support.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 drivers/net/ethernet/marvell/mvneta.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index aca0a73..6bb709a 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -373,6 +373,8 @@ struct mvneta_port {
 
 	/* Core clock */
 	struct clk *clk;
+	/* AXI clock */
+	struct clk *clk_axi;
 	u8 mcast_count[256];
 	u16 tx_ring_size;
 	u16 rx_ring_size;
@@ -3615,6 +3617,10 @@ static int mvneta_probe(struct platform_device *pdev)
 
 	clk_prepare_enable(pp->clk);
 
+	pp->clk_axi = devm_clk_get(&pdev->dev, "axi");
+	if (!IS_ERR(pp->clk_axi))
+		clk_prepare_enable(pp->clk_axi);
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	pp->base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(pp->base)) {
@@ -3727,6 +3733,7 @@ err_free_ports:
 	free_percpu(pp->ports);
 err_clk:
 	clk_disable_unprepare(pp->clk);
+	clk_disable_unprepare(pp->clk_axi);
 err_put_phy_node:
 	of_node_put(phy_node);
 err_free_irq:
@@ -3744,6 +3751,7 @@ static int mvneta_remove(struct platform_device *pdev)
 
 	unregister_netdev(dev);
 	clk_disable_unprepare(pp->clk);
+	clk_disable_unprepare(pp->clk_axi);
 	free_percpu(pp->ports);
 	free_percpu(pp->stats);
 	irq_dispose_mapping(dev->irq);
-- 
2.7.0.rc3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] net: mvneta: support more than one clk Jisheng Zhang <jszhang@marvell.com> - 2016-01-20 09:20 +0100
  [PATCH 3/4] net: mvneta: mmc: get optional axi clk Jisheng Zhang <jszhang@marvell.com> - 2016-01-20 09:20 +0100
    Re: [PATCH 3/4] net: mvneta: mmc: get optional axi clk Jisheng Zhang <jszhang@marvell.com> - 2016-01-20 10:00 +0100
    Re: [PATCH 3/4] net: mvneta: mmc: get optional axi clk Thomas Petazzoni <thomas.petazzoni@free-electrons.com> - 2016-01-20 10:00 +0100
    Re: [PATCH 3/4] net: mvneta: mmc: get optional axi clk Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> - 2016-01-20 10:40 +0100
      Re: [PATCH 3/4] net: mvneta: mmc: get optional axi clk Jisheng Zhang <jszhang@marvell.com> - 2016-01-20 10:50 +0100
        Re: [PATCH 3/4] net: mvneta: mmc: get optional axi clk Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> - 2016-01-20 12:10 +0100
          Re: [PATCH 3/4] net: mvneta: mmc: get optional axi clk Jisheng Zhang <jszhang@marvell.com> - 2016-01-20 12:20 +0100
  [PATCH 4/4] net: mvneta: update clocks property and document additional clock-names Jisheng Zhang <jszhang@marvell.com> - 2016-01-20 09:20 +0100
    Re: [PATCH 4/4] net: mvneta: update clocks property and document  additional clock-names Thomas Petazzoni <thomas.petazzoni@free-electrons.com> - 2016-01-20 10:10 +0100
  [PATCH 2/4] net: mvneta: Try to get named core clock first Jisheng Zhang <jszhang@marvell.com> - 2016-01-20 09:20 +0100
    Re: [PATCH 2/4] net: mvneta: Try to get named core clock first Thomas Petazzoni <thomas.petazzoni@free-electrons.com> - 2016-01-20 09:50 +0100

csiph-web