]> git.ipfire.org Git - thirdparty/kernel/stable.git/blame - include/linux/phy_fixed.h
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 503
[thirdparty/kernel/stable.git] / include / linux / phy_fixed.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
7c32f470
VB
2#ifndef __PHY_FIXED_H
3#define __PHY_FIXED_H
4
7c32f470 5struct 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
13struct device_node;
14
6539c44d 15#if IS_ENABLED(CONFIG_FIXED_PHY)
b3e5464e 16extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier);
a79d8e93 17extern int fixed_phy_add(unsigned int irq, int phy_id,
5468e82f 18 struct fixed_phy_status *status);
fd2ef0ba
PG
19extern struct phy_device *fixed_phy_register(unsigned int irq,
20 struct fixed_phy_status *status,
21 struct device_node *np);
71bd106d
MF
22
23extern struct phy_device *
24fixed_phy_register_with_gpiod(unsigned int irq,
25 struct fixed_phy_status *status,
26 struct gpio_desc *gpiod);
27
5bcbe0f3 28extern void fixed_phy_unregister(struct phy_device *phydev);
464c3668
FF
29extern int fixed_phy_set_link_update(struct phy_device *phydev,
30 int (*link_update)(struct net_device *,
31 struct fixed_phy_status *));
a79d8e93
VB
32#else
33static inline int fixed_phy_add(unsigned int irq, int phy_id,
5468e82f 34 struct fixed_phy_status *status)
a79d8e93
VB
35{
36 return -ENODEV;
37}
fd2ef0ba
PG
38static inline struct phy_device *fixed_phy_register(unsigned int irq,
39 struct fixed_phy_status *status,
40 struct device_node *np)
a7595121 41{
fd2ef0ba 42 return ERR_PTR(-ENODEV);
a7595121 43}
71bd106d
MF
44
45static inline struct phy_device *
46fixed_phy_register_with_gpiod(unsigned int irq,
47 struct fixed_phy_status *status,
48 struct gpio_desc *gpiod)
49{
50 return ERR_PTR(-ENODEV);
51}
52
5bcbe0f3 53static inline void fixed_phy_unregister(struct phy_device *phydev)
46cfd6ea 54{
46cfd6ea 55}
464c3668 56static inline int fixed_phy_set_link_update(struct phy_device *phydev,
a79d8e93 57 int (*link_update)(struct net_device *,
464c3668
FF
58 struct fixed_phy_status *))
59{
60 return -ENODEV;
61}
b3e5464e
JT
62static inline int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier)
63{
64 return -EINVAL;
65}
464c3668 66#endif /* CONFIG_FIXED_PHY */
7c32f470
VB
67
68#endif /* __PHY_FIXED_H */