/* FIXME: If any other users of GPIO crop up, then these will have to * have some sort of global synchronization to avoid races with other * pins on the same port. The ideal solution would probably be to * bind the ports to a GPIO driver, and have this be a client of it.
*/ staticinlinevoid bb_set(u32 __iomem *p, u32 m)
{
out_be32(p, in_be32(p) | m);
}
int ret = of_address_to_resource(np, 0, &res); if (ret) return ret;
if (resource_size(&res) <= 13) return -ENODEV;
/* This should really encode the pin number as well, but all * we get is an int, and the odds of multiple bitbang mdio buses * is low enough that it's not worth going too crazy.
*/
snprintf(bus->id, MII_BUS_ID_SIZE, "%pa", &res.start);
data = of_get_property(np, "fsl,mdio-pin", &len); if (!data || len != 4) return -ENODEV;
mdio_pin = *data;
data = of_get_property(np, "fsl,mdc-pin", &len); if (!data || len != 4) return -ENODEV;
mdc_pin = *data;
bitbang->dir = ioremap(res.start, resource_size(&res)); if (!bitbang->dir) return -ENOMEM;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.