Merge branch 'Add-comphy-support-for-Armada-38x'
[linux-block.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);
5bcbe0f3 22extern void fixed_phy_unregister(struct phy_device *phydev);
464c3668
FF
23extern int fixed_phy_set_link_update(struct phy_device *phydev,
24 int (*link_update)(struct net_device *,
25 struct fixed_phy_status *));
a79d8e93
VB
26#else
27static inline int fixed_phy_add(unsigned int irq, int phy_id,
5468e82f 28 struct fixed_phy_status *status)
a79d8e93
VB
29{
30 return -ENODEV;
31}
fd2ef0ba
PG
32static inline struct phy_device *fixed_phy_register(unsigned int irq,
33 struct fixed_phy_status *status,
34 struct device_node *np)
a7595121 35{
fd2ef0ba 36 return ERR_PTR(-ENODEV);
a7595121 37}
5bcbe0f3 38static inline void fixed_phy_unregister(struct phy_device *phydev)
46cfd6ea 39{
46cfd6ea 40}
464c3668 41static inline int fixed_phy_set_link_update(struct phy_device *phydev,
a79d8e93 42 int (*link_update)(struct net_device *,
464c3668
FF
43 struct fixed_phy_status *))
44{
45 return -ENODEV;
46}
b3e5464e
JT
47static inline int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier)
48{
49 return -EINVAL;
50}
464c3668 51#endif /* CONFIG_FIXED_PHY */
7c32f470
VB
52
53#endif /* __PHY_FIXED_H */