]> git.proxmox.com Git - mirror_ubuntu-kernels.git/blame - include/linux/phy_fixed.h
Merge tag 'powerpc-5.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[mirror_ubuntu-kernels.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 13struct device_node;
ebe26aca 14struct gpio_desc;
a7595121 15
6539c44d 16#if IS_ENABLED(CONFIG_FIXED_PHY)
b3e5464e 17extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier);
a79d8e93 18extern int fixed_phy_add(unsigned int irq, int phy_id,
5468e82f 19 struct fixed_phy_status *status);
fd2ef0ba
PG
20extern struct phy_device *fixed_phy_register(unsigned int irq,
21 struct fixed_phy_status *status,
22 struct device_node *np);
71bd106d
MF
23
24extern struct phy_device *
25fixed_phy_register_with_gpiod(unsigned int irq,
26 struct fixed_phy_status *status,
27 struct gpio_desc *gpiod);
28
5bcbe0f3 29extern void fixed_phy_unregister(struct phy_device *phydev);
464c3668
FF
30extern int fixed_phy_set_link_update(struct phy_device *phydev,
31 int (*link_update)(struct net_device *,
32 struct fixed_phy_status *));
a79d8e93
VB
33#else
34static inline int fixed_phy_add(unsigned int irq, int phy_id,
5468e82f 35 struct fixed_phy_status *status)
a79d8e93
VB
36{
37 return -ENODEV;
38}
fd2ef0ba
PG
39static inline struct phy_device *fixed_phy_register(unsigned int irq,
40 struct fixed_phy_status *status,
41 struct device_node *np)
a7595121 42{
fd2ef0ba 43 return ERR_PTR(-ENODEV);
a7595121 44}
71bd106d
MF
45
46static inline struct phy_device *
47fixed_phy_register_with_gpiod(unsigned int irq,
48 struct fixed_phy_status *status,
49 struct gpio_desc *gpiod)
50{
51 return ERR_PTR(-ENODEV);
52}
53
5bcbe0f3 54static inline void fixed_phy_unregister(struct phy_device *phydev)
46cfd6ea 55{
46cfd6ea 56}
464c3668 57static inline int fixed_phy_set_link_update(struct phy_device *phydev,
a79d8e93 58 int (*link_update)(struct net_device *,
464c3668
FF
59 struct fixed_phy_status *))
60{
61 return -ENODEV;
62}
b3e5464e
JT
63static inline int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier)
64{
65 return -EINVAL;
66}
464c3668 67#endif /* CONFIG_FIXED_PHY */
7c32f470
VB
68
69#endif /* __PHY_FIXED_H */