audio: create pcspk device early

Create the pcspk device early, so it exists at
machine type initialization time.

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: [email protected]
This commit is contained in:
Gerd Hoffmann committed 2020-07-06 17:01:11 +02:00
1 parent 525d654d7a
commit 6b8d141648
2 files changed
+3 -1

No files matched your search

+2 -1
View File
@@ -1219,7 +1219,7 @@ void pc_basic_device_init(struct PCMachineState *pcms,
/* connect PIT to output control line of the HPET */
qdev_connect_gpio_out(hpet, 0, qdev_get_gpio_in(DEVICE(pit), 0));
}
pcspk_init(isa_new(TYPE_PC_SPEAKER), isa_bus, pit);
pcspk_init(pcms->pcspk, isa_bus, pit);
}
i8257_dma_init(isa_bus, 0);
@@ -1891,6 +1891,7 @@ static void pc_machine_initfn(Object *obj)
pcms->pit_enabled = true;
pc_system_flash_create(pcms);
pcms->pcspk = isa_new(TYPE_PC_SPEAKER);
}
static void pc_machine_reset(MachineState *machine)
+1
View File
@@ -33,6 +33,7 @@ struct PCMachineState {
PCIBus *bus;
I2CBus *smbus;
PFlashCFI01 *flash[2];
ISADevice *pcspk;
/* Configuration options: */
uint64_t max_ram_below_4g;