From: Chuanhong Guo Date: Thu, 10 Jan 2019 15:31:35 +0000 (+0800) Subject: generic: ar8216: mdiodev: add qca,phy4-mii-enable option X-Git-Tag: v19.07.0-rc1~954 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ad8db1fa2e9111b22e94fbd149b27dee33291ff8;p=oweals%2Fopenwrt.git generic: ar8216: mdiodev: add qca,phy4-mii-enable option This option allows setting phy4 as a phy connected directly to CPU. Signed-off-by: Chuanhong Guo --- diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index c6e3a05299..f3cafc79a5 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -2574,6 +2574,12 @@ ar8xxx_mdiodev_probe(struct mdio_device *mdiodev) swdev = &priv->dev; swdev->alias = dev_name(&mdiodev->dev); + + if (of_property_read_bool(priv->pdev->of_node, "qca,phy4-mii-enable")) { + priv->port4_phy = true; + swdev->ports--; + } + ret = register_switch(swdev, NULL); if (ret) goto free_priv;