[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 1/7] hw/ide/pci: Expose legacy interrupts as named GPIOs
From: |
Bernhard Beschow |
Subject: |
[PATCH v3 1/7] hw/ide/pci: Expose legacy interrupts as named GPIOs |
Date: |
Wed, 31 May 2023 23:10:37 +0200 |
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>
---
hw/ide/pci.c | 9 +++++++++
1 file changed, 9 insertions(+)
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 },
--
2.40.1
- [PATCH v3 0/7] VIA and general PCI IDE cleanup, Bernhard Beschow, 2023/05/31
- [PATCH v3 1/7] hw/ide/pci: Expose legacy interrupts as named GPIOs,
Bernhard Beschow <=
- [PATCH v3 2/7] hw/ide/via: Wire up IDE legacy interrupts in host device, Bernhard Beschow, 2023/05/31
- [PATCH v3 3/7] hw/isa/vt82c686: Remove via_isa_set_irq(), Bernhard Beschow, 2023/05/31
- [PATCH v3 6/7] hw/ide/pci: Replace some magic numbers by constants, Bernhard Beschow, 2023/05/31
- [PATCH v3 5/7] hw/ide: Extract bmdma_status_writeb(), Bernhard Beschow, 2023/05/31
- [PATCH v3 7/7] hw/ide/piix: Move registration of VMStateDescription to DeviceClass, Bernhard Beschow, 2023/05/31
- [PATCH v3 4/7] hw/ide: Extract IDEBus assignment into bmdma_init(), Bernhard Beschow, 2023/05/31