Lines Matching +full:c +full:- +full:45

1 // SPDX-License-Identifier: GPL-2.0
6 * Copyright (c) 2007 Freescale Semiconductor
10 * Copyright (c) 2003 Intracom S.A.
13 * 2005 (c) MontaVista Software, Inc.
18 #include <linux/mdio-bitbang.h>
46 const struct mdiobb_ops *ops = ctrl->ops; in mdiobb_send_bit()
48 ops->set_mdio_data(ctrl, val); in mdiobb_send_bit()
50 ops->set_mdc(ctrl, 1); in mdiobb_send_bit()
52 ops->set_mdc(ctrl, 0); in mdiobb_send_bit()
58 const struct mdiobb_ops *ops = ctrl->ops; in mdiobb_get_bit()
61 ops->set_mdc(ctrl, 1); in mdiobb_get_bit()
63 ops->set_mdc(ctrl, 0); in mdiobb_get_bit()
65 return ops->get_mdio_data(ctrl); in mdiobb_get_bit()
73 for (i = bits - 1; i >= 0; i--) in mdiobb_send_num()
83 for (i = bits - 1; i >= 0; i--) { in mdiobb_get_num()
96 const struct mdiobb_ops *ops = ctrl->ops; in mdiobb_cmd()
99 ops->set_mdio_dir(ctrl, 1); in mdiobb_cmd()
114 Clause 45 operation uses 00 for the start and 11, 10 for in mdiobb_cmd()
128 /* In clause 45 mode all commands are prefixed by MDIO_ADDR to specify the
130 MDIO_WRITE except for a different code. To enable clause 45 mode or
131 MII_ADDR_C45 into the address. Theoretically clause 45 and normal devices
146 ctrl->ops->set_mdio_dir(ctrl, 0); in mdiobb_cmd_addr()
154 struct mdiobb_ctrl *ctrl = bus->priv; in mdiobb_read()
161 mdiobb_cmd(ctrl, ctrl->op_c22_read, phy, reg); in mdiobb_read()
163 ctrl->ops->set_mdio_dir(ctrl, 0); in mdiobb_read()
169 !(bus->phy_ignore_ta_mask & (1 << phy))) { in mdiobb_read()
170 /* PHY didn't drive TA low -- flush any bits it in mdiobb_read()
187 struct mdiobb_ctrl *ctrl = bus->priv; in mdiobb_write()
193 mdiobb_cmd(ctrl, ctrl->op_c22_write, phy, reg); in mdiobb_write()
201 ctrl->ops->set_mdio_dir(ctrl, 0); in mdiobb_write()
215 __module_get(ctrl->ops->owner); in alloc_mdio_bitbang()
217 bus->read = mdiobb_read; in alloc_mdio_bitbang()
218 bus->write = mdiobb_write; in alloc_mdio_bitbang()
219 bus->priv = ctrl; in alloc_mdio_bitbang()
220 if (!ctrl->override_op_c22) { in alloc_mdio_bitbang()
221 ctrl->op_c22_read = MDIO_READ; in alloc_mdio_bitbang()
222 ctrl->op_c22_write = MDIO_WRITE; in alloc_mdio_bitbang()
231 struct mdiobb_ctrl *ctrl = bus->priv; in free_mdio_bitbang()
233 module_put(ctrl->ops->owner); in free_mdio_bitbang()