17c32f470SVitaly Bordug #ifndef __PHY_FIXED_H 27c32f470SVitaly Bordug #define __PHY_FIXED_H 37c32f470SVitaly Bordug 47c32f470SVitaly Bordug struct fixed_phy_status { 5a79d8e93SVitaly Bordug int link; 6a79d8e93SVitaly Bordug int speed; 7a79d8e93SVitaly Bordug int duplex; 8a79d8e93SVitaly Bordug int pause; 9a79d8e93SVitaly Bordug int asym_pause; 107c32f470SVitaly Bordug }; 117c32f470SVitaly Bordug 12a7595121SThomas Petazzoni struct device_node; 13a7595121SThomas Petazzoni 146539c44dSDavid S. Miller #if IS_ENABLED(CONFIG_FIXED_PHY) 15a79d8e93SVitaly Bordug extern int fixed_phy_add(unsigned int irq, int phy_id, 16*a5597008SAndrew Lunn struct fixed_phy_status *status, 17*a5597008SAndrew Lunn int link_gpio); 18fd2ef0baSPetri Gynther extern struct phy_device *fixed_phy_register(unsigned int irq, 19a7595121SThomas Petazzoni struct fixed_phy_status *status, 20*a5597008SAndrew Lunn int link_gpio, 21a7595121SThomas Petazzoni struct device_node *np); 2246cfd6eaSKonrad Zapalowicz extern void fixed_phy_del(int phy_addr); 23464c3668SFlorian Fainelli extern int fixed_phy_set_link_update(struct phy_device *phydev, 24464c3668SFlorian Fainelli int (*link_update)(struct net_device *, 25464c3668SFlorian Fainelli struct fixed_phy_status *)); 26a3bebdceSStas Sergeev extern int fixed_phy_update_state(struct phy_device *phydev, 27a3bebdceSStas Sergeev const struct fixed_phy_status *status, 28a3bebdceSStas Sergeev const struct fixed_phy_status *changed); 29a79d8e93SVitaly Bordug #else 30a79d8e93SVitaly Bordug static inline int fixed_phy_add(unsigned int irq, int phy_id, 31*a5597008SAndrew Lunn struct fixed_phy_status *status, 32*a5597008SAndrew Lunn int link_gpio) 33a79d8e93SVitaly Bordug { 34a79d8e93SVitaly Bordug return -ENODEV; 35a79d8e93SVitaly Bordug } 36fd2ef0baSPetri Gynther static inline struct phy_device *fixed_phy_register(unsigned int irq, 37a7595121SThomas Petazzoni struct fixed_phy_status *status, 38*a5597008SAndrew Lunn int gpio_link, 39a7595121SThomas Petazzoni struct device_node *np) 40a7595121SThomas Petazzoni { 41fd2ef0baSPetri Gynther return ERR_PTR(-ENODEV); 42a7595121SThomas Petazzoni } 4346cfd6eaSKonrad Zapalowicz static inline int fixed_phy_del(int phy_addr) 4446cfd6eaSKonrad Zapalowicz { 4546cfd6eaSKonrad Zapalowicz return -ENODEV; 4646cfd6eaSKonrad Zapalowicz } 47464c3668SFlorian Fainelli static inline int fixed_phy_set_link_update(struct phy_device *phydev, 48a79d8e93SVitaly Bordug int (*link_update)(struct net_device *, 49464c3668SFlorian Fainelli struct fixed_phy_status *)) 50464c3668SFlorian Fainelli { 51464c3668SFlorian Fainelli return -ENODEV; 52464c3668SFlorian Fainelli } 53a3bebdceSStas Sergeev static inline int fixed_phy_update_state(struct phy_device *phydev, 54a3bebdceSStas Sergeev const struct fixed_phy_status *status, 55a3bebdceSStas Sergeev const struct fixed_phy_status *changed) 56a3bebdceSStas Sergeev { 57a3bebdceSStas Sergeev return -ENODEV; 58a3bebdceSStas Sergeev } 59464c3668SFlorian Fainelli #endif /* CONFIG_FIXED_PHY */ 607c32f470SVitaly Bordug 617c32f470SVitaly Bordug #endif /* __PHY_FIXED_H */ 62