summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
Commit message (Collapse)AuthorAgeFilesLines
* phy: marvell: Fix 88E1510 initializationClemens Gruber2016-02-251-35/+35
| | | | | | | | | | | | | | A bug was introduced in the merge commit b633353115e3 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net") The generic marvell_config_init (and therefore marvell_of_reg_init) is not called anymore for the Marvell 88E1510 (in net-next). This patch calls marvell_config_init and moves the specific init function for the 88E1510 below the marvell_config_init function to avoid adding a function predeclaration. Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2016-02-233-40/+15
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/net/phy/bcm7xxx.c drivers/net/phy/marvell.c drivers/net/vxlan.c All three conflicts were cases of simple overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
| * phy: marvell: Fix and unify reg-init behaviorClemens Gruber2016-02-171-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the Marvell 88E1510, marvell_of_reg_init was called too late, in the config_aneg function. Since commit 113c74d83eef ("net: phy: turn carrier off on phy attach"), this lead to the link not coming up at boot anymore, due to the phy state machine being stuck at waiting for interrupts (off by default on the 88E1510). For seven other Marvell PHYs, marvell_of_reg_init was not called at all. Add a generic marvell_config_init function, which in turn calls marvell_of_reg_init. PHYs, which already have a specific config_init function with a call to marvell_of_reg_init, are left untouched. The generic marvell_config_init function is called for all the others, to get consistent behavior across all Marvell PHYs. Fixes: 113c74d83eef ("net: phy: turn carrier off on phy attach") Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * phy: keep pause flags in phy driver featuresWoojung.Huh@microchip.com2016-02-171-1/+1
| | | | | | | | | | | | | | | | | | genphy_config_init() masked out pause flags set in phy driver structure. Pause flags needs to be preserved in phydev->supported & phydev->advertising. Signed-off-by: Woojung Huh <woojung.huh@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: phy: bcm7xxx: Remove wildcard entriesFlorian Fainelli2016-02-161-31/+0
| | | | | | | | | | | | | | | | | | | | | | Remove the two wildcard entries, they serve no purpose and will match way too many devices, some of them being covered by the driver in drivers/net/phy/broadcom.c. Remove the now unused bcm7xxx_dummy_config_init() function which would produce a warning. Fixes: b560a58c45c6 ("net: phy: add Broadcom BCM7xxx internal PHY driver") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: phy: bcm7xxx: Fix bcm7xxx_config_init() checkFlorian Fainelli2016-02-161-4/+0
| | | | | | | | | | | | | | | | | | | | | | Since we were wrongly advertising gigabit features for these 10/100 only Ethernet PHYs, bcm7xxx_config_init() which is supposed to apply workaround would have not run since the check would be true, now that we have fixed the PHY features, remove that check since it has no reasoning to be there anymore. Fixes: e18556ee3bd83 ("net: phy: bcm7xxx: do not use PHY_BRCM_100MBPS_WAR") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: phy: bcm7xxx: Fix 40nm EPHY featuresFlorian Fainelli2016-02-161-3/+3
| | | | | | | | | | | | | | | | | | | | The PHY entries for BCM7425/29/35 declare the 40nm Ethernet PHY as being 10/100/1000 capable, while this is just a 10/100 capable PHY device, fix that. Fixes: d068b02cfdfc2 ("net: phy: add BCM7425 and BCM7429 PHYs") Fixes: 9458ceab4917 ("net: phy: bcm7xxx: Add entry for BCM7435") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: phy: bcm7xxx: Fix shadow mode 2 disablingFlorian Fainelli2016-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | The clear and set masks in the call to phy_set_clr_bits() called from bcm7xxx_config_init() are inverted. We need to fix this by swapping the two arguments, that is, set 0 bits, but clear the shade mode 2 enable bit. Fixes: b560a58c45c66 ("net: phy: add Broadcom BCM7xxx internal PHY driver") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | phy: marvell/micrel: Fix Unpossible conditionAndrew Lunn2016-02-192-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 2b2427d06426 ("phy: micrel: Add ethtool statistics counters") from Dec 30, 2015, leads to the following static checker warning: drivers/net/phy/micrel.c:609 kszphy_get_stat() warn: unsigned 'val' is never less than zero. drivers/net/phy/micrel.c 602 static u64 kszphy_get_stat(struct phy_device *phydev, int i) 603 { 604 struct kszphy_hw_stat stat = kszphy_hw_stats[i]; 605 struct kszphy_priv *priv = phydev->priv; 606 u64 val; 607 608 val = phy_read(phydev, stat.reg); 609 if (val < 0) { ^^^^^^^ Unpossible! 610 val = UINT64_MAX; 611 } else { 612 val = val & ((1 << stat.bits) - 1); 613 priv->stats[i] += val; 614 val = priv->stats[i]; 615 } 616 617 return val; 618 } The same problem exists in the Marvell driver. Fix both. Fixes: 2b2427d06426 ("phy: micrel: Add ethtool statistics counters") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reported-by: Julia.Lawall <julia.lawall@lip6.fr> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: dp83848: Fix sysfs naming collision warningAndrew F. Davis2016-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | Files in sysfs are created using the name from the phy_driver struct, when two names are the same we may get a duplicate filename warning, fix this. Reported-by: kernel test robot <ying.huang@linux.intel.com> Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: Add SGMII support for Marvell 88E1510/1512/1514/1518Stefan Roese2016-02-181-0/+41
| | | | | | | | | | | | | | | | | | | | Add code to select SGMII-to-copper mode upon SGMII interface selection. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Andrew Lunn <andrew@lunn.ch> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: spi_ks8995: include linux/gpio/consumer.hArnd Bergmann2016-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ks8995 phy driver just started using gpiod_* functions, which are declared in linux/gpio/consumer.h, not linux/gpio.h, resulting in a build failure in randconfig builds that do not have CONFIG_GPIOLIB enabled: drivers/net/phy/spi_ks8995.c: In function 'ks8995_probe': drivers/net/phy/spi_ks8995.c:477:3: error: implicit declaration of function 'gpiod_set_value' [-Werror=implicit-function-declaration] This changes the header inclusion so it builds in all configurations. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: cd6f288cbaab ("net: phy: spi_ks8995: add support for resetting switch using GPIO") Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: bcm7xxx: Reduce boilerplate code for 40nm EPHYFlorian Fainelli2016-02-161-36/+18
| | | | | | | | | | | | | | | | Introduce a macro which helps adding new 40NM EPHY entries and reduces the amount of boilerplate code. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: bcm7xxx: Make MII_BCM7XX_64CLK_MDIO naming consistentFlorian Fainelli2016-02-161-2/+2
| | | | | | | | | | | | | | | | The driver is BCM7xxx, we were missing an additional X in the constant naming, fix that to be consistent. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: dp83848: Add comments for register definitionsAndrew F. Davis2016-02-111-2/+2
| | | | | | | | | | Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: dp83848: Add support for TI TLK10x Ethernet PHYsAndrew F. Davis2016-02-111-0/+3
| | | | | | | | | | | | | | | | | | The TI TLK10x Ethernet PHYs are similar in the interrupt relevant registers and so are compatible with the DP83848x devices already supported. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: dp83848: Reorganize code for readability and safetyAndrew F. Davis2016-02-111-13/+20
| | | | | | | | | | | | | | | | | | Reorganize code by moving the desired interrupt mask definition out of function. Also rearrange the enable/disable interrupt function to prevent accidental over-writing of values in registers. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: dp83848: Add PHY ID for TI version of DP83848CAndrew F. Davis2016-02-111-3/+6
| | | | | | | | | | | | | | | | | | After acquiring National Semiconductor, TI appears to have changed the Vendor Model Number for the DP83848C PHYs, add this new ID to supported IDs. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: dp83848: Add macro for dp83848 compatible devicesAndrew F. Davis2016-02-111-19/+22
| | | | | | | | | | | | | | | | Add a helper macro for defining dp83848 compatible phy devices. Update copyright info. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: spi_ks8995: add support for MICREL KSZ8795CLXHelmut Buchsbaum2016-02-111-0/+29
| | | | | | | | | | | | | | | | Add support for MICREL KSZ8795CLX Integrated 5-Port, 10-/100-Managed Ethernet Switch with Gigabit GMII/RGMII and MII/RMII interfaces. Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: spi_ks8995: generalize creation of SPI commandsHelmut Buchsbaum2016-02-111-11/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | Prepare creating SPI reads and writes for other switch families. The KS8995 family uses the straight forward <8bit CMD><8bit ADDR> sequence. To be able to support KSZ8795 family, which uses <3bit CMD><12bit ADDR><1 bit TR> make the SPI command creation chip variant dependent. Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: spi_ks8995: add support for resetting switch using GPIOHelmut Buchsbaum2016-02-111-9/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When using device tree it is no more possible to reset the PHY at board level. Furthermore, doing in the driver allows to power down the switch when it is not used any more. The patch introduces a new optional property "reset-gpios" denoting an appropriate GPIO handle, e.g.: reset-gpios = <&gpio0 46 GPIO_ACTIVE_LOW> Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: spi_ks8995: verify chip and determine revisionHelmut Buchsbaum2016-02-111-38/+80
| | | | | | | | | | | | | | | | Since the chip variant is now determined by spi_device_id, verify family and chip id and determine the revision id. Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: spi_ks8995: introduce spi_device_id tableHelmut Buchsbaum2016-02-111-2/+40
|/ | | | | | | | Refactor to use spi_device_id table to facilitate easy extendability. Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: Fix dependencies for !HAS_IOMEM archsRichard Weinberger2016-01-281-0/+1
| | | | | | | | Not every arch has io memory. So, unbreak the build by fixing the dependencies. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: phy: smsc: Fix disabling energy detect modeTeresa Remmet2016-01-211-10/+44
| | | | | | | | | | | When the lan87xx_read_status function is getting called the energy detect mode is enabled again even if it has been disabled by device tree. Added private struct to check the energy detect status. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: phy: Fix phy_mac_interrupt()Florian Fainelli2016-01-211-13/+18
| | | | | | | | | | | | | | | | | | | | | Commit 5ea94e7686a3 ("phy: add phy_mac_interrupt()") to use with PHY_IGNORE_INTERRUPT added a cancel_work_sync() into phy_mac_interrupt() which is allowed to sleep, whereas phy_mac_interrupt() is expected to be callable from interrupt context. Now that we have fixed how the PHY state machine treats PHY_IGNORE_INTERRUPT with respect to state changes, we can just set the new link state, and queue the PHY state machine for execution so it is going to read the new link state. For that to work properly, we need to update phy_change() not to try to invoke any interrupt callbacks if we have configured the PHY device for PHY_IGNORE_INTERRUPT, because that PHY device and its driver are not required to implement those. Fixes: 5ea94e7686a3 ("phy: add phy_mac_interrupt() to use with PHY_IGNORE_INTERRUPT") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: phy: Avoid polling PHY with PHY_IGNORE_INTERRUPTSFlorian Fainelli2016-01-211-5/+10
| | | | | | | | | | | | | | | | Commit 2c7b49212a86 ("phy: fix the use of PHY_IGNORE_INTERRUPT") changed a hunk in phy_state_machine() in the PHY_RUNNING case which was not needed. The change essentially makes the PHY library treat PHY devices with PHY_IGNORE_INTERRUPT to keep polling for the PHY device, even though the intent is not to do it. Fix this by reverting that specific hunk, which makes the PHY state machine wait for state changes, and stay in the PHY_RUNNING state for as long as needed. Fixes: 2c7b49212a86 ("phy: fix the use of PHY_IGNORE_INTERRUPT") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dp83640: Fix tx timestamp overflow handling.Manfred Rudigier2016-01-201-0/+17
| | | | | | | | | | | | | | | | | PHY status frames are not reliable, the PHY may not be able to send them during heavy receive traffic. This overflow condition is signaled by the PHY in the next status frame, but the driver did not make use of it. Instead it always reported wrong tx timestamps to user space after an overflow happened because it assigned newly received tx timestamps to old packets in the queue. This commit fixes this issue by clearing the tx timestamp queue every time an overflow happens, so that no timestamps are delivered for overflow packets. This way time stamping will continue correctly after an overflow. Signed-off-by: Manfred Rudigier <manfred.rudigier@omicron.at> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: phy: at803x: Add the interrupt register bit definitionsMartin Blumenstingl2016-01-171-9/+23
| | | | | | | Also use them instead of a magic value when enabling the interrupts. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: phy: at803x: Clean up duplicate register definitionsMartin Blumenstingl2016-01-171-8/+11
| | | | | Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: phy: at803x: Allow specifying the RGMII RX clock delay via phy modeMartin Blumenstingl2016-01-171-9/+54
| | | | | | | | | | | | at803x currently automatically enables the RGMII TX clock delay when the phy interface mode is PHY_INTERFACE_MODE_RGMII_TXID. The same should be done when PHY_INTERFACE_MODE_RGMII_ID is specified. Use a similar logic to enable the RGMII RX clock delay as well. at803x_context_{save,restore} were not touched because these are only used on AR8030 which is a RMII phy (RGMII clock delays are irrelevant). Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: phy: at803x: Don't set gbit features for the AR8030 phyMartin Blumenstingl2016-01-171-1/+1
| | | | | | | | The 8030 is only a "RMII Fast Ethernet PHY", thus it must not have the SUPPORTED_1000* bits set. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: phy: turn carrier off on phy attachSjoerd Simons2016-01-151-0/+5
| | | | | | | | | | | | | | The operstate of a networking device initially IF_OPER_UNKNOWN aka "unknown", updated on carrier state changes (with carrier state being on by default). This means it will stay unknown unless the carrier state goes to off at some point, which is not the case if the phy is already up/connected at startup. Explicitly turn off the carrier on phy attach, leaving the phy state machine to turn the carrier on when it has done the initial negotiation. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
* phy: remove an unneeded conditionDan Carpenter2016-01-121-1/+1
| | | | | | | | | | It used to be that bus->irq was a pointer but after e7f4dc3536a4 ('mdio: Move allocation of interrupts into core') it's an array inside the mdio struct, so it can never be NULL. Let's remove the check. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mdio_bus: NULL dereference on allocation errorDan Carpenter2016-01-121-5/+6
| | | | | | | | | | | If bus = kzalloc() fails then we end up dereferencing bus when we do "bus->irq[i] = PHY_POLL;". The code is a little simpler if we reverse the NULL check and return directly on failure. Fixes: e7f4dc3536a4 ('mdio: Move allocation of interrupts into core') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2016-01-111-2/+10
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/net/bonding/bond_main.c drivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c The bond_main.c and mellanox switch conflicts were cases of overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
| * phy: micrel: Fix finding PHY properties in MAC node for KSZ9031.Roosen Henri2016-01-081-2/+10
| | | | | | | | | | | | | | | | | | | | | | Commit 651df2183543 ("phy: micrel: Fix finding PHY properties in MAC node.") only fixes finding PHY properties in MAC node for KSZ9021. This commit applies the same fix for KSZ9031. Fixes: 8b63ec1837fa ("phylib: Make PHYs children of their MDIO bus, not the bus' parent.") Acked-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Henri Roosen <henri.roosen@ginzinger.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: Add support for SMSC LAN8740 PHYJoshua Henderson2016-01-101-0/+22
| | | | | | | | | | | | | | LAN8740 has a different phy_id than LAN8710/LAN8720. Signed-off-by: Joshua Henderson <joshua.henderson@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mdio: Abstract device_remove() and device_free()Andrew Lunn2016-01-073-14/+29
| | | | | | | | | | | | | | | | | | | | Make device_free and device_remove operations in the mdio device structure, so the core code does not need to differentiate between phy devices and generic mdio devices. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mdio: Add support for mdio drivers.Andrew Lunn2016-01-074-13/+198
| | | | | | | | | | | | | | | | | | Not all devices on an MDIO bus are PHYs. Meaning not all MDIO drivers are PHY drivers. Add support for generic MDIO drivers. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mdio_bus: Add comment to mdiobus_scan() and __mdiobus_register()Andrew Lunn2016-01-071-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it clear that mdiobus_scan () will only find devices which have a vendor/product ID in registers 2 and 3. These are typically PHY devices. Other sort of MDIO devices, such as switches, are not expected to be found during the scan. Similarly, __mdiobus_register(), which calls mdiobus_scan() will only find PHY devices, and other sorts of MDIO devices are expected to be instantiated from device tree. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mdio_bus: Generalise of_mdiobus_link_phydev()Andrew Lunn2016-01-071-14/+15
| | | | | | | | | | | | | | | | | | This function should work with any sort of MDIO device which can be probed on the bus, not just PHY devices. So generalise it. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | phy: Move phy specific bus match into phy_deviceAndrew Lunn2016-01-072-26/+40
| | | | | | | | | | | | | | | | | | | | Matching a driver to a device has both generic parts, and parts which are specific to PHY devices. Move the PHY specific parts into phy_device. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | phy: Centralize setting driver module ownerAndrew Lunn2016-01-0726-118/+8
| | | | | | | | | | | | | | | | | | | | Rather than have each driver set the driver owner field, do it once in the core code. This will also help with later changes, when the device structure will move. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | phy: Move PHY PM operations into phy_deviceAndrew Lunn2016-01-072-73/+120
| | | | | | | | | | | | | | | | | | | | The MDIO PM operations are really PHY device PM operations. So move them into phy_device. This will be needed when we support devices on the mdio bus which are not PHYs. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | phy_device: Move phy attributes into phy_deviceAndrew Lunn2016-01-072-42/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mdio_bus exports three attributes: - PHY ID is the unique 32-bits identifier for a MDIO device implementing standard MII registers MII_PHYSID1/2, which is not guaranteed to be the case for non-standard compliant devices (e.g: Ethernet switches) - PHY interface describes the data-path of the PHY/MDIO device, which is not strictly a PHY thing, but is required and needed for PHY devices to function, a MDIO device could be a control device exclusively - PHY has fixups describes what the PHY driver may have done, so completely PHY specific These are all phy attributes, not generic mdio attributes. So move the attributes into the phy device code. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | phy: Add API for {un}registering an mdio device to a bus.Andrew Lunn2016-01-072-13/+54
| | | | | | | | | | | | | | | | | | | | Rather than have drivers directly manipulate the mii_bus structure, provide and API for registering and unregistering devices on an MDIO bus, and performing lookups. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | phy: Add an mdio_device structureAndrew Lunn2016-01-0713-89/+95
| | | | | | | | | | | | | | | | | | Not all devices attached to an MDIO bus are phys. So add an mdio_device structure to represent the generic parts of an mdio device, and place this structure into the phy_device. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mdio: Move allocation of interrupts into coreAndrew Lunn2016-01-078-36/+10
| | | | | | | | | | | | | | | | | | | | Have mdio_alloc() create the array of interrupt numbers, and initialize it to POLLING. This is what most MDIO drivers want, so allowing code to be removed from the drivers. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
OpenPOWER on IntegriCloud