From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adOtJ-00064U-On for qemu-devel@nongnu.org; Tue, 08 Mar 2016 16:10:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adOtG-0002tr-HI for qemu-devel@nongnu.org; Tue, 08 Mar 2016 16:10:05 -0500 Received: from mail-cys01nam02on0072.outbound.protection.outlook.com ([104.47.37.72]:27904 helo=NAM02-CY1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adOtG-0002sq-B6 for qemu-devel@nongnu.org; Tue, 08 Mar 2016 16:10:02 -0500 From: Alistair Francis Date: Tue, 8 Mar 2016 13:06:56 -0800 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v5 11/15] 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 25aa9e9..ce64fa1 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -311,6 +311,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