mirror of
https://github.com/torvalds/linux.git
synced 2026-05-02 05:22:49 -04:00
Helper functions mmd_phy_read and mmd_phy_write are useful for PHYs which require custom MMD access functions for some but not all MMDs. Move mmd_phy_read and mmd_phy_write function prototypes from phylib-internal.h to phylib.h to make them available for PHY drivers. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/79169cd624a3572d426e42c7b13cd2654a35d0cb.1767630451.git.daniel@makrotopia.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
40 lines
1.5 KiB
C
40 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* phylib header
|
|
*/
|
|
|
|
#ifndef __PHYLIB_H
|
|
#define __PHYLIB_H
|
|
|
|
struct device_node;
|
|
struct phy_device;
|
|
struct mii_bus;
|
|
|
|
struct device_node *phy_package_get_node(struct phy_device *phydev);
|
|
void *phy_package_get_priv(struct phy_device *phydev);
|
|
int __phy_package_read(struct phy_device *phydev, unsigned int addr_offset,
|
|
u32 regnum);
|
|
int __phy_package_write(struct phy_device *phydev, unsigned int addr_offset,
|
|
u32 regnum, u16 val);
|
|
int __phy_package_read_mmd(struct phy_device *phydev,
|
|
unsigned int addr_offset, int devad,
|
|
u32 regnum);
|
|
int __phy_package_write_mmd(struct phy_device *phydev,
|
|
unsigned int addr_offset, int devad,
|
|
u32 regnum, u16 val);
|
|
bool phy_package_init_once(struct phy_device *phydev);
|
|
bool phy_package_probe_once(struct phy_device *phydev);
|
|
int phy_package_join(struct phy_device *phydev, int base_addr, size_t priv_size);
|
|
int of_phy_package_join(struct phy_device *phydev, size_t priv_size);
|
|
void phy_package_leave(struct phy_device *phydev);
|
|
int devm_phy_package_join(struct device *dev, struct phy_device *phydev,
|
|
int base_addr, size_t priv_size);
|
|
int devm_of_phy_package_join(struct device *dev, struct phy_device *phydev,
|
|
size_t priv_size);
|
|
int mmd_phy_read(struct mii_bus *bus, int phy_addr, bool is_c45,
|
|
int devad, u32 regnum);
|
|
int mmd_phy_write(struct mii_bus *bus, int phy_addr, bool is_c45,
|
|
int devad, u32 regnum, u16 val);
|
|
|
|
#endif /* __PHYLIB_H */
|