Implement the ofw_bus_get_node method in aw_pwm(4) so that ofw_pwmbus can

find its metadata for instantiating children.
This commit is contained in:
Ian Lepore 2019-06-17 03:40:00 +00:00
parent b43e2c8b56
commit 0a06f11da3

View File

@ -223,6 +223,17 @@ aw_pwm_detach(device_t dev)
return (0);
}
static phandle_t
aw_pwm_get_node(device_t bus, device_t dev)
{
/*
* Share our controller node with our pwmbus child; it instantiates
* devices by walking the children contained within our node.
*/
return ofw_bus_get_node(bus);
}
static int
aw_pwm_channel_count(device_t dev, u_int *nchannel)
{
@ -350,6 +361,9 @@ static device_method_t aw_pwm_methods[] = {
DEVMETHOD(device_attach, aw_pwm_attach),
DEVMETHOD(device_detach, aw_pwm_detach),
/* ofw_bus interface */
DEVMETHOD(ofw_bus_get_node, aw_pwm_get_node),
/* pwmbus interface */
DEVMETHOD(pwmbus_channel_count, aw_pwm_channel_count),
DEVMETHOD(pwmbus_channel_config, aw_pwm_channel_config),