On Mon, Aug 4, 2014 at 11:53 AM, Peter Crosthwaite <peter.crosthwa...@xilinx.com> wrote: > Within the object that contains the GPIO output. This allows for > connecting GPIO outputs via setting of a Link property. > > Signed-off-by: Peter Crosthwaite <peter.crosthwa...@xilinx.com> > --- > > hw/core/qdev.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/hw/core/qdev.c b/hw/core/qdev.c > index 35c266a..5f55709 100644 > --- a/hw/core/qdev.c > +++ b/hw/core/qdev.c > @@ -362,12 +362,23 @@ void qdev_init_gpio_in(DeviceState *dev, > qemu_irq_handler handler, int n) > void qdev_init_gpio_out_named(DeviceState *dev, qemu_irq *pins, > const char *name, int n) > { > + int i; > NamedGPIOList *gpio_list = qdev_get_named_gpio_list(dev, name); > > assert(gpio_list->num_in == 0 || !name); > assert(gpio_list->num_out == 0); > gpio_list->num_out = n; > gpio_list->out = pins; > + > + char *propname = g_strdup_printf("%s[*]", name ? name : > "unnamed-gpio-out");
Moved this up the function in V2. sry. Regards, Peter > + for (i = 0; i < n; ++i) { > + object_property_add_link(OBJECT(dev), propname, TYPE_IRQ, > + (Object **)&pins[i], > + object_property_allow_set_link, > + OBJ_PROP_LINK_UNREF_ON_RELEASE, > + &error_abort); > + } > + g_free(propname); > } > > void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n) > -- > 2.0.1.1.gfbfc394 >