From patchwork Sun Dec 13 15:16:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Kaneko X-Patchwork-Id: 7839261 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 27411BEEE1 for ; Sun, 13 Dec 2015 15:17:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4A74420361 for ; Sun, 13 Dec 2015 15:17:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 791C020351 for ; Sun, 13 Dec 2015 15:17:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751879AbbLMPRD (ORCPT ); Sun, 13 Dec 2015 10:17:03 -0500 Received: from mail-pf0-f172.google.com ([209.85.192.172]:36574 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751973AbbLMPRD (ORCPT ); Sun, 13 Dec 2015 10:17:03 -0500 Received: by pfbu66 with SMTP id u66so47737724pfb.3; Sun, 13 Dec 2015 07:17:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Bqh88KT1ROwM6OzVmlyoknrk41goI4kKJvHa4e1jkZ0=; b=FQGoM9pGeXJLslYCK8QIWDU+8dU9r1T3rS4eP+aFvJmFExtBMmWeGNRDdJpPDWf+Lf vNaCqR32KDo8Cn5vqUqP27z35XTr4dELX/vrKxcWCtowB//2LsWvugsl+YXwYIikG+7V WKce1jndyILQRV0JwdbJqyrm3WI+Bl3ym00ltsgrOArl1SW2MUB2VAk4LOT0QfiUgU0d pqD2hEuQ6mLhWIVCxqZRLisHDU4Zc8BdN6IYtCcE9tRRDPSmCNZeB+9I0y3BD0VaGeo4 UC+RYVZMVIhWTA3Qap1Xmk40WKe9VLw9Vrh658/QidRHzTIHsGmJhj8OjzJIBvMIQ8YW gfbg== X-Received: by 10.98.32.22 with SMTP id g22mr10240860pfg.76.1450019822117; Sun, 13 Dec 2015 07:17:02 -0800 (PST) Received: from localhost.localdomain (KD118152108246.ppp-bb.dion.ne.jp. [118.152.108.246]) by smtp.gmail.com with ESMTPSA id u64sm36739388pfa.89.2015.12.13.07.17.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 13 Dec 2015 07:17:01 -0800 (PST) From: Yoshihiro Kaneko To: netdev@vger.kernel.org Cc: "David S. Miller" , Sergei Shtylyov , Simon Horman , Magnus Damm , linux-sh@vger.kernel.org Subject: [PATCH net-next] ravb: Add fixed-link support Date: Mon, 14 Dec 2015 00:16:50 +0900 Message-Id: <1450019810-324-1-git-send-email-ykaneko0929@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kazuya Mizuguchi This patch adds support of the fixed PHY. This patch is based on commit 87009814cdbb ("ucc_geth: use the new fixed PHY helpers"). Signed-off-by: Kazuya Mizuguchi Signed-off-by: Yoshihiro Kaneko --- This patch is based on the master branch of David Miller's next networking tree. drivers/net/ethernet/renesas/ravb_main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 1cf1226..300acb3 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -880,6 +880,7 @@ static int ravb_phy_init(struct net_device *ndev) struct ravb_private *priv = netdev_priv(ndev); struct phy_device *phydev; struct device_node *pn; + int err; priv->link = 0; priv->speed = 0; @@ -887,6 +888,17 @@ static int ravb_phy_init(struct net_device *ndev) /* Try connecting to PHY */ pn = of_parse_phandle(np, "phy-handle", 0); + if (!pn) { + /* 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(np)) { + err = of_phy_register_fixed_link(np); + if (err) + return err; + } + pn = np; + } phydev = of_phy_connect(ndev, pn, ravb_adjust_link, 0, priv->phy_interface); if (!phydev) {