From patchwork Tue May 20 00:56:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 350455 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 193D114008B for ; Tue, 20 May 2014 11:00:22 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 0719B1A0907 for ; Tue, 20 May 2014 11:00:22 +1000 (EST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-yh0-x232.google.com (mail-yh0-x232.google.com [IPv6:2607:f8b0:4002:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 34A911A08D1 for ; Tue, 20 May 2014 10:57:18 +1000 (EST) Received: by mail-yh0-f50.google.com with SMTP id 29so7639122yhl.9 for ; Mon, 19 May 2014 17:57:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=goZxJZCW4JJA3X0K/lZ9QqnTlXyBd2Htx2i7CMsNDHc=; b=gm/3l3nSvl++740e9TzYwvvmHC+dlBTxHb234Qh/eOrSwl0qb6716BG+k1YmQ9wW9D vCZtyhfwTs/XhPTnul4odw9ZjhTiKnGXhSiOFIF9I6evFF35Sso6XUusnwYc8jEnUxwe Ls2Azwy/kPFDimnH+ESwHocNYx4eeHxBVM/GF71L8pKXnMw1hHcgK+Q2VP2QDswfDTmM ylyvYV/L+yjNNGyxNhAiIs1FlO+qgiNqMV2QWWp2sqwUj0mDIml18UIMNJ9RgWies+W8 f081ARZLn2uDkrGhoFTDJ5sCf9vvheuBMdwQau5GVD6800isi9/zhVVtG/G/OjKSMq3R /BjQ== X-Received: by 10.236.172.170 with SMTP id t30mr9726704yhl.136.1400547435447; Mon, 19 May 2014 17:57:15 -0700 (PDT) Received: from fainelli-desktop.broadcom.com (5520-maca-inet1-outside.broadcom.com. [216.31.211.11]) by mx.google.com with ESMTPSA id f2sm27506075yhc.41.2014.05.19.17.57.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 May 2014 17:57:14 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Subject: [PATCH net-next 4/9] net: systemport: use the new fixed PHY helpers Date: Mon, 19 May 2014 17:56:19 -0700 Message-Id: <1400547384-11363-5-git-send-email-f.fainelli@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400547384-11363-1-git-send-email-f.fainelli@gmail.com> References: <1400547384-11363-1-git-send-email-f.fainelli@gmail.com> Cc: Mark Rutland , "open list:DOCUMENTATION" , Paul Mackerras , Florian Fainelli , Claudiu Manoil , Grant Likely , "open list:OPEN FIRMWARE AND..." , Pawel Moll , Ian Campbell , Richard Cochran , Rob Herring , Aida Mynzhasova , Thomas Petazzoni , Sergei Shtylyov , Randy Dunlap , open list , davem@davemlof.net, Vitaly Bordug , Kumar Gala , "open list:LINUX FOR POWERPC..." , "David S. Miller" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli --- drivers/net/ethernet/broadcom/bcmsysport.c | 17 +++++++++++++++-- drivers/net/ethernet/broadcom/bcmsysport.h | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index d40c5b969e9e..dc708a888f80 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c @@ -1327,8 +1327,8 @@ static int bcm_sysport_open(struct net_device *dev) /* Read CRC forward */ priv->crc_fwd = !!(umac_readl(priv, UMAC_CMD) & CMD_CRC_FWD); - priv->phydev = of_phy_connect_fixed_link(dev, bcm_sysport_adj_link, - priv->phy_interface); + priv->phydev = of_phy_connect(dev, priv->phy_dn, bcm_sysport_adj_link, + 0, priv->phy_interface); if (!priv->phydev) { netdev_err(dev, "could not attach to PHY\n"); return -ENODEV; @@ -1551,6 +1551,19 @@ static int bcm_sysport_probe(struct platform_device *pdev) if (priv->phy_interface < 0) priv->phy_interface = PHY_INTERFACE_MODE_GMII; + /* In the case of a fixed PHY, the DT node associated + * to the PHY is the Ethernet MAC DT node. + */ + if (of_phy_is_fixed_link(dn)) { + ret = of_phy_register_fixed_link(dn); + if (ret) { + dev_err(&pdev->dev, "failed to register fixed PHY\n"); + goto err; + } + + priv->phy_dn = dn; + } + /* Initialize netdevice members */ macaddr = of_get_mac_address(dn); if (!macaddr || !is_valid_ether_addr(macaddr)) { diff --git a/drivers/net/ethernet/broadcom/bcmsysport.h b/drivers/net/ethernet/broadcom/bcmsysport.h index abdeb62616df..73fd04a94797 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.h +++ b/drivers/net/ethernet/broadcom/bcmsysport.h @@ -656,6 +656,7 @@ struct bcm_sysport_priv { unsigned int rx_c_index; /* PHY device */ + struct device_node *phy_dn; struct phy_device *phydev; phy_interface_t phy_interface; int old_pause;