Mario Scheithauer | 67f63e7 | 2022-11-02 15:57:10 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #ifndef __DEVICE_MDIO_H__ |
| 4 | #define __DEVICE_MDIO_H__ |
| 5 | |
| 6 | #include <device/device.h> |
| 7 | #include <types.h> |
| 8 | |
| 9 | struct mdio_bus_operations { |
| 10 | uint16_t (*read)(struct device *dev, uint8_t phy_adr, uint8_t reg_adr); |
| 11 | void (*write)(struct device *dev, uint8_t phy_adr, uint8_t reg_adr, uint16_t data); |
| 12 | }; |
| 13 | |
| 14 | /* Helper for getting mdio operations from a device */ |
| 15 | const struct mdio_bus_operations *dev_get_mdio_ops(struct device *dev); |
| 16 | |
Werner Zeh | 49ec39f | 2022-11-15 08:27:19 +0100 | [diff] [blame] | 17 | uint16_t mdio_read(struct device *dev, uint8_t offset); |
| 18 | void mdio_write(struct device *dev, uint8_t offset, uint16_t val); |
| 19 | |
Mario Scheithauer | 67f63e7 | 2022-11-02 15:57:10 +0100 | [diff] [blame] | 20 | #endif /* __DEVICE_MDIO_H__ */ |