From patchwork Mon Feb 6 19:24:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 724654 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vHHVp6HH3z9s1y for ; Tue, 7 Feb 2017 06:25:22 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1caouf-0003cr-FW; Mon, 06 Feb 2017 19:25:21 +0000 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1caouX-00029Y-LY for linux-snps-arc@lists.infradead.org; Mon, 06 Feb 2017 19:25:19 +0000 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 7374A24E0F41; Mon, 6 Feb 2017 11:24:53 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 4FF5CAA0; Mon, 6 Feb 2017 11:24:53 -0800 (PST) Received: from ru20arcgnu1.internal.synopsys.com (ru20arcgnu1.internal.synopsys.com [10.121.9.48]) by mailhost.synopsys.com (Postfix) with ESMTP id A7415A49; Mon, 6 Feb 2017 11:24:50 -0800 (PST) From: Alexey Brodkin To: netdev@vger.kernel.org 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 Message-Id: <20170206192445.35829-1-abrodkin@synopsys.com> X-Mailer: git-send-email 2.10.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170206_112513_797463_D5FA7A06 X-CRM114-Status: UNSURE ( 7.25 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.47.9 listed in list.dnswl.org] -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mugunthan V N , Grygorii Strashko , Andrew Lunn , Alexey Brodkin , Sekhar Nori , linux-kernel@vger.kernel.org, Murali Karicheri , Florian Fainelli , linux-snps-arc@lists.infradead.org, "David S . Miller" MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 Cc: Murali Karicheri Cc: Sekhar Nori Cc: David S. Miller Cc: Grygorii Strashko Cc: Florian Fainelli Cc: Mugunthan V N Cc: Andrew Lunn --- 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)