From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
To: netdev@vger.kernel.org
Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org,
Alexey Brodkin <Alexey.Brodkin@synopsys.com>,
Murali Karicheri <m-karicheri2@ti.com>,
Sekhar Nori <nsekhar@ti.com>,
"David S . Miller" <davem@davemloft.net>,
Grygorii Strashko <grygorii.strashko@ti.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Mugunthan V N <mugunthanvnm@ti.com>, Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH] net: phy: dp83867: Fall-back to default values of clock delay and FIFO depth
Date: Mon, 6 Feb 2017 22:24:45 +0300 [thread overview]
Message-ID: <20170206192445.35829-1-abrodkin@synopsys.com> (raw)
Given there're default values mentioned in the PHY datasheet
fall-back gracefully to them instead of silently return an error
through the whole call-chain.
This allows to use minimalistic description in DT if no special
features are required.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Mugunthan V N <mugunthanvnm@ti.com>
Cc: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/phy/dp83867.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index ca1b462..5d8c5ec 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -135,17 +135,20 @@ static int dp83867_of_init(struct phy_device *phydev)
if (ret &&
(phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID))
- return ret;
+ dp83867->rx_id_delay = DP83867_RGMIIDCTL_2_00_NS;
ret = of_property_read_u32(of_node, "ti,tx-internal-delay",
&dp83867->tx_id_delay);
if (ret &&
(phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID))
- return ret;
+ dp83867->tx_id_delay = DP83867_RGMIIDCTL_2_00_NS;
- return of_property_read_u32(of_node, "ti,fifo-depth",
- &dp83867->fifo_depth);
+ ret = of_property_read_u32(of_node, "ti,fifo-depth", &dp83867->fifo_depth);
+ if (ret)
+ dp83867->fifo_depth = DP83867_PHYCR_FIFO_DEPTH_4_B_NIB;
+
+ return 0;
}
#else
static int dp83867_of_init(struct phy_device *phydev)
--
2.10.2
next reply other threads:[~2017-02-06 19:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-06 19:24 Alexey Brodkin [this message]
2017-02-08 18:15 ` David Miller
2017-02-08 18:20 ` Florian Fainelli
2017-02-09 19:02 ` Alexey Brodkin
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=20170206192445.35829-1-abrodkin@synopsys.com \
--to=alexey.brodkin@synopsys.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=grygorii.strashko@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=m-karicheri2@ti.com \
--cc=mugunthanvnm@ti.com \
--cc=netdev@vger.kernel.org \
--cc=nsekhar@ti.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
all inboxes | Powered by JetHome®