Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jun 2019 03:40:00 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r349131 - head/sys/arm/allwinner
Message-ID:  <201906170340.x5H3e04g023120@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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),



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906170340.x5H3e04g023120>