xref: /openbmc/linux/drivers/net/dsa/mv88e6xxx/phy.h (revision 1b17aedf)
110fa5bfcSAndrew Lunn /*
210fa5bfcSAndrew Lunn  * Marvell 88E6xxx PHY access
310fa5bfcSAndrew Lunn  *
410fa5bfcSAndrew Lunn  * Copyright (c) 2008 Marvell Semiconductor
510fa5bfcSAndrew Lunn  *
610fa5bfcSAndrew Lunn  * Copyright (c) 2017 Andrew Lunn <andrew@lunn.ch>
710fa5bfcSAndrew Lunn  *
810fa5bfcSAndrew Lunn  * This program is free software; you can redistribute it and/or modify
910fa5bfcSAndrew Lunn  * it under the terms of the GNU General Public License as published by
1010fa5bfcSAndrew Lunn  * the Free Software Foundation; either version 2 of the License, or
1110fa5bfcSAndrew Lunn  * (at your option) any later version.
1210fa5bfcSAndrew Lunn  */
1310fa5bfcSAndrew Lunn 
1410fa5bfcSAndrew Lunn #ifndef _MV88E6XXX_PHY_H
1510fa5bfcSAndrew Lunn #define _MV88E6XXX_PHY_H
1610fa5bfcSAndrew Lunn 
1710fa5bfcSAndrew Lunn int mv88e6165_phy_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
1810fa5bfcSAndrew Lunn 		       int addr, int reg, u16 *val);
1910fa5bfcSAndrew Lunn int mv88e6165_phy_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
2010fa5bfcSAndrew Lunn 			int addr, int reg, u16 val);
2110fa5bfcSAndrew Lunn int mv88e6xxx_phy_read(struct mv88e6xxx_chip *chip, int phy,
2210fa5bfcSAndrew Lunn 		       int reg, u16 *val);
2310fa5bfcSAndrew Lunn int mv88e6xxx_phy_write(struct mv88e6xxx_chip *chip, int phy,
2410fa5bfcSAndrew Lunn 			int reg, u16 val);
2510fa5bfcSAndrew Lunn int mv88e6xxx_phy_page_read(struct mv88e6xxx_chip *chip, int phy,
2610fa5bfcSAndrew Lunn 			    u8 page, int reg, u16 *val);
2710fa5bfcSAndrew Lunn int mv88e6xxx_phy_page_write(struct mv88e6xxx_chip *chip, int phy,
2810fa5bfcSAndrew Lunn 			     u8 page, int reg, u16 val);
2910fa5bfcSAndrew Lunn int mv88e6xxx_phy_ppu_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
3010fa5bfcSAndrew Lunn 			   int addr, int reg, u16 *val);
3110fa5bfcSAndrew Lunn int mv88e6xxx_phy_ppu_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
3210fa5bfcSAndrew Lunn 			    int addr, int reg, u16 val);
3310fa5bfcSAndrew Lunn void mv88e6xxx_phy_init(struct mv88e6xxx_chip *chip);
3410fa5bfcSAndrew Lunn void mv88e6xxx_phy_destroy(struct mv88e6xxx_chip *chip);
351b17aedfSVivien Didelot int mv88e6xxx_phy_setup(struct mv88e6xxx_chip *chip);
3610fa5bfcSAndrew Lunn 
3710fa5bfcSAndrew Lunn #endif /*_MV88E6XXX_PHY_H */
38