zephyr/drivers/ethernet/phy/phy_adin2111_priv.h
Georgij Cernysiov b0acced124 drivers: phy: add adin2111
Adds PHY driver. Works via MDIO API and
exposed ADIN2111 MDIO Clause 45
functions.

Link status detection is triggered by
ADIN2111 driver within offloaded IRQ
handler.

Supports:
  - LED0, LED1 enable/disable
  - Fatal HW error detection
  - AN 2.4V tx mode enable/disable

The initialization order is important.
PHY 2 must be initialized after PHY1.
Therefore, it shall be defined after the 1st one
in the devicetree.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2023-05-26 09:50:09 -04:00

31 lines
763 B
C

/*
* Copyright (c) 2023 PHOENIX CONTACT Electronics GmbH
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef PHY_ADIN2111_PRIV_H__
#define PHY_ADIN2111_PRIV_H__
#include <zephyr/device.h>
#include <zephyr/net/phy.h>
/**
* @brief Handles PHY interrupt.
*
* @note Used internally by the ADIN offloaded ISR handler.
* The caller is responsible for device lock.
* Shall not be called from ISR.
*
* @param[in] dev PHY device.
* @param[out] state Output of the link state.
*
* @retval 0 Successful and link state changed.
* @retval -EAGAIN Successful but link state didn't change.
* @retval <0 MDIO error.
*/
int phy_adin2111_handle_phy_irq(const struct device *dev,
struct phy_link_state *state);
#endif /* PHY_ADIN2111_PRIV_H__ */