Author: ian
Date: Mon Jun 17 03:40:00 2019
New Revision: 349131
URL: https://svnweb.freebsd.org/changeset/base/349131

Log:
  Implement the ofw_bus_get_node method in aw_pwm(4) so that ofw_pwmbus can
  find its metadata for instantiating children.

Modified:
  head/sys/arm/allwinner/aw_pwm.c

Modified: head/sys/arm/allwinner/aw_pwm.c
==============================================================================
--- head/sys/arm/allwinner/aw_pwm.c     Mon Jun 17 03:32:05 2019        
(r349130)
+++ head/sys/arm/allwinner/aw_pwm.c     Mon Jun 17 03:40:00 2019        
(r349131)
@@ -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)
 {
@@ -349,6 +360,9 @@ static device_method_t aw_pwm_methods[] = {
        DEVMETHOD(device_probe,         aw_pwm_probe),
        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),
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to