netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean@vger.kernel.org, Wang@vger.kernel.org
To: <john@phrozen.org>, <davem@davemloft.net>
Cc: <nbd@openwrt.org>, <netdev@vger.kernel.org>,
	<linux-mediatek@lists.infradead.org>, <keyhaede@gmail.com>,
	Sean Wang <sean.wang@mediatek.com>
Subject: [PATCH net 06/10] net: ethernet: mediatek: fix the loss of pin-mux setting for GMAC2
Date: Thu, 25 Aug 2016 18:22:33 +0800	[thread overview]
Message-ID: <1472120557-15216-7-git-send-email-sean.wang@mediatek.com> (raw)
In-Reply-To: <1472120557-15216-1-git-send-email-sean.wang@mediatek.com>

From: Sean Wang <sean.wang@mediatek.com>

ommited the setting about pin-mux which results in incorrect signals
being routed on GMAC2.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 14 ++++++++++++++
 drivers/net/ethernet/mediatek/mtk_eth_soc.h |  3 +++
 2 files changed, 17 insertions(+)

diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 5bd31f8..0a4c782 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1415,6 +1415,7 @@ static int __init mtk_hw_init(struct mtk_eth *eth)
 	usleep_range(10, 20);
 	reset_control_deassert(eth->rstc);
 	usleep_range(10, 20);
+	pinctrl_select_state(eth->pins, eth->ephy_default);
 
 	/* Set GE2 driving and slew rate */
 	regmap_write(eth->pctl, GPIO_DRV_SEL10, 0xa00);
@@ -1858,6 +1859,19 @@ static int mtk_probe(struct platform_device *pdev)
 			return -ENODEV;
 	}
 
+	eth->pins = devm_pinctrl_get(&pdev->dev);
+	if (IS_ERR(eth->pins)) {
+		dev_err(&pdev->dev, "cannot get pinctrl\n");
+		return PTR_ERR(eth->pins);
+	}
+
+	eth->ephy_default =
+		pinctrl_lookup_state(eth->pins, "default");
+	if (IS_ERR(eth->ephy_default)) {
+		dev_err(&pdev->dev, "cannot get pinctrl state\n");
+		return PTR_ERR(eth->ephy_default);
+	}
+
 	clk_prepare_enable(eth->clk_ethif);
 	clk_prepare_enable(eth->clk_esw);
 	clk_prepare_enable(eth->clk_gp1);
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
index f82e3ac..13d3f1b 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -404,6 +404,9 @@ struct mtk_eth {
 	struct clk			*clk_esw;
 	struct clk			*clk_gp1;
 	struct clk			*clk_gp2;
+	struct pinctrl			*pins;
+	struct pinctrl_state		*ephy_default;
+
 	struct mii_bus			*mii_bus;
 	struct work_struct		pending_work;
 };
-- 
1.9.1

  parent reply	other threads:[~2016-08-25 10:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-25 10:22 [PATCH net 00/10] net: ethernet: mediatek: a couple of fixes Sean, Wang
2016-08-25 10:22 ` [PATCH net 01/10] net: ethernet: mediatek: fix fails from TX housekeeping due to incorrect port setup Sean, Wang
2016-08-25 10:22 ` [PATCH net 02/10] net: ethernet: mediatek: fix incorrect return value of devm_clk_get with EPROBE_DEFER Sean, Wang
2016-08-25 10:22 ` [PATCH net 03/10] net: ethernet: mediatek: fix API usage with skb_free_frag Sean, Wang
2016-08-25 10:22 ` [PATCH net 04/10] net: ethernet: mediatek: remove redundant free_irq for devm_request_irq allocated irq Sean, Wang
2016-08-25 10:22 ` [PATCH net 05/10] net: ethernet: mediatek: fix logic unbalance between probe and remove Sean, Wang
2016-08-25 10:22 ` Sean, Wang [this message]
2016-08-25 10:22 ` [PATCH net 07/10] net: ethernet: mediatek: fix issue of driver removal with interface is up Sean, Wang
2016-08-25 10:22 ` [PATCH net 08/10] net: ethernet: mediatek: fix the missing of_node_put() after node is used done inside mtk_mdio_init Sean, Wang
2016-08-25 10:22 ` [PATCH net 09/10] net: ethernet: mediatek: use devm_mdiobus_alloc instead of mdiobus_alloc " Sean, Wang
2016-08-25 10:22 ` [PATCH net 10/10] net: ethernet: mediatek: fix error handling " Sean, Wang
     [not found] ` <1472120557-15216-1-git-send-email-sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2016-08-25 16:13   ` [PATCH net 00/10] net: ethernet: mediatek: a couple of fixes David Miller

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=1472120557-15216-7-git-send-email-sean.wang@mediatek.com \
    --to=sean@vger.kernel.org \
    --cc=Wang@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=john@phrozen.org \
    --cc=keyhaede@gmail.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=nbd@openwrt.org \
    --cc=netdev@vger.kernel.org \
    --cc=sean.wang@mediatek.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).