summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy_device.c
diff options
context:
space:
mode:
authorSascha Hauer2014-05-21 15:29:44 +0200
committerDavid S. Miller2014-05-22 21:43:02 +0200
commitc242a47238fa2a6a54af8a16e62b54e6e031d4bc (patch)
tree5ac5dadf274ad245349b5c49b6aa13fbb7a91e7b /drivers/net/phy/phy_device.c
parentMerge tag 'linux-can-next-for-3.16-20140521' of git://gitorious.org/linux-can... (diff)
downloadkernel-qcow2-linux-c242a47238fa2a6a54af8a16e62b54e6e031d4bc.tar.gz
kernel-qcow2-linux-c242a47238fa2a6a54af8a16e62b54e6e031d4bc.tar.xz
kernel-qcow2-linux-c242a47238fa2a6a54af8a16e62b54e6e031d4bc.zip
net: phy: genphy: Allow overwriting features
of_set_phy_supported allows overwiting hardware capabilities of a phy with values from the devicetree. This does not work with the genphy driver though because the genphys config_init function will overwrite all values adjusted by of_set_phy_supported. Fix this by initialising the genphy features in the phy_driver struct and in config_init just limit the features to the ones the hardware can actually support. The resulting features are a subset of the devicetree specified features and the hardware features. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r--drivers/net/phy/phy_device.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 466ae3e06322..fc569eae7215 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1072,9 +1072,6 @@ int genphy_config_init(struct phy_device *phydev)
int val;
u32 features;
- /* For now, I'll claim that the generic driver supports
- * all possible port types
- */
features = (SUPPORTED_TP | SUPPORTED_MII
| SUPPORTED_AUI | SUPPORTED_FIBRE |
SUPPORTED_BNC);
@@ -1107,8 +1104,8 @@ int genphy_config_init(struct phy_device *phydev)
features |= SUPPORTED_1000baseT_Half;
}
- phydev->supported = features;
- phydev->advertising = features;
+ phydev->supported &= features;
+ phydev->advertising &= features;
return 0;
}
@@ -1296,7 +1293,9 @@ static struct phy_driver genphy_driver[] = {
.name = "Generic PHY",
.soft_reset = genphy_soft_reset,
.config_init = genphy_config_init,
- .features = 0,
+ .features = PHY_GBIT_FEATURES | SUPPORTED_MII |
+ SUPPORTED_AUI | SUPPORTED_FIBRE |
+ SUPPORTED_BNC,
.config_aneg = genphy_config_aneg,
.aneg_done = genphy_aneg_done,
.read_status = genphy_read_status,