Lines Matching +full:mdio +full:- +full:pin
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2006-2007 PA Semi, Inc
9 * Based on drivers/net/fs_enet/mii-bitbang.c.
34 #define MDC_PIN(bus) (((struct gpio_priv *)bus->priv)->mdc_pin)
35 #define MDIO_PIN(bus) (((struct gpio_priv *)bus->priv)->mdio_pin)
124 /* tri-state our MDIO I/O pin so we can read */ in gpio_mdio_read()
190 * Tri-state the MDIO line. in gpio_mdio_write()
202 /*nothing here - dunno how to reset it*/ in gpio_mdio_reset()
209 struct device *dev = &ofdev->dev; in gpio_mdio_probe()
210 struct device_node *np = ofdev->dev.of_node; in gpio_mdio_probe()
216 err = -ENOMEM; in gpio_mdio_probe()
226 new_bus->name = "pasemi gpio mdio bus"; in gpio_mdio_probe()
227 new_bus->read = &gpio_mdio_read; in gpio_mdio_probe()
228 new_bus->write = &gpio_mdio_write; in gpio_mdio_probe()
229 new_bus->reset = &gpio_mdio_reset; in gpio_mdio_probe()
232 snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", *prop); in gpio_mdio_probe()
233 new_bus->priv = priv; in gpio_mdio_probe()
235 prop = of_get_property(np, "mdc-pin", NULL); in gpio_mdio_probe()
236 priv->mdc_pin = *prop; in gpio_mdio_probe()
238 prop = of_get_property(np, "mdio-pin", NULL); in gpio_mdio_probe()
239 priv->mdio_pin = *prop; in gpio_mdio_probe()
241 new_bus->parent = dev; in gpio_mdio_probe()
247 pr_err("%s: Cannot register as MDIO bus, err %d\n", in gpio_mdio_probe()
248 new_bus->name, err); in gpio_mdio_probe()
265 struct mii_bus *bus = dev_get_drvdata(&dev->dev); in gpio_mdio_remove()
269 dev_set_drvdata(&dev->dev, NULL); in gpio_mdio_remove()
271 kfree(bus->priv); in gpio_mdio_remove()
272 bus->priv = NULL; in gpio_mdio_remove()
279 .compatible = "gpio-mdio",
290 .name = "gpio-mdio-bitbang",
299 np = of_find_compatible_node(NULL, NULL, "1682m-gpio"); in gpio_mdio_init()
302 "pasemi,pwrficient-gpio"); in gpio_mdio_init()
304 return -ENODEV; in gpio_mdio_init()
309 return -ENODEV; in gpio_mdio_init()
325 MODULE_DESCRIPTION("Driver for MDIO over GPIO on PA Semi PWRficient-based boards");