of: make of_get_phy_mode parse 'phy-connection-type'
Per the ePAPR v1.1 specification, 'phy-connection-type' is the canonical property name for describing an Ethernet to PHY connection type. Make sure that of_get_phy_mode() also attempts to parse that property and update the comments mentioning 'phy-mode' to also include 'phy-connection-type'. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
This commit is contained in:
parent
f5fab57dc9
commit
cf4c9eb5a4
1 changed files with 7 additions and 4 deletions
|
@ -13,8 +13,8 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It maps 'enum phy_interface_t' found in include/linux/phy.h
|
* It maps 'enum phy_interface_t' found in include/linux/phy.h
|
||||||
* into the device tree binding of 'phy-mode', so that Ethernet
|
* into the device tree binding of 'phy-mode' or 'phy-connection-type',
|
||||||
* device driver can get phy interface from device tree.
|
* so that Ethernet device driver can get phy interface from device tree.
|
||||||
*/
|
*/
|
||||||
static const char *phy_modes[] = {
|
static const char *phy_modes[] = {
|
||||||
[PHY_INTERFACE_MODE_NA] = "",
|
[PHY_INTERFACE_MODE_NA] = "",
|
||||||
|
@ -37,8 +37,9 @@ static const char *phy_modes[] = {
|
||||||
* of_get_phy_mode - Get phy mode for given device_node
|
* of_get_phy_mode - Get phy mode for given device_node
|
||||||
* @np: Pointer to the given device_node
|
* @np: Pointer to the given device_node
|
||||||
*
|
*
|
||||||
* The function gets phy interface string from property 'phy-mode',
|
* The function gets phy interface string from property 'phy-mode' or
|
||||||
* and return its index in phy_modes table, or errno in error case.
|
* 'phy-connection-type', and return its index in phy_modes table, or errno in
|
||||||
|
* error case.
|
||||||
*/
|
*/
|
||||||
int of_get_phy_mode(struct device_node *np)
|
int of_get_phy_mode(struct device_node *np)
|
||||||
{
|
{
|
||||||
|
@ -46,6 +47,8 @@ int of_get_phy_mode(struct device_node *np)
|
||||||
int err, i;
|
int err, i;
|
||||||
|
|
||||||
err = of_property_read_string(np, "phy-mode", &pm);
|
err = of_property_read_string(np, "phy-mode", &pm);
|
||||||
|
if (err < 0)
|
||||||
|
err = of_property_read_string(np, "phy-connection-type", &pm);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue