diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /drivers/net/phy | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/Kconfig | 7 | ||||
-rw-r--r-- | drivers/net/phy/Makefile | 1 | ||||
-rw-r--r-- | drivers/net/phy/at803x.c | 57 | ||||
-rw-r--r-- | drivers/net/phy/marvell.c | 4 | ||||
-rw-r--r-- | drivers/net/phy/mdio-moxart.c | 201 | ||||
-rw-r--r-- | drivers/net/phy/mdio_bus.c | 10 | ||||
-rw-r--r-- | drivers/net/phy/micrel.c | 24 | ||||
-rw-r--r-- | drivers/net/phy/phy_device.c | 4 | ||||
-rw-r--r-- | drivers/net/phy/realtek.c | 15 | ||||
-rw-r--r-- | drivers/net/phy/vitesse.c | 132 |
10 files changed, 18 insertions, 437 deletions
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index 9b5d46c..342561a 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -154,13 +154,6 @@ config MDIO_SUN4I interface units of the Allwinner SoC that have an EMAC (A10, A12, A10s, etc.) -config MDIO_MOXART - tristate "MOXA ART MDIO interface support" - depends on ARCH_MOXART - help - This driver supports the MDIO interface found in the network - interface units of the MOXA ART SoC - config MDIO_BUS_MUX tristate depends on OF_MDIO diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile index 9013dfa..23a2ab2 100644 --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile @@ -31,4 +31,3 @@ obj-$(CONFIG_MDIO_BUS_MUX) += mdio-mux.o obj-$(CONFIG_MDIO_BUS_MUX_GPIO) += mdio-mux-gpio.o obj-$(CONFIG_MDIO_BUS_MUX_MMIOREG) += mdio-mux-mmioreg.o obj-$(CONFIG_MDIO_SUN4I) += mdio-sun4i.o -obj-$(CONFIG_MDIO_MOXART) += mdio-moxart.o diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index bc71947..ac22283 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -100,45 +100,6 @@ static void at803x_get_wol(struct phy_device *phydev, wol->wolopts |= WAKE_MAGIC; } -static int at803x_suspend(struct phy_device *phydev) -{ - int value; - int wol_enabled; - - mutex_lock(&phydev->lock); - - value = phy_read(phydev, AT803X_INTR_ENABLE); - wol_enabled = value & AT803X_WOL_ENABLE; - - value = phy_read(phydev, MII_BMCR); - - if (wol_enabled) - value |= BMCR_ISOLATE; - else - value |= BMCR_PDOWN; - - phy_write(phydev, MII_BMCR, value); - - mutex_unlock(&phydev->lock); - - return 0; -} - -static int at803x_resume(struct phy_device *phydev) -{ - int value; - - mutex_lock(&phydev->lock); - - value = phy_read(phydev, MII_BMCR); - value &= ~(BMCR_PDOWN | BMCR_ISOLATE); - phy_write(phydev, MII_BMCR, value); - - mutex_unlock(&phydev->lock); - - return 0; -} - static int at803x_config_init(struct phy_device *phydev) { int val; @@ -200,12 +161,10 @@ static struct phy_driver at803x_driver[] = { .config_init = at803x_config_init, .set_wol = at803x_set_wol, .get_wol = at803x_get_wol, - .suspend = at803x_suspend, - .resume = at803x_resume, .features = PHY_GBIT_FEATURES, .flags = PHY_HAS_INTERRUPT, - .config_aneg = genphy_config_aneg, - .read_status = genphy_read_status, + .config_aneg = &genphy_config_aneg, + .read_status = &genphy_read_status, .driver = { .owner = THIS_MODULE, }, @@ -217,12 +176,10 @@ static struct phy_driver at803x_driver[] = { .config_init = at803x_config_init, .set_wol = at803x_set_wol, .get_wol = at803x_get_wol, - .suspend = at803x_suspend, - .resume = at803x_resume, .features = PHY_GBIT_FEATURES, .flags = PHY_HAS_INTERRUPT, - .config_aneg = genphy_config_aneg, - .read_status = genphy_read_status, + .config_aneg = &genphy_config_aneg, + .read_status = &genphy_read_status, .driver = { .owner = THIS_MODULE, }, @@ -234,12 +191,10 @@ static struct phy_driver at803x_driver[] = { .config_init = at803x_config_init, .set_wol = at803x_set_wol, .get_wol = at803x_get_wol, - .suspend = at803x_suspend, - .resume = at803x_resume, .features = PHY_GBIT_FEATURES, .flags = PHY_HAS_INTERRUPT, - .config_aneg = genphy_config_aneg, - .read_status = genphy_read_status, + .config_aneg = &genphy_config_aneg, + .read_status = &genphy_read_status, .driver = { .owner = THIS_MODULE, }, diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 2e3c778e..2e91477 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -34,9 +34,9 @@ #include <linux/marvell_phy.h> #include <linux/of.h> -#include <linux/io.h> +#include <asm/io.h> #include <asm/irq.h> -#include <linux/uaccess.h> +#include <asm/uaccess.h> #define MII_MARVELL_PHY_PAGE 22 diff --git a/drivers/net/phy/mdio-moxart.c b/drivers/net/phy/mdio-moxart.c deleted file mode 100644 index a5741cb..0000000 --- a/drivers/net/phy/mdio-moxart.c +++ /dev/null @@ -1,201 +0,0 @@ -/* MOXA ART Ethernet (RTL8201CP) MDIO interface driver - * - * Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com> - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ - -#include <linux/delay.h> -#include <linux/init.h> -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/mutex.h> -#include <linux/of_address.h> -#include <linux/of_mdio.h> -#include <linux/phy.h> -#include <linux/platform_device.h> -#include <linux/regulator/consumer.h> - -#define REG_PHY_CTRL 0 -#define REG_PHY_WRITE_DATA 4 - -/* REG_PHY_CTRL */ -#define MIIWR BIT(27) /* init write sequence (auto cleared)*/ -#define MIIRD BIT(26) -#define REGAD_MASK 0x3e00000 -#define PHYAD_MASK 0x1f0000 -#define MIIRDATA_MASK 0xffff - -/* REG_PHY_WRITE_DATA */ -#define MIIWDATA_MASK 0xffff - -struct moxart_mdio_data { - void __iomem *base; -}; - -static int moxart_mdio_read(struct mii_bus *bus, int mii_id, int regnum) -{ - struct moxart_mdio_data *data = bus->priv; - u32 ctrl = 0; - unsigned int count = 5; - - dev_dbg(&bus->dev, "%s\n", __func__); - - ctrl |= MIIRD | ((mii_id << 16) & PHYAD_MASK) | - ((regnum << 21) & REGAD_MASK); - - writel(ctrl, data->base + REG_PHY_CTRL); - - do { - ctrl = readl(data->base + REG_PHY_CTRL); - - if (!(ctrl & MIIRD)) - return ctrl & MIIRDATA_MASK; - - mdelay(10); - count--; - } while (count > 0); - - dev_dbg(&bus->dev, "%s timed out\n", __func__); - - return -ETIMEDOUT; -} - -static int moxart_mdio_write(struct mii_bus *bus, int mii_id, - int regnum, u16 value) -{ - struct moxart_mdio_data *data = bus->priv; - u32 ctrl = 0; - unsigned int count = 5; - - dev_dbg(&bus->dev, "%s\n", __func__); - - ctrl |= MIIWR | ((mii_id << 16) & PHYAD_MASK) | - ((regnum << 21) & REGAD_MASK); - - value &= MIIWDATA_MASK; - - writel(value, data->base + REG_PHY_WRITE_DATA); - writel(ctrl, data->base + REG_PHY_CTRL); - - do { - ctrl = readl(data->base + REG_PHY_CTRL); - - if (!(ctrl & MIIWR)) - return 0; - - mdelay(10); - count--; - } while (count > 0); - - dev_dbg(&bus->dev, "%s timed out\n", __func__); - - return -ETIMEDOUT; -} - -static int moxart_mdio_reset(struct mii_bus *bus) -{ - int data, i; - - for (i = 0; i < PHY_MAX_ADDR; i++) { - data = moxart_mdio_read(bus, i, MII_BMCR); - if (data < 0) - continue; - - data |= BMCR_RESET; - if (moxart_mdio_write(bus, i, MII_BMCR, data) < 0) - continue; - } - - return 0; -} - -static int moxart_mdio_probe(struct platform_device *pdev) -{ - struct device_node *np = pdev->dev.of_node; - struct mii_bus *bus; - struct moxart_mdio_data *data; - struct resource *res; - int ret, i; - - bus = mdiobus_alloc_size(sizeof(*data)); - if (!bus) - return -ENOMEM; - - bus->name = "MOXA ART Ethernet MII"; - bus->read = &moxart_mdio_read; - bus->write = &moxart_mdio_write; - bus->reset = &moxart_mdio_reset; - snprintf(bus->id, MII_BUS_ID_SIZE, "%s-%d-mii", pdev->name, pdev->id); - bus->parent = &pdev->dev; - - bus->irq = devm_kzalloc(&pdev->dev, sizeof(int) * PHY_MAX_ADDR, - GFP_KERNEL); - if (!bus->irq) { - ret = -ENOMEM; - goto err_out_free_mdiobus; - } - - /* Setting PHY_IGNORE_INTERRUPT here even if it has no effect, - * of_mdiobus_register() sets these PHY_POLL. - * Ideally, the interrupt from MAC controller could be used to - * detect link state changes, not polling, i.e. if there was - * a way phy_driver could set PHY_HAS_INTERRUPT but have that - * interrupt handled in ethernet drivercode. - */ - for (i = 0; i < PHY_MAX_ADDR; i++) - bus->irq[i] = PHY_IGNORE_INTERRUPT; - - data = bus->priv; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - data->base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(data->base)) { - ret = PTR_ERR(data->base); - goto err_out_free_mdiobus; - } - - ret = of_mdiobus_register(bus, np); - if (ret < 0) - goto err_out_free_mdiobus; - - platform_set_drvdata(pdev, bus); - - return 0; - -err_out_free_mdiobus: - mdiobus_free(bus); - return ret; -} - -static int moxart_mdio_remove(struct platform_device *pdev) -{ - struct mii_bus *bus = platform_get_drvdata(pdev); - - mdiobus_unregister(bus); - mdiobus_free(bus); - - return 0; -} - -static const struct of_device_id moxart_mdio_dt_ids[] = { - { .compatible = "moxa,moxart-mdio" }, - { } -}; -MODULE_DEVICE_TABLE(of, moxart_mdio_dt_ids); - -static struct platform_driver moxart_mdio_driver = { - .probe = moxart_mdio_probe, - .remove = moxart_mdio_remove, - .driver = { - .name = "moxart-mdio", - .of_match_table = moxart_mdio_dt_ids, - }, -}; - -module_platform_driver(moxart_mdio_driver); - -MODULE_DESCRIPTION("MOXA ART MDIO interface driver"); -MODULE_AUTHOR("Jonas Jensen <jonas.jensen@gmail.com>"); -MODULE_LICENSE("GPL"); diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 5617876..dc92097 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -438,19 +438,17 @@ phy_id_show(struct device *dev, struct device_attribute *attr, char *buf) return sprintf(buf, "0x%.8lx\n", (unsigned long)phydev->phy_id); } -static DEVICE_ATTR_RO(phy_id); -static struct attribute *mdio_dev_attrs[] = { - &dev_attr_phy_id.attr, - NULL, +static struct device_attribute mdio_dev_attrs[] = { + __ATTR_RO(phy_id), + __ATTR_NULL }; -ATTRIBUTE_GROUPS(mdio_dev); struct bus_type mdio_bus_type = { .name = "mdio_bus", .match = mdio_bus_match, .pm = MDIO_BUS_PM_OPS, - .dev_groups = mdio_dev_groups, + .dev_attrs = mdio_dev_attrs, }; EXPORT_SYMBOL(mdio_bus_type); diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 3ae28f4..c31aad0 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -287,8 +287,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = ks8737_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ8021, @@ -302,8 +300,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ8031, @@ -317,8 +313,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ8041, @@ -332,8 +326,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ8051, @@ -347,8 +339,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ8001, @@ -361,8 +351,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ8081, @@ -375,8 +363,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ8061, @@ -389,8 +375,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ9021, @@ -403,8 +387,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = ksz9021_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE, }, }, { .phy_id = PHY_ID_KSZ9031, @@ -418,8 +400,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = ksz9021_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE, }, }, { .phy_id = PHY_ID_KSZ8873MLL, @@ -430,8 +410,6 @@ static struct phy_driver ksphy_driver[] = { .config_init = kszphy_config_init, .config_aneg = ksz8873mll_config_aneg, .read_status = ksz8873mll_read_status, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE, }, }, { .phy_id = PHY_ID_KSZ886X, @@ -442,8 +420,6 @@ static struct phy_driver ksphy_driver[] = { .config_init = kszphy_config_init, .config_aneg = genphy_config_aneg, .read_status = genphy_read_status, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE, }, } }; diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index d6447b3..74630e9 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -697,7 +697,7 @@ static int genphy_config_advert(struct phy_device *phydev) * to the values in phydev. Assumes that the values are valid. * Please see phy_sanitize_settings(). */ -int genphy_setup_forced(struct phy_device *phydev) +static int genphy_setup_forced(struct phy_device *phydev) { int err; int ctl = 0; @@ -716,7 +716,7 @@ int genphy_setup_forced(struct phy_device *phydev) return err; } -EXPORT_SYMBOL(genphy_setup_forced); + /** * genphy_restart_aneg - Enable and Restart Autonegotiation diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index fa1d69a..138de83 100644 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -64,18 +64,6 @@ static int rtl8211e_config_intr(struct phy_device *phydev) return err; } -/* RTL8201CP */ -static struct phy_driver rtl8201cp_driver = { - .phy_id = 0x00008201, - .name = "RTL8201CP Ethernet", - .phy_id_mask = 0x0000ffff, - .features = PHY_BASIC_FEATURES, - .flags = PHY_HAS_INTERRUPT, - .config_aneg = &genphy_config_aneg, - .read_status = &genphy_read_status, - .driver = { .owner = THIS_MODULE,}, -}; - /* RTL8211B */ static struct phy_driver rtl8211b_driver = { .phy_id = 0x001cc912, @@ -110,9 +98,6 @@ static int __init realtek_init(void) { int ret; - ret = phy_driver_register(&rtl8201cp_driver); - if (ret < 0) - return -ENODEV; ret = phy_driver_register(&rtl8211b_driver); if (ret < 0) return -ENODEV; diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c index 14372c6..69b482b 100644 --- a/drivers/net/phy/vitesse.c +++ b/drivers/net/phy/vitesse.c @@ -3,7 +3,7 @@ * * Author: Kriston Carson * - * Copyright (c) 2005, 2009, 2011 Freescale Semiconductor, Inc. + * Copyright (c) 2005, 2009 Freescale Semiconductor, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -18,11 +18,6 @@ #include <linux/ethtool.h> #include <linux/phy.h> -/* Vitesse Extended Page Magic Register(s) */ -#define MII_VSC82X4_EXT_PAGE_16E 0x10 -#define MII_VSC82X4_EXT_PAGE_17E 0x11 -#define MII_VSC82X4_EXT_PAGE_18E 0x12 - /* Vitesse Extended Control Register 1 */ #define MII_VSC8244_EXT_CON1 0x17 #define MII_VSC8244_EXTCON1_INIT 0x0000 @@ -59,14 +54,7 @@ #define MII_VSC8221_AUXCONSTAT_INIT 0x0004 /* need to set this bit? */ #define MII_VSC8221_AUXCONSTAT_RESERVED 0x0004 -/* Vitesse Extended Page Access Register */ -#define MII_VSC82X4_EXT_PAGE_ACCESS 0x1f - -#define PHY_ID_VSC8234 0x000fc620 #define PHY_ID_VSC8244 0x000fc6c0 -#define PHY_ID_VSC8514 0x00070670 -#define PHY_ID_VSC8574 0x000704a0 -#define PHY_ID_VSC8662 0x00070660 #define PHY_ID_VSC8221 0x000fc550 #define PHY_ID_VSC8211 0x000fc4b0 @@ -130,10 +118,7 @@ static int vsc82xx_config_intr(struct phy_device *phydev) if (phydev->interrupts == PHY_INTERRUPT_ENABLED) err = phy_write(phydev, MII_VSC8244_IMASK, - (phydev->drv->phy_id == PHY_ID_VSC8234 || - phydev->drv->phy_id == PHY_ID_VSC8244 || - phydev->drv->phy_id == PHY_ID_VSC8514 || - phydev->drv->phy_id == PHY_ID_VSC8574) ? + phydev->drv->phy_id == PHY_ID_VSC8244 ? MII_VSC8244_IMASK_MASK : MII_VSC8221_IMASK_MASK); else { @@ -164,126 +149,21 @@ static int vsc8221_config_init(struct phy_device *phydev) */ } -/* vsc82x4_config_autocross_enable - Enable auto MDI/MDI-X for forced links - * @phydev: target phy_device struct - * - * Enable auto MDI/MDI-X when in 10/100 forced link speeds by writing - * special values in the VSC8234/VSC8244 extended reserved registers - */ -static int vsc82x4_config_autocross_enable(struct phy_device *phydev) -{ - int ret; - - if (phydev->autoneg == AUTONEG_ENABLE || phydev->speed > SPEED_100) - return 0; - - /* map extended registers set 0x10 - 0x1e */ - ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x52b5); - if (ret >= 0) - ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_18E, 0x0012); - if (ret >= 0) - ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_17E, 0x2803); - if (ret >= 0) - ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_16E, 0x87fa); - /* map standard registers set 0x10 - 0x1e */ - if (ret >= 0) - ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x0000); - else - phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x0000); - - return ret; -} - -/* vsc82x4_config_aneg - restart auto-negotiation or write BMCR - * @phydev: target phy_device struct - * - * Description: If auto-negotiation is enabled, we configure the - * advertising, and then restart auto-negotiation. If it is not - * enabled, then we write the BMCR and also start the auto - * MDI/MDI-X feature - */ -static int vsc82x4_config_aneg(struct phy_device *phydev) -{ - int ret; - - /* Enable auto MDI/MDI-X when in 10/100 forced link speeds by - * writing special values in the VSC8234 extended reserved registers - */ - if (phydev->autoneg != AUTONEG_ENABLE && phydev->speed <= SPEED_100) { - ret = genphy_setup_forced(phydev); - - if (ret < 0) /* error */ - return ret; - - return vsc82x4_config_autocross_enable(phydev); - } - - return genphy_config_aneg(phydev); -} - -/* Vitesse 82xx */ +/* Vitesse 824x */ static struct phy_driver vsc82xx_driver[] = { { - .phy_id = PHY_ID_VSC8234, - .name = "Vitesse VSC8234", - .phy_id_mask = 0x000ffff0, - .features = PHY_GBIT_FEATURES, - .flags = PHY_HAS_INTERRUPT, - .config_init = &vsc824x_config_init, - .config_aneg = &vsc82x4_config_aneg, - .read_status = &genphy_read_status, - .ack_interrupt = &vsc824x_ack_interrupt, - .config_intr = &vsc82xx_config_intr, - .driver = { .owner = THIS_MODULE,}, -}, { .phy_id = PHY_ID_VSC8244, .name = "Vitesse VSC8244", .phy_id_mask = 0x000fffc0, .features = PHY_GBIT_FEATURES, .flags = PHY_HAS_INTERRUPT, .config_init = &vsc824x_config_init, - .config_aneg = &vsc82x4_config_aneg, - .read_status = &genphy_read_status, - .ack_interrupt = &vsc824x_ack_interrupt, - .config_intr = &vsc82xx_config_intr, - .driver = { .owner = THIS_MODULE,}, -}, { - .phy_id = PHY_ID_VSC8514, - .name = "Vitesse VSC8514", - .phy_id_mask = 0x000ffff0, - .features = PHY_GBIT_FEATURES, - .flags = PHY_HAS_INTERRUPT, - .config_init = &vsc824x_config_init, - .config_aneg = &vsc82x4_config_aneg, + .config_aneg = &genphy_config_aneg, .read_status = &genphy_read_status, .ack_interrupt = &vsc824x_ack_interrupt, .config_intr = &vsc82xx_config_intr, .driver = { .owner = THIS_MODULE,}, }, { - .phy_id = PHY_ID_VSC8574, - .name = "Vitesse VSC8574", - .phy_id_mask = 0x000ffff0, - .features = PHY_GBIT_FEATURES, - .flags = PHY_HAS_INTERRUPT, - .config_init = &vsc824x_config_init, - .config_aneg = &vsc82x4_config_aneg, - .read_status = &genphy_read_status, - .ack_interrupt = &vsc824x_ack_interrupt, - .config_intr = &vsc82xx_config_intr, - .driver = { .owner = THIS_MODULE,}, -}, { - .phy_id = PHY_ID_VSC8662, - .name = "Vitesse VSC8662", - .phy_id_mask = 0x000ffff0, - .features = PHY_GBIT_FEATURES, - .flags = PHY_HAS_INTERRUPT, - .config_init = &vsc824x_config_init, - .config_aneg = &vsc82x4_config_aneg, - .read_status = &genphy_read_status, - .ack_interrupt = &vsc824x_ack_interrupt, - .config_intr = &vsc82xx_config_intr, - .driver = { .owner = THIS_MODULE,}, -}, { /* Vitesse 8221 */ .phy_id = PHY_ID_VSC8221, .phy_id_mask = 0x000ffff0, @@ -327,11 +207,7 @@ module_init(vsc82xx_init); module_exit(vsc82xx_exit); static struct mdio_device_id __maybe_unused vitesse_tbl[] = { - { PHY_ID_VSC8234, 0x000ffff0 }, { PHY_ID_VSC8244, 0x000fffc0 }, - { PHY_ID_VSC8514, 0x000ffff0 }, - { PHY_ID_VSC8574, 0x000ffff0 }, - { PHY_ID_VSC8662, 0x000ffff0 }, { PHY_ID_VSC8221, 0x000ffff0 }, { PHY_ID_VSC8211, 0x000ffff0 }, { } |