Lines Matching +full:read +full:- +full:cmd
4 * SPDX-License-Identifier: Apache-2.0
39 const struct mdio_adin2111_config *const cfg = dev->config; in mdio_adin2111_wait_ready()
44 ret = eth_adin2111_reg_read(cfg->adin, reg, out); in mdio_adin2111_wait_ready()
49 ret = -ETIMEDOUT; in mdio_adin2111_wait_ready()
62 const struct mdio_adin2111_config *const cfg = dev->config; in mdio_adin2111_read_c45()
64 uint32_t cmd; in mdio_adin2111_read_c45() local
68 cmd = (prtad & 0x1FU) << 21; in mdio_adin2111_read_c45()
69 cmd |= (devad & 0x1FU) << 16; in mdio_adin2111_read_c45()
70 cmd |= regad; in mdio_adin2111_read_c45()
72 ret = eth_adin2111_reg_write(cfg->adin, ADIN2111_MDIOACC0, cmd); in mdio_adin2111_read_c45()
77 /* read op */ in mdio_adin2111_read_c45()
78 cmd = (cmd & ~UINT16_MAX) | (0x3U << 26); in mdio_adin2111_read_c45()
80 ret = eth_adin2111_reg_write(cfg->adin, ADIN2111_MDIOACC1, cmd); in mdio_adin2111_read_c45()
90 /* read out */ in mdio_adin2111_read_c45()
91 ret = eth_adin2111_reg_read(cfg->adin, ADIN2111_MDIOACC1, &cmd); in mdio_adin2111_read_c45()
93 *data = cmd & UINT16_MAX; in mdio_adin2111_read_c45()
102 const struct mdio_adin2111_config *const cfg = dev->config; in mdio_adin2111_write_c45()
105 uint32_t cmd; in mdio_adin2111_write_c45() local
109 cmd = (prtad & 0x1FU) << 21; in mdio_adin2111_write_c45()
110 cmd |= (devad & 0x1FU) << 16; in mdio_adin2111_write_c45()
111 cmd |= regad; in mdio_adin2111_write_c45()
113 ret = eth_adin2111_reg_write(cfg->adin, ADIN2111_MDIOACC0, cmd); in mdio_adin2111_write_c45()
119 cmd |= BIT(26); in mdio_adin2111_write_c45()
120 cmd = (cmd & ~UINT16_MAX) | data; in mdio_adin2111_write_c45()
122 ret = eth_adin2111_reg_write(cfg->adin, ADIN2111_MDIOACC1, cmd); in mdio_adin2111_write_c45()
135 const struct mdio_adin2111_config *const cfg = dev->config; in mdio_adin2111_read()
136 uint32_t read; in mdio_adin2111_read() local
137 uint32_t cmd; in mdio_adin2111_read() local
140 cmd = BIT(28); in mdio_adin2111_read()
141 cmd |= 0x3U << 26; in mdio_adin2111_read()
142 cmd |= (prtad & 0x1FU) << 21; in mdio_adin2111_read()
143 cmd |= (regad & 0x1FU) << 16; in mdio_adin2111_read()
145 ret = eth_adin2111_reg_write(cfg->adin, ADIN2111_MDIOACC0, cmd); in mdio_adin2111_read()
147 ret = mdio_adin2111_wait_ready(dev, ADIN2111_MDIOACC0, &read); in mdio_adin2111_read()
148 *data = read & UINT16_MAX; in mdio_adin2111_read()
157 const struct mdio_adin2111_config *const cfg = dev->config; in mdio_adin2111_write()
158 uint32_t cmd; in mdio_adin2111_write() local
162 cmd = BIT(28); in mdio_adin2111_write()
163 cmd |= BIT(26); in mdio_adin2111_write()
164 cmd |= (prtad & 0x1FU) << 21; in mdio_adin2111_write()
165 cmd |= (regad & 0x1FU) << 16; in mdio_adin2111_write()
166 cmd |= data; in mdio_adin2111_write()
168 ret = eth_adin2111_reg_write(cfg->adin, ADIN2111_MDIOACC0, cmd); in mdio_adin2111_write()
178 const struct mdio_adin2111_config *const cfg = dev->config; in mdio_adin2111_bus_enable()
180 eth_adin2111_lock(cfg->adin, K_FOREVER); in mdio_adin2111_bus_enable()
185 const struct mdio_adin2111_config *const cfg = dev->config; in mdio_adin2111_bus_disable()
187 eth_adin2111_unlock(cfg->adin); in mdio_adin2111_bus_disable()
191 .read = mdio_adin2111_read,