From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKXuY-0004wA-DX for qemu-devel@nongnu.org; Wed, 29 Jul 2015 16:25:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKXuT-0002p4-KQ for qemu-devel@nongnu.org; Wed, 29 Jul 2015 16:25:10 -0400 Received: from mail-bn1bon0067.outbound.protection.outlook.com ([157.56.111.67]:28448 helo=na01-bn1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKXuT-0002nE-FO for qemu-devel@nongnu.org; Wed, 29 Jul 2015 16:25:05 -0400 From: Alistair Francis Date: Wed, 29 Jul 2015 13:25:01 -0700 Message-ID: <2b1cacbb49ec4ad0d83d1313477477e47b79b8f2.1438200827.git.alistair.francis@xilinx.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v1 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 Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, alistair.francis@xilinx.com, crosthwaitepeter@gmail.com, edgar.iglesias@gmail.com, afaerber@suse.de From: Peter Crosthwaite For passing all GPIOs of all names from a contained device to a container. Signed-off-by: Peter Crosthwaite --- hw/core/qdev.c | 9 +++++++++ include/hw/qdev-core.h | 1 + 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 3594151..75f8139 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -576,6 +576,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 0a21d57..1cf44e1 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -299,6 +299,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); -- 1.7.1