15 #include <linux/module.h>
17 #include <linux/slab.h>
20 #include <linux/netdevice.h>
22 #include <linux/mii.h>
71 static inline int mdio_read(
struct mdiobb_ctrl *ctrl)
106 .set_mdio_dir = mdio_dir,
107 .set_mdio_data = mdio,
108 .get_mdio_data = mdio_read,
116 int mdio_pin, mdc_pin,
len;
123 if (resource_size(&
res) <= 13)
133 if (!data || len != 4)
138 if (!data || len != 4)
146 bitbang->
dat = bitbang->
dir + 4;
147 bitbang->
mdio_msk = 1 << (31 - mdio_pin);
148 bitbang->
mdc_msk = 1 << (31 - mdc_pin);
163 bitbang->
ctrl.ops = &bb_ops;
169 new_bus->
name =
"CPM2 Bitbanged MII",
171 ret = fs_mii_bitbang_init(new_bus, ofdev->
dev.of_node);
221 .compatible =
"fsl,cpm2-mdio-bitbang",
229 .name =
"fsl-bb-mdio",
231 .of_match_table = fs_enet_mdio_bb_match,
233 .probe = fs_enet_mdio_probe,
234 .remove = fs_enet_mdio_remove,