netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: "David S . Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Niklas Cassel <niklas.cassel@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Vinod Koul <vkoul@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH 5/7] net: phy: at803x: Rework at803x_config_init()
Date: Wed,  2 Jan 2019 14:47:27 +0530	[thread overview]
Message-ID: <20190102091729.18582-6-vkoul@kernel.org> (raw)
In-Reply-To: <20190102091729.18582-1-vkoul@kernel.org>

Rework at803x_config_init() function to check and program the tx and rx
delay enable separately. This will help in checking the delay to be
programmed based on other conditions as well.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 drivers/net/phy/at803x.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index e74a047a846e..63e3d3d774d1 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -249,6 +249,7 @@ static int at803x_probe(struct phy_device *phydev)
 
 static int at803x_config_init(struct phy_device *phydev)
 {
+	bool rx_delay = false, tx_delay = false;
 	int ret;
 
 	ret = genphy_config_init(phydev);
@@ -256,14 +257,19 @@ static int at803x_config_init(struct phy_device *phydev)
 		return ret;
 
 	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID ||
-			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
+			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
+		rx_delay = true;
+	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
+			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
+		tx_delay = true;
+
+	if (rx_delay) {
 		ret = at803x_enable_rx_delay(phydev);
 		if (ret < 0)
 			return ret;
 	}
 
-	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
-			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
+	if (tx_delay) {
 		ret = at803x_enable_tx_delay(phydev);
 		if (ret < 0)
 			return ret;
-- 
2.20.1

  parent reply	other threads:[~2019-01-02  9:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-02  9:17 [PATCH 0/7] net: Add support for Qualcomm ethqos Vinod Koul
2019-01-02  9:17 ` [PATCH 1/7] dt-bindings: net: Add Qualcomm ethqos binding Vinod Koul
2019-01-02 14:07   ` Andrew Lunn
2019-01-02 14:37     ` Vinod Koul
2019-01-02  9:17 ` [PATCH 2/7] net: stmmac: Add driver for Qualcomm ethqos Vinod Koul
2019-01-02  9:17 ` [PATCH 3/7] dt-bindings: net: stmmac: Add the bindings documentation for delays Vinod Koul
2019-01-11 15:01   ` Rob Herring
2019-01-14 15:26     ` Vinod Koul
2019-01-14 23:34     ` Florian Fainelli
2019-01-02  9:17 ` [PATCH 4/7] MAINTAINER: Add entry for Qualcomm ETHQOS ethernet driver Vinod Koul
2019-01-02  9:48   ` Sergei Shtylyov
2019-01-02 10:15     ` Vinod Koul
2019-01-02  9:17 ` Vinod Koul [this message]
2019-01-02  9:17 ` [PATCH 6/7] net: phy: at803x: Add support to disable tx/rx delays Vinod Koul
2019-01-02 13:40   ` Andrew Lunn
2019-01-02 14:36     ` Vinod Koul
2019-01-02  9:17 ` [PATCH 7/7] net: dsa: qca8k: handle disable tx/rx delay Vinod Koul

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=20190102091729.18582-6-vkoul@kernel.org \
    --to=vkoul@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=bjorn.andersson@linaro.org \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=niklas.cassel@linaro.org \
    /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).