aboutsummaryrefslogtreecommitdiff
path: root/hw/ide
diff options
context:
space:
mode:
authorBernhard Beschow <shentey@gmail.com>2023-05-31 23:10:37 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2023-07-11 00:11:25 +0200
commite2b84ee41671edcaf975f88367f793e96e84b7c2 (patch)
tree604b11d4ff036571675ca2ce8b6d255698694e95 /hw/ide
parentbaf21eebc3e1026d21d94fdf8ca470050e49968f (diff)
hw/ide/pci: Expose legacy interrupts as named GPIOs
Exposing the legacy IDE interrupts as GPIOs allows them to be connected in the parent device through qdev_connect_gpio_out(), i.e. without accessing private data of TYPE_PCI_IDE. Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Message-Id: <20230531211043.41724-2-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'hw/ide')
-rw-r--r--hw/ide/pci.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index fc9224bbc9..9a5a7089d4 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -522,10 +522,19 @@ void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d)
bm->pci_dev = d;
}
+static void pci_ide_init(Object *obj)
+{
+ PCIIDEState *d = PCI_IDE(obj);
+
+ qdev_init_gpio_out_named(DEVICE(d), d->isa_irq, "isa-irq",
+ ARRAY_SIZE(d->isa_irq));
+}
+
static const TypeInfo pci_ide_type_info = {
.name = TYPE_PCI_IDE,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(PCIIDEState),
+ .instance_init = pci_ide_init,
.abstract = true,
.interfaces = (InterfaceInfo[]) {
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },