From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTGbV-0004AT-Aa for qemu-devel@nongnu.org; Tue, 09 Feb 2016 17:17:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTGbQ-00017a-IN for qemu-devel@nongnu.org; Tue, 09 Feb 2016 17:17:49 -0500 Received: from mail-cys01nam02on0085.outbound.protection.outlook.com ([104.47.37.85]:39040 helo=NAM02-CY1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTGbQ-000177-9z for qemu-devel@nongnu.org; Tue, 09 Feb 2016 17:17:44 -0500 From: Alistair Francis Date: Tue, 9 Feb 2016 14:15:05 -0800 Message-ID: <7011c0c792431c5cb307e74b2e98a57295c5fddd.1455055858.git.alistair.francis@xilinx.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v4 12/16] qdev: Add qdev_pass_all_gpios API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, peter.maydell@linaro.org Cc: edgar.iglesias@xilinx.com, alistair.francis@xilinx.com, crosthwaitepeter@gmail.com, edgar.iglesias@gmail.com, alex.bennee@linaro.org, afaerber@suse.de, fred.konrad@greensocs.com From: Peter Crosthwaite For passing all GPIOs of all names from a contained device to a container. Signed-off-by: Peter Crosthwaite Signed-off-by: Alistair Francis --- hw/core/qdev.c | 9 +++++++++ include/hw/qdev-core.h | 1 + 2 files changed, 10 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index e3015d2..371fba0 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -589,6 +589,15 @@ void qdev_pass_gpios(DeviceState *dev, DeviceState *container, QLIST_INSERT_HEAD(&container->gpios, ngl, node); } +void qdev_pass_all_gpios(DeviceState *dev, DeviceState *container) +{ + NamedGPIOList *ngl; + + QLIST_FOREACH(ngl, &dev->gpios, node) { + qdev_pass_gpios(dev, container, ngl->name); + } +} + BusState *qdev_get_child_bus(DeviceState *dev, const char *name) { BusState *bus; diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 0a09b8a..753673c 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -312,6 +312,7 @@ void qdev_init_gpio_out_named(DeviceState *dev, qemu_irq *pins, void qdev_pass_gpios(DeviceState *dev, DeviceState *container, const char *name); +void qdev_pass_all_gpios(DeviceState *dev, DeviceState *container); BusState *qdev_get_parent_bus(DeviceState *dev); -- 2.5.0