mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-31 14:02:05 -06:00
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>
This commit is contained in:
parent
baf21eebc3
commit
e2b84ee416
1 changed files with 9 additions and 0 deletions
|
@ -522,10 +522,19 @@ void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d)
|
||||||
bm->pci_dev = 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 = {
|
static const TypeInfo pci_ide_type_info = {
|
||||||
.name = TYPE_PCI_IDE,
|
.name = TYPE_PCI_IDE,
|
||||||
.parent = TYPE_PCI_DEVICE,
|
.parent = TYPE_PCI_DEVICE,
|
||||||
.instance_size = sizeof(PCIIDEState),
|
.instance_size = sizeof(PCIIDEState),
|
||||||
|
.instance_init = pci_ide_init,
|
||||||
.abstract = true,
|
.abstract = true,
|
||||||
.interfaces = (InterfaceInfo[]) {
|
.interfaces = (InterfaceInfo[]) {
|
||||||
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
|
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue