diff options
author | David Bauer <mail@david-bauer.net> | 2019-12-08 21:44:23 +0100 |
---|---|---|
committer | Koen Vandeputte <koen.vandeputte@ncentric.com> | 2020-02-28 17:50:46 +0100 |
commit | 53ab9865c2b91bc6a239b2adee800dc52875b6bc (patch) | |
tree | fc5af7f6c75858c85e24e225d7df831f25deaada /target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c | |
parent | e1e6ff6648f5a0819a5b9429e787c1b6aacfec59 (diff) | |
download | upstream-53ab9865c2b91bc6a239b2adee800dc52875b6bc.tar.gz upstream-53ab9865c2b91bc6a239b2adee800dc52875b6bc.tar.bz2 upstream-53ab9865c2b91bc6a239b2adee800dc52875b6bc.zip |
ath79: add support for kernel 5.4
Signed-off-by: David Bauer <mail@david-bauer.net>
[refreshed]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
* Sync the patches with the changes done for kernel 4.19
* Use KERNEL_TESTING_PATCHVER
* Refresh the configuration
* Fix multiple compile bugs in the patches
* Only add own ag71xx files for kernel 4.19 and use upstream version for
5.4.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c')
-rw-r--r-- | target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c deleted file mode 100644 index ac1af26860..0000000000 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Atheros AR71xx built-in ethernet mac driver - * - * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org> - * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> - * - * Based on Atheros' AG7100 driver - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - */ - -#include <linux/of_mdio.h> -#include "ag71xx.h" - -static void ag71xx_phy_link_adjust(struct net_device *dev) -{ - struct ag71xx *ag = netdev_priv(dev); - struct phy_device *phydev = ag->phy_dev; - unsigned long flags; - int status_change = 0; - - spin_lock_irqsave(&ag->lock, flags); - - if (phydev->link) { - if (ag->duplex != phydev->duplex - || ag->speed != phydev->speed) { - status_change = 1; - } - } - - if (phydev->link != ag->link) - status_change = 1; - - ag->link = phydev->link; - ag->duplex = phydev->duplex; - ag->speed = phydev->speed; - - if (status_change) - ag71xx_link_adjust(ag); - - spin_unlock_irqrestore(&ag->lock, flags); -} - -int ag71xx_phy_connect(struct ag71xx *ag) -{ - struct device_node *np = ag->pdev->dev.of_node; - struct device_node *phy_node; - int ret; - - if (of_phy_is_fixed_link(np)) { - ret = of_phy_register_fixed_link(np); - if (ret < 0) { - dev_err(&ag->pdev->dev, - "Failed to register fixed PHY link: %d\n", ret); - return ret; - } - - phy_node = of_node_get(np); - } else { - phy_node = of_parse_phandle(np, "phy-handle", 0); - } - - if (!phy_node) { - dev_err(&ag->pdev->dev, - "Could not find valid phy node\n"); - return -ENODEV; - } - - ag->phy_dev = of_phy_connect(ag->dev, phy_node, ag71xx_phy_link_adjust, - 0, ag->phy_if_mode); - - of_node_put(phy_node); - - if (!ag->phy_dev) { - dev_err(&ag->pdev->dev, - "Could not connect to PHY device. Deferring probe.\n"); - return -EPROBE_DEFER; - } - - dev_info(&ag->pdev->dev, "connected to PHY at %s [uid=%08x, driver=%s]\n", - phydev_name(ag->phy_dev), - ag->phy_dev->phy_id, ag->phy_dev->drv->name); - - return 0; -} - -void ag71xx_phy_disconnect(struct ag71xx *ag) -{ - phy_disconnect(ag->phy_dev); -} |