mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Calvin Johnson <calvin.johnson@nxp.com>
To: linux.cj@gmail.com, Jon Nettleton <jon@solid-run.com>,
	linux@armlinux.org.uk, Makarand Pawagi <makarand.pawagi@nxp.com>,
	cristian.sovaiala@nxp.com, laurentiu.tudor@nxp.com,
	ioana.ciornei@nxp.com, V.Sethi@nxp.com, pankaj.bansal@nxp.com,
	"Rajesh V . Bikkina" <rajesh.bikkina@nxp.com>
Cc: Calvin Johnson <calvin.johnson@oss.nxp.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v1 5/7] device property: Introduce fwnode_phy_is_fixed_link()
Date: Fri, 31 Jan 2020 21:04:38 +0530	[thread overview]
Message-ID: <20200131153440.20870-6-calvin.johnson@nxp.com> (raw)
In-Reply-To: <20200131153440.20870-1-calvin.johnson@nxp.com>

From: Calvin Johnson <calvin.johnson@oss.nxp.com>

Introduce fwnode_phy_is_fixed_link() function that an Ethernet driver
can call on its PHY phandle to find out whether it's a fixed link PHY
or not.

Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
---

 drivers/base/property.c  | 21 +++++++++++++++++++++
 include/linux/property.h |  1 +
 2 files changed, 22 insertions(+)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index fdb79033d58f..a0f69fae82cd 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -827,6 +827,27 @@ enum dev_dma_attr device_get_dma_attr(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(device_get_dma_attr);
 
+/*
+ * fwnode_phy_is_fixed_link()
+ */
+bool fwnode_phy_is_fixed_link(struct fwnode_handle *fwnode)
+{
+	struct fwnode_handle *fixed_node;
+	int len, err;
+	const char *managed;
+
+	fixed_node = fwnode_get_named_child_node(fwnode, "fixed-link");
+	if (fixed_node)
+		return fixed_node;
+
+	err = fwnode_property_read_string(fixed_node, "managed", &managed);
+	if (err == 0 && strcmp(managed, "auto") != 0)
+		return true;
+
+	return false;
+}
+EXPORT_SYMBOL(fwnode_phy_is_fixed_link);
+
 /**
  * fwnode_get_phy_mode - Get phy mode for given firmware node
  * @fwnode:	Pointer to the given node
diff --git a/include/linux/property.h b/include/linux/property.h
index 1998f502d2ed..ba89fcf091c8 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -333,6 +333,7 @@ int device_get_phy_mode(struct device *dev);
 
 void *device_get_mac_address(struct device *dev, char *addr, int alen);
 
+bool fwnode_phy_is_fixed_link(struct fwnode_handle *fwnode);
 int fwnode_get_phy_mode(struct fwnode_handle *fwnode,
 			phy_interface_t *interface);
 void *fwnode_get_mac_address(struct fwnode_handle *fwnode,
-- 
2.17.1


  parent reply	other threads:[~2020-01-31 15:35 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-31 15:34 [PATCH v1 0/7] ACPI support for xgmac_mdio and dpaa2-mac drivers Calvin Johnson
2020-01-31 15:34 ` [PATCH v1 1/7] mdio_bus: Introduce fwnode MDIO helpers Calvin Johnson
2020-01-31 16:28   ` Andrew Lunn
2020-02-05  7:11     ` [EXT] " Calvin Johnson (OSS)
2020-02-03  9:49   ` kbuild test robot
2020-02-05 14:17   ` Jeremy Linton
2020-02-07  9:42     ` [EXT] " Calvin Johnson (OSS)
2020-03-17 11:36   ` Calvin Johnson
2020-03-17 14:04     ` Andrew Lunn
2020-03-18  6:03       ` Calvin Johnson
2020-01-31 15:34 ` [PATCH v1 2/7] mdio_bus: modify fwnode phy related functions Calvin Johnson
2020-01-31 15:34 ` [PATCH v1 3/7] net/fsl: add ACPI support for mdio bus Calvin Johnson
2020-01-31 16:08   ` Andy Shevchenko
2020-02-04  7:18     ` Calvin Johnson (OSS)
2020-02-04 11:17       ` Andy Shevchenko
2020-02-03  3:44   ` Florian Fainelli
2020-02-04 18:46     ` Calvin Johnson
2020-01-31 15:34 ` [PATCH v1 4/7] device property: fwnode_get_phy_mode: Change API to solve int/unit warnings Calvin Johnson
2020-01-31 15:55   ` Andy Shevchenko
2020-02-03  9:13     ` Calvin Johnson (OSS)
2020-02-03  9:22       ` Andy Shevchenko
2020-02-03  2:32   ` kbuild test robot
2020-02-03  8:41   ` kbuild test robot
2020-01-31 15:34 ` Calvin Johnson [this message]
2020-01-31 15:57   ` [PATCH v1 5/7] device property: Introduce fwnode_phy_is_fixed_link() Andy Shevchenko
2020-02-03  9:21     ` Calvin Johnson (OSS)
2020-01-31 15:34 ` [PATCH v1 6/7] net: phylink: Introduce phylink_fwnode_phy_connect() Calvin Johnson
2020-02-03 18:21   ` kbuild test robot
2020-02-03 18:41   ` Russell King - ARM Linux admin
2020-02-03 18:43     ` Russell King - ARM Linux admin
2020-02-05 11:33     ` [EXT] " Calvin Johnson (OSS)
2020-01-31 15:34 ` [PATCH v1 7/7] dpaa2-eth: Add ACPI support for DPAA2 MAC driver Calvin Johnson
2020-02-03 18:02 ` [PATCH v1 0/7] ACPI support for xgmac_mdio and dpaa2-mac drivers Florian Fainelli
2020-02-05  8:31   ` [EXT] " Calvin Johnson (OSS)

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=20200131153440.20870-6-calvin.johnson@nxp.com \
    --to=calvin.johnson@nxp.com \
    --cc=V.Sethi@nxp.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=calvin.johnson@oss.nxp.com \
    --cc=cristian.sovaiala@nxp.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=jon@solid-run.com \
    --cc=laurentiu.tudor@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux.cj@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=makarand.pawagi@nxp.com \
    --cc=pankaj.bansal@nxp.com \
    --cc=rafael@kernel.org \
    --cc=rajesh.bikkina@nxp.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tglx@linutronix.de \
    /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®