xref: /linux/drivers/net/phy/bcm-phy-lib.h (revision 99cec8a4dda28972067c274a4215422262dc5522)
1a1cba561SArun Parameswaran /*
2a1cba561SArun Parameswaran  * Copyright (C) 2015 Broadcom Corporation
3a1cba561SArun Parameswaran  *
4a1cba561SArun Parameswaran  * This program is free software; you can redistribute it and/or
5a1cba561SArun Parameswaran  * modify it under the terms of the GNU General Public License as
6a1cba561SArun Parameswaran  * published by the Free Software Foundation version 2.
7a1cba561SArun Parameswaran  *
8a1cba561SArun Parameswaran  * This program is distributed "as is" WITHOUT ANY WARRANTY of any
9a1cba561SArun Parameswaran  * kind, whether express or implied; without even the implied warranty
10a1cba561SArun Parameswaran  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11a1cba561SArun Parameswaran  * GNU General Public License for more details.
12a1cba561SArun Parameswaran  */
13a1cba561SArun Parameswaran 
14a1cba561SArun Parameswaran #ifndef _LINUX_BCM_PHY_LIB_H
15a1cba561SArun Parameswaran #define _LINUX_BCM_PHY_LIB_H
16a1cba561SArun Parameswaran 
17a1cba561SArun Parameswaran #include <linux/phy.h>
18a1cba561SArun Parameswaran 
19a1cba561SArun Parameswaran int bcm_phy_write_exp(struct phy_device *phydev, u16 reg, u16 val);
20a1cba561SArun Parameswaran int bcm_phy_read_exp(struct phy_device *phydev, u16 reg);
21a1cba561SArun Parameswaran 
225519da87SFlorian Fainelli int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val);
235519da87SFlorian Fainelli int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum);
245519da87SFlorian Fainelli 
25a1cba561SArun Parameswaran int bcm_phy_write_misc(struct phy_device *phydev,
26a1cba561SArun Parameswaran 		       u16 reg, u16 chl, u16 value);
27a1cba561SArun Parameswaran int bcm_phy_read_misc(struct phy_device *phydev,
28a1cba561SArun Parameswaran 		      u16 reg, u16 chl);
29a1cba561SArun Parameswaran 
30a1cba561SArun Parameswaran int bcm_phy_write_shadow(struct phy_device *phydev, u16 shadow,
31a1cba561SArun Parameswaran 			 u16 val);
32a1cba561SArun Parameswaran int bcm_phy_read_shadow(struct phy_device *phydev, u16 shadow);
33a1cba561SArun Parameswaran 
34a1cba561SArun Parameswaran int bcm_phy_ack_intr(struct phy_device *phydev);
35a1cba561SArun Parameswaran int bcm_phy_config_intr(struct phy_device *phydev);
36a1cba561SArun Parameswaran 
37a1cba561SArun Parameswaran int bcm_phy_enable_apd(struct phy_device *phydev, bool dll_pwr_down);
38a1cba561SArun Parameswaran 
39*99cec8a4SFlorian Fainelli int bcm_phy_set_eee(struct phy_device *phydev, bool enable);
40d06f78c4SFlorian Fainelli 
41d06f78c4SFlorian Fainelli int bcm_phy_downshift_get(struct phy_device *phydev, u8 *count);
42d06f78c4SFlorian Fainelli 
43d06f78c4SFlorian Fainelli int bcm_phy_downshift_set(struct phy_device *phydev, u8 count);
44d06f78c4SFlorian Fainelli 
45a1cba561SArun Parameswaran #endif /* _LINUX_BCM_PHY_LIB_H */
46