mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Ignore "gpio-hog" nodes when instantiating ofw_gpiobus children. Also,
in ofw_gpiobus_probe() return BUS_PROBE_DEFAULT rather than 0; we are not the only possible driver to handle this device, we're just slightly better than the base gpiobus (which probes at BUS_PROBE_GENERIC). In the time since this code was first written, the gpio controller bindings aquired the concept of a "hog" node which could be used to preset one or more gpio pins as input or output at a specified level. This change doesn't fully implement the hogging concept, it just filters out hog nodes when instantiating child devices by scanning for child nodes in the fdt data. The whole concept of having child nodes under the controller node is not supported by the standard bindings, and appears to be a freebsd extension, probably left over from the days when we had no support for cross-tree phandle references in the fdt data.
This commit is contained in:
parent
ef3e1e13b6
commit
846419f898
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355214
@ -492,7 +492,7 @@ ofw_gpiobus_probe(device_t dev)
|
||||
return (ENXIO);
|
||||
device_set_desc(dev, "OFW GPIO bus");
|
||||
|
||||
return (0);
|
||||
return (BUS_PROBE_DEFAULT);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -511,6 +511,8 @@ ofw_gpiobus_attach(device_t dev)
|
||||
*/
|
||||
for (child = OF_child(ofw_bus_get_node(dev)); child != 0;
|
||||
child = OF_peer(child)) {
|
||||
if (OF_hasprop(child, "gpio-hog"))
|
||||
continue;
|
||||
if (!OF_hasprop(child, "gpios"))
|
||||
continue;
|
||||
if (ofw_gpiobus_add_fdt_child(dev, NULL, child) == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user