no-OS
Loading...
Searching...
No Matches
adin1320.c File Reference

Source file of the ADIN1320 driver. More...

#include <errno.h>
#include "no_os_alloc.h"
#include "no_os_delay.h"
#include "no_os_gpio.h"
#include "adin1320.h"
Include dependency graph for adin1320.c:

Functions

int adin1320_init (struct adin1320_desc **dev, struct adin1320_init_param *param)
 Initialize the Device.
 
int adin1320_hard_reset (struct adin1320_desc *dev)
 Perform Device Hard Reset.
 
int adin1320_remove (struct adin1320_desc *dev)
 Remove Initialization of the Device.
 
int adin1320_write (struct adin1320_desc *dev, uint32_t addr, uint16_t val)
 MDIO Write with Clause22 or Clause45.
 
int adin1320_read (struct adin1320_desc *dev, uint32_t addr, uint16_t *val)
 MDIO Read with Clause22 or Clause45.
 
int adin1320_write_bits (struct adin1320_desc *dev, uint32_t addr, uint16_t val, uint16_t bitmask)
 MDIO Write with Clause22 or Clause45 on a Specific Bit.
 
int adin1320_config_rgmii (struct adin1320_desc *dev, struct adin1320_rgmii_config rgmii)
 Configure RGMII Tx and Rx Delays.
 
int adin1320_config_gp_clk (struct adin1320_desc *dev, enum adin1320_gp_clk_source source)
 Configure GP Clock.
 
int adin1320_config_clk25_ref (struct adin1320_desc *dev, enum adin1320_clk25_ref_enable enable)
 Enable/disable GE Clock 25MHz Reference.
 
int adin1320_cu_autoneg (struct adin1320_desc *dev, enum adin1320_autoneg_enable enable)
 Enable/disable and Reset Autonegotiation for Copper Media.
 
int adin1320_sd_autoneg (struct adin1320_desc *dev, enum adin1320_autoneg_enable enable)
 Enable/disable and Reset Autonegotiation for SerDes Media.
 
int adin1320_cu_resolved_speed (struct adin1320_desc *dev, enum adin1320_cu_speed *resolved_speed)
 Get Resolved Speed for Copper Media.
 
int adin1320_sd_resolved_speed (struct adin1320_desc *dev, enum adin1320_sd_speed *resolved_speed)
 Get Resolved Speed for SerDes Media.
 
int adin1320_soft_reset (struct adin1320_desc *dev, enum adin1320_soft_reset_option reset_cfg)
 Select and Perform Device Reset.
 
int adin1320_cu_read_irq_status (struct adin1320_desc *dev, bool *val_irq_pending, uint16_t *val_irq_status)
 Read interrupt status for copper media.
 
int adin1320_sd_read_irq_status (struct adin1320_desc *dev, bool *val_irq_pending, uint16_t *val_irq_status)
 Read interrupt status for serdes media.
 
int adin1320_set_software_powerdown (struct adin1320_desc *dev, enum adin1320_software_powerdown val)
 Enter/exit Software Powerdown.
 
int adin1320_get_software_powerdown (struct adin1320_desc *dev, enum adin1320_software_powerdown *val)
 Get Software Powerdown Status.
 
int adin1320_get_device_id (struct adin1320_desc *dev, uint32_t *device_id)
 Get Device ID.
 
int adin1320_reset_rmii_fifo (struct adin1320_desc *dev)
 Allows the RMII FIFO to be Reset.
 
int adin1320_select_mac_interface (struct adin1320_desc *dev, enum adin1320_mac_interface val)
 MAC Interface Configuration.
 
int adin1320_cu_link_cfg (struct adin1320_desc *dev, enum adin1320_link_cfg_enable val)
 Enables/Disables the Link.
 
int adin1320_cu_get_mii_status (struct adin1320_desc *dev, struct adin1320_mii_status *mii_status)
 Get Different Status from Copper Media MII Status Register.
 
int adin1320_sd_get_mii_status (struct adin1320_desc *dev, struct adin1320_mii_status *mii_status)
 Get Different Status from SerDes Media MII Status Register.
 
int adin1320_cu_autoneg_adv_cfg (struct adin1320_desc *dev, uint16_t autoneg_adv_speeds)
 Configure Autonegotiation Advertisement Speeds for Copper Media.
 
int adin1320_sd_autoneg_adv_cfg (struct adin1320_desc *dev, uint16_t autoneg_adv_speeds)
 Configure Autonegotiation Advertisement Speeds for SerDes Media.
 
int adin1320_cu_get_autoneg_adv (struct adin1320_desc *dev, uint16_t *autoneg_adv_speeds)
 Get Enabled Autonegotiation Advertised Speeds for Copper Media.
 
int adin1320_sd_get_autoneg_adv (struct adin1320_desc *dev, uint16_t *autoneg_adv_speeds)
 Get Enabled Autonegotiation Advertised Speeds for SerDes Media.
 
int adin1320_auto_mdix_cfg (struct adin1320_desc *dev, enum adin1320_auto_mdix val)
 Auto MDIX Config.
 
int adin1320_energy_detect_pwd_cfg (struct adin1320_desc *dev, enum adin1320_energy_detect_pwd val)
 Energy Detect Power Down mode Config.
 
int adin1320_get_energy_detect_pwd_stat (struct adin1320_desc *dev, enum adin1320_edpd_stat *val)
 Get Energy Detect Power Down mode Status.
 
int adin1320_downspeed_cfg (struct adin1320_desc *dev, uint8_t downspeeds)
 Configure Downspeed.
 
int adin1320_set_downspeed_retries (struct adin1320_desc *dev, uint16_t val)
 Downspeed - Number of retries.
 
int adin1320_cu_forced_speed (struct adin1320_desc *dev, enum adin1320_cu_speed val)
 Set Force Speed for Copper Media.
 
int adin1320_sd_forced_speed (struct adin1320_desc *dev, enum adin1320_sd_speed forced_speed)
 Set Force Speed for SerDes Media.
 
int adin1320_set_eee (struct adin1320_desc *dev, uint8_t eee_speeds)
 Set Energy Efficient Ethernet speeds.
 
int adin1320_get_eee (struct adin1320_desc *dev, uint8_t *eee_speeds)
 Get Energy Efficient Ethernet Status.
 
int adin1320_get_master_slave_status (struct adin1320_desc *dev, enum adin1320_master_slave_status *val)
 Get Master Slave Status.
 
int adin1320_master_slave_config (struct adin1320_desc *dev, enum adin1320_adv_master_slave_cfg val)
 Configure PHY as Master or Slave for 1 Gb speed only.
 
int adin1320_cu_config_interrupt (struct adin1320_desc *dev, uint32_t callback_events)
 Configure the interrupt mask register for copper media.
 
int adin1320_sd_config_interrupt (struct adin1320_desc *dev, uint32_t callback_events)
 Configure the interrupt mask register for serdes media.
 
int adin1320_led_cfg (struct adin1320_desc *dev, enum adin1320_led_output_enable enable_led_output, enum adin1320_led_pul_str_dur_select pulse_stretch)
 Configure general LED settings.
 
int adin1320_cu_led_ctrl (struct adin1320_desc *dev, enum adin1320_led_sel led_sel, uint8_t led_pat, uint8_t led_pause, enum adin1320_cu_led_cfg led_cfg, enum adin1320_led_inv_state led_inv_state)
 Configure LED settings for Copper Media.
 
int adin1320_sd_led_ctrl (struct adin1320_desc *dev, enum adin1320_led_sel led_sel, enum adin1320_sd_led_cfg led_cfg, enum adin1320_led_inv_state led_inv_state)
 Configure LED settings for SerDes Media.
 
int adin1320_mgc_match_cfg (struct adin1320_desc *dev, uint16_t enabled_matches)
 Configure Magic Packet Address Matchings.
 
int adin1320_mgc_check_cfg (struct adin1320_desc *dev, uint16_t enabled_checks)
 Configure Magic Packet Checks.
 
int adin1320_mgc_key_cfg (struct adin1320_desc *dev, enum adin1320_mgc_key_byte key_byte, uint8_t key[6])
 Configure Magic Packet SecureOn Key.
 
int adin1320_wol_address (struct adin1320_desc *dev, uint8_t mac_address[6])
 Configure Wake-on-LAN Station Address.
 
int adin1320_wol_sys_cfg (struct adin1320_desc *dev, enum adin1320_wol_fi_en enable_fi, enum adin1320_wol_inv active_signal)
 Configure Wake-on-LAN System Settings.
 
int adin1320_wol_sig_cfg (struct adin1320_desc *dev, enum adin1320_wol_sig signal_type, uint8_t pulse_length)
 Configure Wake-on-LAN Signal Settings.
 
int adin1320_wol_wake_cfg (struct adin1320_desc *dev, enum adin1320_wol_wake_key_enable wake_on_key, enum adin1320_wol_wake_link_enable wake_on_link_change)
 Configure Wake-on-LAN Wake-up Events.
 
int adin1320_wol_en_cfg (struct adin1320_desc *dev, enum adin1320_wol_enable enable)
 Enable/Disable Wake-on-LAN.
 
int adin1320_get_active_media (struct adin1320_desc *dev, enum adin1320_active_media *media)
 Get Auto Media Selected as Active Media.
 

Detailed Description

Source file of the ADIN1320 driver.

Author
Johnson Ralph Perez (Johns.nosp@m.onra.nosp@m.lph.P.nosp@m.erez.nosp@m.@anal.nosp@m.og.c.nosp@m.om)

Copyright 2026(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ adin1320_auto_mdix_cfg()

int adin1320_auto_mdix_cfg ( struct adin1320_desc * dev,
enum adin1320_auto_mdix val )

Auto MDIX Config.

Parameters
dev- The device structure
val- MDIX configuration
Returns
0 in case of success, negative code otherwise

◆ adin1320_config_clk25_ref()

int adin1320_config_clk25_ref ( struct adin1320_desc * dev,
enum adin1320_clk25_ref_enable enable )

Enable/disable GE Clock 25MHz Reference.

Parameters
dev- The device structure
enable- Enable/disable 25MHz Ref Clock
Returns
0 in case of success, negative code otherwise

◆ adin1320_config_gp_clk()

int adin1320_config_gp_clk ( struct adin1320_desc * dev,
enum adin1320_gp_clk_source source )

Configure GP Clock.

Parameters
dev- The device structure
source- GP Clock to Select
Returns
0 in case of success, negative code otherwise

◆ adin1320_config_rgmii()

int adin1320_config_rgmii ( struct adin1320_desc * dev,
struct adin1320_rgmii_config rgmii )

Configure RGMII Tx and Rx Delays.

Parameters
dev- The device structure
rgmii- Struct container for RGMII configurations
Returns
0 in case of success, negative code otherwise

◆ adin1320_cu_autoneg()

int adin1320_cu_autoneg ( struct adin1320_desc * dev,
enum adin1320_autoneg_enable enable )

Enable/disable and Reset Autonegotiation for Copper Media.

Parameters
dev- The device structure
enable- Enable and reset autonegotiation, or disable autonegotiation
Returns
0 in case of success, negative code otherwise

◆ adin1320_cu_autoneg_adv_cfg()

int adin1320_cu_autoneg_adv_cfg ( struct adin1320_desc * dev,
uint16_t autoneg_adv_speeds )

Configure Autonegotiation Advertisement Speeds for Copper Media.

Parameters
dev- The device structure
autoneg_adv_speeds- Autoneg Adv speeds to enable (masked with adin1320_cu_speed)
Returns
0 in case of success, negative code otherwise

◆ adin1320_cu_config_interrupt()

int adin1320_cu_config_interrupt ( struct adin1320_desc * dev,
uint32_t callback_events )

Configure the interrupt mask register for copper media.

Parameters
dev- The device structure
callback_events- Bitmask of interrupt events to enable
Returns
0 in case of success, negative code otherwise

◆ adin1320_cu_forced_speed()

int adin1320_cu_forced_speed ( struct adin1320_desc * dev,
enum adin1320_cu_speed val )

Set Force Speed for Copper Media.

Parameters
dev- The device structure
val- Forced speed to select
Returns
0 in case of success, negative code otherwise

◆ adin1320_cu_get_autoneg_adv()

int adin1320_cu_get_autoneg_adv ( struct adin1320_desc * dev,
uint16_t * autoneg_adv_speeds )

Get Enabled Autonegotiation Advertised Speeds for Copper Media.

Parameters
dev- The device structure
autoneg_adv_speeds- Enabled Autoneg Adv speeds (masked with adin1320_cu_speed)
Returns
0 in case of success, negative code otherwise

◆ adin1320_cu_get_mii_status()

int adin1320_cu_get_mii_status ( struct adin1320_desc * dev,
struct adin1320_mii_status * mii_status )

Get Different Status from Copper Media MII Status Register.

Parameters
dev- The device structure
mii_status- Initialized struct container for MII status to be filled
Returns
0 in case of success, negative code otherwise

◆ adin1320_cu_led_ctrl()

int adin1320_cu_led_ctrl ( struct adin1320_desc * dev,
enum adin1320_led_sel led_sel,
uint8_t led_pat,
uint8_t led_pause,
enum adin1320_cu_led_cfg led_cfg,
enum adin1320_led_inv_state led_inv_state )

Configure LED settings for Copper Media.

Parameters
dev- The device structure
led_sel- LED to configure
led_pat- LED pattern selection
led_pause- Pause duration between patterns
led_cfg- LED configuration
led_inv_state- LED invert state
Returns
0 in case of success, negative code otherwise

◆ adin1320_cu_link_cfg()

int adin1320_cu_link_cfg ( struct adin1320_desc * dev,
enum adin1320_link_cfg_enable val )

Enables/Disables the Link.

Parameters
dev- The device structure
val- Enable/disable link
Returns
0 in case of success, negative code otherwise

◆ adin1320_cu_read_irq_status()

int adin1320_cu_read_irq_status ( struct adin1320_desc * dev,
bool * val_irq_pending,
uint16_t * val_irq_status )

Read interrupt status for copper media.

Parameters
dev- The device structure
val_irq_pending- Set to true if any IRQ is pending, false otherwise
val_irq_status- The complete IRQ status register value showing status of all IRQs
Returns
0 in case of success, negative code otherwise

◆ adin1320_cu_resolved_speed()

int adin1320_cu_resolved_speed ( struct adin1320_desc * dev,
enum adin1320_cu_speed * resolved_speed )

Get Resolved Speed for Copper Media.

Parameters
dev- The device structure
resolved_speed- Resolved speed read from HCD_TECH
Returns
0 in case of success, negative code otherwise

◆ adin1320_downspeed_cfg()

int adin1320_downspeed_cfg ( struct adin1320_desc * dev,
uint8_t downspeeds )

Configure Downspeed.

Parameters
dev- The device structure
downspeeds- Downspeeds to enable (masked with adin1320_downspeed)
Returns
0 in case of success, negative code otherwise

◆ adin1320_energy_detect_pwd_cfg()

int adin1320_energy_detect_pwd_cfg ( struct adin1320_desc * dev,
enum adin1320_energy_detect_pwd val )

Energy Detect Power Down mode Config.

Parameters
dev- The device structure
val- Energy power down mode
Returns
0 in case of success, negative code otherwise

◆ adin1320_get_active_media()

int adin1320_get_active_media ( struct adin1320_desc * dev,
enum adin1320_active_media * media )

Get Auto Media Selected as Active Media.

Parameters
dev- The device structure
media- Active media selected
Returns
0 in case of success, negative code otherwise

◆ adin1320_get_device_id()

int adin1320_get_device_id ( struct adin1320_desc * dev,
uint32_t * device_id )

Get Device ID.

Parameters
dev- The device structure
device_id- Combined device ID (upper 16 bits: PHY ID 1, lower 16 bits: PHY ID 2)
Returns
0 in case of success, negative code otherwise

◆ adin1320_get_eee()

int adin1320_get_eee ( struct adin1320_desc * dev,
uint8_t * eee_speeds )

Get Energy Efficient Ethernet Status.

Parameters
dev- The device structure
eee_speeds- Enabled EEE speeds (masked with adin1320_eee_speeds)
Returns
0 in case of success, negative code otherwise

◆ adin1320_get_energy_detect_pwd_stat()

int adin1320_get_energy_detect_pwd_stat ( struct adin1320_desc * dev,
enum adin1320_edpd_stat * val )

Get Energy Detect Power Down mode Status.

Parameters
dev- The device structure
val- Energy Detect Status
Returns
0 in case of success, negative code otherwise

◆ adin1320_get_master_slave_status()

int adin1320_get_master_slave_status ( struct adin1320_desc * dev,
enum adin1320_master_slave_status * val )

Get Master Slave Status.

Parameters
dev- The device structure
val- Master slave status
Returns
0 in case of success, negative code otherwise

◆ adin1320_get_software_powerdown()

int adin1320_get_software_powerdown ( struct adin1320_desc * dev,
enum adin1320_software_powerdown * val )

Get Software Powerdown Status.

Parameters
dev- The device structure
val- Software Powerdown Status
Returns
0 in case of success, negative code otherwise

◆ adin1320_hard_reset()

int adin1320_hard_reset ( struct adin1320_desc * dev)

Perform Device Hard Reset.

Parameters
dev- The device structure
Returns
0 in case of success, negative code otherwise

◆ adin1320_init()

int adin1320_init ( struct adin1320_desc ** dev,
struct adin1320_init_param * param )

Initialize the Device.

Parameters
dev- The device structure
param- Initialization parameter containing information about the device to be initialized.
Returns
0 in case of success, negative code otherwise

◆ adin1320_led_cfg()

int adin1320_led_cfg ( struct adin1320_desc * dev,
enum adin1320_led_output_enable enable_led_output,
enum adin1320_led_pul_str_dur_select pulse_stretch )

Configure general LED settings.

Parameters
dev- The device structure
enable_led_output- Enable/Disable LED output
pulse_stretch- Pulse stretch duration selection
Returns
0 in case of success, negative code otherwise

◆ adin1320_master_slave_config()

int adin1320_master_slave_config ( struct adin1320_desc * dev,
enum adin1320_adv_master_slave_cfg val )

Configure PHY as Master or Slave for 1 Gb speed only.

Parameters
dev- The device structure
val- Config as Master or Slave
Returns
0 in case of success, negative code otherwise

◆ adin1320_mgc_check_cfg()

int adin1320_mgc_check_cfg ( struct adin1320_desc * dev,
uint16_t enabled_checks )

Configure Magic Packet Checks.

Parameters
dev- The device structure
enabled_checks- Magic packet checks to enable (masked with adin1320_mgc_chk_en)
Returns
0 in case of success, negative code otherwise

◆ adin1320_mgc_key_cfg()

int adin1320_mgc_key_cfg ( struct adin1320_desc * dev,
enum adin1320_mgc_key_byte key_byte,
uint8_t key[6] )

Configure Magic Packet SecureOn Key.

Parameters
dev- The device structure
key_byte- Select 6 or 4 byte key
key- Key bytes (array of 6 bytes, only first 4 used for 4-byte key)
Returns
0 in case of success, negative code otherwise

◆ adin1320_mgc_match_cfg()

int adin1320_mgc_match_cfg ( struct adin1320_desc * dev,
uint16_t enabled_matches )

Configure Magic Packet Address Matchings.

Parameters
dev- The device structure
enabled_matches- Magic packet address matchings to enable (masked with adin1320_mgc_match_en)
Returns
0 in case of success, negative code otherwise

◆ adin1320_read()

int adin1320_read ( struct adin1320_desc * dev,
uint32_t addr,
uint16_t * val )

MDIO Read with Clause22 or Clause45.

Parameters
dev- The device structure
addr- Register Address
val- Read value from the register
Returns
0 in case of success, negative code otherwise

◆ adin1320_remove()

int adin1320_remove ( struct adin1320_desc * dev)

Remove Initialization of the Device.

Parameters
dev- The device structure
Returns
0 in case of success, negative code otherwise

◆ adin1320_reset_rmii_fifo()

int adin1320_reset_rmii_fifo ( struct adin1320_desc * dev)

Allows the RMII FIFO to be Reset.

Note
This function places the device in software powerdown. The caller is responsible for calling adin1320_set_software_powerdown(dev, ADIN1320_SOFTWARE_POWERUP) to resume normal operation after the FIFO reset.
Parameters
dev- The device structure
Returns
0 in case of success, negative code otherwise

◆ adin1320_sd_autoneg()

int adin1320_sd_autoneg ( struct adin1320_desc * dev,
enum adin1320_autoneg_enable enable )

Enable/disable and Reset Autonegotiation for SerDes Media.

Parameters
dev- The device structure
enable- Enable and reset autonegotiation, or disable autonegotiation
Returns
0 in case of success, negative code otherwise

◆ adin1320_sd_autoneg_adv_cfg()

int adin1320_sd_autoneg_adv_cfg ( struct adin1320_desc * dev,
uint16_t autoneg_adv_speeds )

Configure Autonegotiation Advertisement Speeds for SerDes Media.

Parameters
dev- The device structure
autoneg_adv_speeds- Autoneg Adv speeds to enable (masked with adin1320_fi_speed)
Returns
0 in case of success, negative code otherwise

◆ adin1320_sd_config_interrupt()

int adin1320_sd_config_interrupt ( struct adin1320_desc * dev,
uint32_t callback_events )

Configure the interrupt mask register for serdes media.

Parameters
dev- The device structure
callback_events- Bitmask of interrupt events to enable
Returns
0 in case of success, negative code otherwise

◆ adin1320_sd_forced_speed()

int adin1320_sd_forced_speed ( struct adin1320_desc * dev,
enum adin1320_sd_speed forced_speed )

Set Force Speed for SerDes Media.

Note
This function places the device in software powerdown. The caller is responsible for calling adin1320_set_software_powerdown(dev, ADIN1320_SOFTWARE_POWERUP) to resume normal operation after the speed is configured.
Parameters
dev- The device structure
forced_speed- Forced speed to select
Returns
0 in case of success, negative code otherwise

◆ adin1320_sd_get_autoneg_adv()

int adin1320_sd_get_autoneg_adv ( struct adin1320_desc * dev,
uint16_t * autoneg_adv_speeds )

Get Enabled Autonegotiation Advertised Speeds for SerDes Media.

Parameters
dev- The device structure
autoneg_adv_speeds- Enabled Autoneg Adv speeds (masked with adin1320_fi_speed)
Returns
0 in case of success, negative code otherwise

◆ adin1320_sd_get_mii_status()

int adin1320_sd_get_mii_status ( struct adin1320_desc * dev,
struct adin1320_mii_status * mii_status )

Get Different Status from SerDes Media MII Status Register.

Parameters
dev- The device structure
mii_status- Initialized struct container for MII status to be filled
Returns
0 in case of success, negative code otherwise

◆ adin1320_sd_led_ctrl()

int adin1320_sd_led_ctrl ( struct adin1320_desc * dev,
enum adin1320_led_sel led_sel,
enum adin1320_sd_led_cfg led_cfg,
enum adin1320_led_inv_state led_inv_state )

Configure LED settings for SerDes Media.

Parameters
dev- The device structure
led_sel- LED to configure
led_cfg- LED configuration
led_inv_state- LED invert state
Returns
0 in case of success, negative code otherwise

◆ adin1320_sd_read_irq_status()

int adin1320_sd_read_irq_status ( struct adin1320_desc * dev,
bool * val_irq_pending,
uint16_t * val_irq_status )

Read interrupt status for serdes media.

Parameters
dev- The device structure
val_irq_pending- Set to true if any IRQ is pending, false otherwise
val_irq_status- The complete IRQ status register value showing status of all IRQs
Returns
0 in case of success, negative code otherwise

◆ adin1320_sd_resolved_speed()

int adin1320_sd_resolved_speed ( struct adin1320_desc * dev,
enum adin1320_sd_speed * resolved_speed )

Get Resolved Speed for SerDes Media.

Parameters
dev- The device structure
resolved_speed- Resolved speed read from SD_LINK_TYPE_CFG
Returns
0 in case of success, negative code otherwise

◆ adin1320_select_mac_interface()

int adin1320_select_mac_interface ( struct adin1320_desc * dev,
enum adin1320_mac_interface val )

MAC Interface Configuration.

Note
This function places the device in software powerdown. The caller is responsible for calling adin1320_set_software_powerdown(dev, ADIN1320_SOFTWARE_POWERUP) to resume normal operation after the interface is configured.
Parameters
dev- The device structure
val- Select MAC Interface
Returns
0 in case of success, negative code otherwise

◆ adin1320_set_downspeed_retries()

int adin1320_set_downspeed_retries ( struct adin1320_desc * dev,
uint16_t val )

Downspeed - Number of retries.

Parameters
dev- The device structure
val- Number of retries
Returns
0 in case of success, negative code otherwise

◆ adin1320_set_eee()

int adin1320_set_eee ( struct adin1320_desc * dev,
uint8_t eee_speeds )

Set Energy Efficient Ethernet speeds.

Parameters
dev- The device structure
eee_speeds- EEE speeds to enable (masked with adin1320_eee_speeds)
Returns
0 in case of success, negative code otherwise

◆ adin1320_set_software_powerdown()

int adin1320_set_software_powerdown ( struct adin1320_desc * dev,
enum adin1320_software_powerdown val )

Enter/exit Software Powerdown.

Parameters
dev- The device structure
val- Enter/exit Software Powerdown
Returns
0 in case of success, negative code otherwise

◆ adin1320_soft_reset()

int adin1320_soft_reset ( struct adin1320_desc * dev,
enum adin1320_soft_reset_option reset_cfg )

Select and Perform Device Reset.

Parameters
dev- The device structure
reset_cfg- Type of soft reset to perform
Returns
0 in case of success, negative code otherwise

◆ adin1320_wol_address()

int adin1320_wol_address ( struct adin1320_desc * dev,
uint8_t mac_address[6] )

Configure Wake-on-LAN Station Address.

Parameters
dev- The device structure
mac_address- Station MAC address (6 bytes)
Returns
0 in case of success, negative code otherwise

◆ adin1320_wol_en_cfg()

int adin1320_wol_en_cfg ( struct adin1320_desc * dev,
enum adin1320_wol_enable enable )

Enable/Disable Wake-on-LAN.

Parameters
dev- The device structure
enable- Enable/disable Wake-on-LAN
Returns
0 in case of success, negative code otherwise

◆ adin1320_wol_sig_cfg()

int adin1320_wol_sig_cfg ( struct adin1320_desc * dev,
enum adin1320_wol_sig signal_type,
uint8_t pulse_length )

Configure Wake-on-LAN Signal Settings.

Parameters
dev- The device structure
signal_type- Select the type of signal for wake-up
pulse_length- Pulse length duration selection
Returns
0 in case of success, negative code otherwise

◆ adin1320_wol_sys_cfg()

int adin1320_wol_sys_cfg ( struct adin1320_desc * dev,
enum adin1320_wol_fi_en enable_fi,
enum adin1320_wol_inv active_signal )

Configure Wake-on-LAN System Settings.

Parameters
dev- The device structure
enable_fi- Enable/disable wake-on-LAN detection from serdes interface
active_signal- Set active signal polarity
Returns
0 in case of success, negative code otherwise

◆ adin1320_wol_wake_cfg()

int adin1320_wol_wake_cfg ( struct adin1320_desc * dev,
enum adin1320_wol_wake_key_enable wake_on_key,
enum adin1320_wol_wake_link_enable wake_on_link_change )

Configure Wake-on-LAN Wake-up Events.

Parameters
dev- The device structure
wake_on_key- Enable/disable wake on Magic Packet key error
wake_on_link_change- Enable/disable wake on link status change
Returns
0 in case of success, negative code otherwise

◆ adin1320_write()

int adin1320_write ( struct adin1320_desc * dev,
uint32_t addr,
uint16_t val )

MDIO Write with Clause22 or Clause45.

Parameters
dev- The device structure
addr- Register Address
val- Value to write in the register
Returns
0 in case of success, negative code otherwise

◆ adin1320_write_bits()

int adin1320_write_bits ( struct adin1320_desc * dev,
uint32_t addr,
uint16_t val,
uint16_t bitmask )

MDIO Write with Clause22 or Clause45 on a Specific Bit.

Parameters
dev- The device structure
addr- Register Address
val- Masked value to write on the bitmask
bitmask- Mask for the bits to be written on
Returns
0 in case of success, negative code otherwise