Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
7c32f470 VB |
2 | #ifndef __PHY_FIXED_H |
3 | #define __PHY_FIXED_H | |
4 | ||
7c32f470 | 5 | struct fixed_phy_status { |
a79d8e93 VB |
6 | int link; |
7 | int speed; | |
8 | int duplex; | |
9 | int pause; | |
10 | int asym_pause; | |
7c32f470 VB |
11 | }; |
12 | ||
a7595121 TP |
13 | struct device_node; |
14 | ||
6539c44d | 15 | #if IS_ENABLED(CONFIG_FIXED_PHY) |
a79d8e93 | 16 | extern int fixed_phy_add(unsigned int irq, int phy_id, |
a5597008 AL |
17 | struct fixed_phy_status *status, |
18 | int link_gpio); | |
fd2ef0ba PG |
19 | extern struct phy_device *fixed_phy_register(unsigned int irq, |
20 | struct fixed_phy_status *status, | |
a5597008 | 21 | int link_gpio, |
fd2ef0ba | 22 | struct device_node *np); |
5bcbe0f3 | 23 | extern void fixed_phy_unregister(struct phy_device *phydev); |
464c3668 FF |
24 | extern int fixed_phy_set_link_update(struct phy_device *phydev, |
25 | int (*link_update)(struct net_device *, | |
26 | struct fixed_phy_status *)); | |
a79d8e93 VB |
27 | #else |
28 | static inline int fixed_phy_add(unsigned int irq, int phy_id, | |
a5597008 AL |
29 | struct fixed_phy_status *status, |
30 | int link_gpio) | |
a79d8e93 VB |
31 | { |
32 | return -ENODEV; | |
33 | } | |
fd2ef0ba PG |
34 | static inline struct phy_device *fixed_phy_register(unsigned int irq, |
35 | struct fixed_phy_status *status, | |
a5597008 | 36 | int gpio_link, |
fd2ef0ba | 37 | struct device_node *np) |
a7595121 | 38 | { |
fd2ef0ba | 39 | return ERR_PTR(-ENODEV); |
a7595121 | 40 | } |
5bcbe0f3 | 41 | static inline void fixed_phy_unregister(struct phy_device *phydev) |
46cfd6ea | 42 | { |
46cfd6ea | 43 | } |
464c3668 | 44 | static inline int fixed_phy_set_link_update(struct phy_device *phydev, |
a79d8e93 | 45 | int (*link_update)(struct net_device *, |
464c3668 FF |
46 | struct fixed_phy_status *)) |
47 | { | |
48 | return -ENODEV; | |
49 | } | |
50 | #endif /* CONFIG_FIXED_PHY */ | |
7c32f470 VB |
51 | |
52 | #endif /* __PHY_FIXED_H */ |