From 0c24db2b8c60cb578d7af6fb50c0ad60a723a02d Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Thu, 25 Sep 2014 22:20:58 -0700 Subject: qdev: gpio: Add API for intercepting a GPIO To replace the old qemu_irq intercept API (which had users reaching into qdev private state for GPIOs). Reviewed-by: Alexander Graf Signed-off-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- include/hw/qdev-core.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/hw/qdev-core.h') diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 1fca75c..cf27e65 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -273,6 +273,8 @@ qemu_irq qdev_get_gpio_in_named(DeviceState *dev, const char *name, int n); void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin); void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n, qemu_irq pin); +qemu_irq qdev_intercept_gpio_out(DeviceState *dev, qemu_irq icpt, + const char *name, int n); BusState *qdev_get_child_bus(DeviceState *dev, const char *name); -- cgit v1.1 From 15942b65697c7016a8ca836ecbfd9777d959187c Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Thu, 25 Sep 2014 22:22:36 -0700 Subject: qdev: gpio: delete NamedGPIOList::out All users of GPIO outputs are fully QOMified, using QOM properties to access the GPIO data. Delete. Reviewed-by: Alexander Graf Signed-off-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- include/hw/qdev-core.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/hw/qdev-core.h') diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index cf27e65..86d341f 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -136,7 +136,6 @@ struct NamedGPIOList { char *name; qemu_irq *in; int num_in; - qemu_irq *out; int num_out; QLIST_ENTRY(NamedGPIOList) node; }; -- cgit v1.1 From 17a96a146cb5195ab1f6b5cf48645f9f6450539f Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Thu, 25 Sep 2014 22:23:42 -0700 Subject: qdev: gpio: Define qdev_pass_gpios() Allows a container to take ownership of GPIOs in a contained device and automatically connect them as GPIOs to the container. This prepares for deprecation of the SYSBUS IRQ functionality, which has this feature. We push it up to the device level instead of sysbus level. There's nothing sysbus specific about passing GPIOs to containers so its a legitimate device-level generic feature. Reviewed-by: Alexander Graf Signed-off-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- include/hw/qdev-core.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/hw/qdev-core.h') diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 86d341f..a7327fd 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -288,6 +288,9 @@ void qdev_init_gpio_in_named(DeviceState *dev, qemu_irq_handler handler, void qdev_init_gpio_out_named(DeviceState *dev, qemu_irq *pins, const char *name, int n); +void qdev_pass_gpios(DeviceState *dev, DeviceState *container, + const char *name); + BusState *qdev_get_parent_bus(DeviceState *dev); /*** BUS API. ***/ -- cgit v1.1