Lines Matching +full:init +full:- +full:mdio +full:- +full:phy

4  * SPDX-License-Identifier: Apache-2.0
10 #include <zephyr/init.h>
12 #include <zephyr/drivers/mdio.h>
44 if (litex_read8(dev_cfg->r_addr) & LITEX_MDIO_DI) { in mdio_litex_read()
47 litex_write8(LITEX_MDIO_CLK, dev_cfg->w_addr); in mdio_litex_read()
49 litex_write8(0, dev_cfg->w_addr); in mdio_litex_read()
65 v_data <<= 32 - v_len; in mdio_litex_write()
68 litex_write8(LITEX_MDIO_DO | LITEX_MDIO_OE, dev_cfg->w_addr); in mdio_litex_write()
71 dev_cfg->w_addr); in mdio_litex_write()
73 litex_write8(LITEX_MDIO_DO | LITEX_MDIO_OE, dev_cfg->w_addr); in mdio_litex_write()
75 litex_write8(LITEX_MDIO_OE, dev_cfg->w_addr); in mdio_litex_write()
77 litex_write8(LITEX_MDIO_CLK | LITEX_MDIO_OE, dev_cfg->w_addr); in mdio_litex_write()
79 litex_write8(LITEX_MDIO_OE, dev_cfg->w_addr); in mdio_litex_write()
82 v_len--; in mdio_litex_write()
89 litex_write8(LITEX_MDIO_CLK, dev_cfg->w_addr); in mdio_litex_turnaround()
91 litex_write8(0, dev_cfg->w_addr); in mdio_litex_turnaround()
93 litex_write8(LITEX_MDIO_CLK, dev_cfg->w_addr); in mdio_litex_turnaround()
95 litex_write8(0, dev_cfg->w_addr); in mdio_litex_turnaround()
101 const struct mdio_litex_config *const dev_cfg = dev->config; in mdio_litex_transfer()
102 struct mdio_litex_data *const dev_data = dev->data; in mdio_litex_transfer()
104 k_sem_take(&dev_data->sem, K_FOREVER); in mdio_litex_transfer()
106 litex_write8(LITEX_MDIO_OE, dev_cfg->w_addr); in mdio_litex_transfer()
113 /* PA5: 5 bits PHY address */ in mdio_litex_transfer()
119 /* TA: 2 bits turn-around */ in mdio_litex_transfer()
129 k_sem_give(&dev_data->sem); in mdio_litex_transfer()
148 struct mdio_litex_data *const dev_data = dev->data; in mdio_litex_initialize()
150 k_sem_init(&dev_data->sem, 1, 1); in mdio_litex_initialize()
155 static DEVICE_API(mdio, mdio_litex_driver_api) = {