Commit 738012be authored by Blue Swirl's avatar Blue Swirl
Browse files

Remove useless device dependency of HAS_AUDIO



System architecture dictates whether HAS_AUDIO is defined. It's then
useless to check for HAS_AUDIO in files which are only used on those
architectures which always have audio.
Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
parent 8a911107
......@@ -34,7 +34,6 @@
#define MP_AUDIO_CLOCK_24MHZ (1 << 9)
#define MP_AUDIO_MONO (1 << 14)
#ifdef HAS_AUDIO
typedef struct mv88w8618_audio_state {
SysBusDevice busdev;
qemu_irq irq;
......@@ -290,13 +289,10 @@ static SysBusDeviceInfo mv88w8618_audio_info = {
{/* end of list */}
}
};
#endif
static void mv88w8618_register_devices(void)
{
#ifdef HAS_AUDIO
sysbus_register_withprop(&mv88w8618_audio_info);
#endif
}
device_init(mv88w8618_register_devices)
......@@ -89,7 +89,6 @@ static CPUWriteMemoryFunc * const dma_dummy_write[3] = {
dma_dummy_writeb,
};
#ifdef HAS_AUDIO
static void audio_init(qemu_irq *pic)
{
struct soundhw *c;
......@@ -109,7 +108,6 @@ static void audio_init(qemu_irq *pic)
}
}
}
#endif
#define MAGNUM_BIOS_SIZE_MAX 0x7e000
#define MAGNUM_BIOS_SIZE (BIOS_SIZE < MAGNUM_BIOS_SIZE_MAX ? BIOS_SIZE : MAGNUM_BIOS_SIZE_MAX)
......@@ -288,9 +286,7 @@ void mips_jazz_init (ram_addr_t ram_size,
/* Sound card */
/* FIXME: missing Jazz sound at 0x8000c000, rc4030[2] */
#ifdef HAS_AUDIO
audio_init(i8259);
#endif
/* NVRAM: Unprotected at 0x9000, Protected at 0xa000, Read only at 0xb000 */
ds1225y_init(0x80009000, "nvram");
......
......@@ -456,7 +456,6 @@ static MaltaFPGAState *malta_fpga_init(target_phys_addr_t base, qemu_irq uart_ir
}
/* Audio support */
#ifdef HAS_AUDIO
static void audio_init (PCIBus *pci_bus)
{
struct soundhw *c;
......@@ -474,7 +473,6 @@ static void audio_init (PCIBus *pci_bus)
}
}
}
#endif
/* Network support */
static void network_init(void)
......@@ -970,9 +968,7 @@ void mips_malta_init (ram_addr_t ram_size,
floppy_controller = fdctrl_init_isa(fd);
/* Sound card */
#ifdef HAS_AUDIO
audio_init(pci_bus);
#endif
/* Network card */
network_init();
......
......@@ -1486,10 +1486,8 @@ static void musicpal_init(ram_addr_t ram_size,
DeviceState *i2c_dev;
DeviceState *lcd_dev;
DeviceState *key_dev;
#ifdef HAS_AUDIO
DeviceState *wm8750_dev;
SysBusDevice *s;
#endif
i2c_bus *i2c;
int i;
unsigned long flash_size;
......@@ -1611,7 +1609,6 @@ static void musicpal_init(ram_addr_t ram_size,
qdev_connect_gpio_out(key_dev, i, qdev_get_gpio_in(dev, i + 15));
}
#ifdef HAS_AUDIO
wm8750_dev = i2c_create_slave(i2c, "wm8750", MP_WM_ADDR);
dev = qdev_create(NULL, "mv88w8618_audio");
s = sysbus_from_qdev(dev);
......@@ -1619,7 +1616,6 @@ static void musicpal_init(ram_addr_t ram_size,
qdev_init_nofail(dev);
sysbus_mmio_map(s, 0, MP_AUDIO_BASE);
sysbus_connect_irq(s, 0, pic[MP_AUDIO_IRQ]);
#endif
musicpal_binfo.ram_size = MP_RAM_DEFAULT_SIZE;
musicpal_binfo.kernel_filename = kernel_filename;
......
......@@ -1973,13 +1973,11 @@ struct omap_eac_s *omap_eac_init(struct omap_target_agent_s *ta,
s->codec.txdrq = *drq;
omap_eac_reset(s);
#ifdef HAS_AUDIO
AUD_register_card("OMAP EAC", &s->codec.card);
iomemtype = cpu_register_io_memory(omap_eac_readfn,
omap_eac_writefn, s);
omap_l4_attach(ta, 0, iomemtype);
#endif
return s;
}
......
......@@ -721,7 +721,6 @@ static const int ne2000_irq[NE2000_NB_MAX] = { 9, 10, 11, 3, 4, 5 };
static const int parallel_io[MAX_PARALLEL_PORTS] = { 0x378, 0x278, 0x3bc };
static const int parallel_irq[MAX_PARALLEL_PORTS] = { 7, 7, 7 };
#ifdef HAS_AUDIO
void pc_audio_init (PCIBus *pci_bus, qemu_irq *pic)
{
struct soundhw *c;
......@@ -738,7 +737,6 @@ void pc_audio_init (PCIBus *pci_bus, qemu_irq *pic)
}
}
}
#endif
void pc_init_ne2k_isa(NICInfo *nd)
{
......
......@@ -140,9 +140,7 @@ static void pc_init1(ram_addr_t ram_size,
}
}
#ifdef HAS_AUDIO
pc_audio_init(pci_enabled ? pci_bus : NULL, isa_irq);
#endif
pc_cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device, hd,
floppy_controller, rtc_state);
......
......@@ -768,7 +768,6 @@ static void spitz_microdrive_attach(PXA2xxState *cpu, int slot)
#define SPITZ_GPIO_WM 5
#ifdef HAS_AUDIO
static void spitz_wm8750_addr(void *opaque, int line, int level)
{
i2c_slave *wm = (i2c_slave *) opaque;
......@@ -777,14 +776,12 @@ static void spitz_wm8750_addr(void *opaque, int line, int level)
else
i2c_set_slave_address(wm, SPITZ_WM_ADDRL);
}
#endif
static void spitz_i2c_setup(PXA2xxState *cpu)
{
/* Attach the CPU on one end of our I2C bus. */
i2c_bus *bus = pxa2xx_i2c_bus(cpu->i2c[0]);
#ifdef HAS_AUDIO
DeviceState *wm;
/* Attach a WM8750 to the bus */
......@@ -798,7 +795,6 @@ static void spitz_i2c_setup(PXA2xxState *cpu)
cpu->i2s->codec_out = wm8750_dac_dat;
cpu->i2s->codec_in = wm8750_adc_dat;
wm8750_data_req_set(wm, cpu->i2s->data_req, cpu->i2s);
#endif
}
static void spitz_akita_i2c_setup(PXA2xxState *cpu)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment