summaryrefslogtreecommitdiff
path: root/hw/audio
AgeCommit message (Collapse)Author
2018-03-26hw/audio: Fix crashes when devices are used on ISA bus without DMAThomas Huth
The cs4231a, gus and sb16 sound cards crash QEMU when the user tries to instantiate them on a machine with DMA-less ISA bus (for example with "qemu-system-mips64el -M mips -device sb16"). Add proper checks to the realize functions to avoid the crashes. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1521193892-15552-4-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-02-02hw/audio/sb16.c: change dolog() to qemu_log_mask()John Arbuckle
Changes all the occurrances of dolog() to qemu_log_mask(). Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Message-id: 20180201172744.7504-1-programmingkidx@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-02-02hw/audio/wm8750: move WM8750 declarations from i2c/i2c.h to audio/wm8750.hPhilippe Mathieu-Daudé
while here use TYPE_WM8750 and declare a data_req_cb() typedef. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20170919123053.32675-1-f4bug@amsat.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-01-22Replace all occurances of __FUNCTION__ with __func__Alistair Francis
Replace all occurs of __FUNCTION__ except for the check in checkpatch with the non GCC specific __func__. One line in hcd-musb.c was manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> [THH: Removed hunks related to pxa2xx_mmci.c (fixed already)] Signed-off-by: Thomas Huth <thuth@redhat.com>
2017-12-18misc: remove old i386 dependencyPhilippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-12-18misc: remove headers implicitly includedPhilippe Mathieu-Daudé
applied using ./scripts/clean-includes Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-12-18hw: use "qemu/osdep.h" as first #include in source filesPhilippe Mathieu-Daudé
applied using ./scripts/clean-includes Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-10-15pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devicesEduardo Habkost
Add INTERFACE_CONVENTIONAL_PCI_DEVICE to all direct subtypes of TYPE_PCI_DEVICE, except: 1) The ones that already have INTERFACE_PCIE_DEVICE set: * base-xhci * e1000e * nvme * pvscsi * vfio-pci * virtio-pci * vmxnet3 2) base-pci-bridge Not all PCI bridges are Conventional PCI devices, so INTERFACE_CONVENTIONAL_PCI_DEVICE is added only to the subtypes that are actually Conventional PCI: * dec-21154-p2p-bridge * i82801b11-bridge * pbm-bridge * pci-bridge The direct subtypes of base-pci-bridge not touched by this patch are: * xilinx-pcie-root: Already marked as PCIe-only. * pcie-pci-bridge: Already marked as PCIe-only. * pcie-port: all non-abstract subtypes of pcie-port are already marked as PCIe-only devices. 3) megasas-base Not all megasas devices are Conventional PCI devices, so the interface names are added to the subclasses registered by megasas_register_types(), according to information in the megasas_devices[] array. "megasas-gen2" already implements INTERFACE_PCIE_DEVICE, so add INTERFACE_CONVENTIONAL_PCI_DEVICE only to "megasas". Acked-by: Alberto Garcia <berto@igalia.com> Acked-by: John Snow <jsnow@redhat.com> Acked-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-09-27migration: pre_save return intDr. David Alan Gilbert
Modify the pre_save method on VMStateDescription to return an int rather than void so that it potentially can fail. Changed zillions of devices to make them return 0; the only case I've made it return non-0 is hw/intc/s390_flic_kvm.c that already had an error_report/return case. Note: If you add an error exit in your pre_save you must emit an error_report to say why. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20170925112917.21340-2-dgilbert@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2017-09-18audio: intel-hda: do not use old_mmio accessesMatt Parker
intel-hda is currently using the old_mmio accessors for io. This updates the device to use .read and .write accessors instead. Signed-off-by: Matt Parker <mtparkr@gmail.com> Message-id: 20170827192038.28930-1-mtparkr@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-09-18wm8750: add record buffer underrun checkGerd Hoffmann
Reported-by: niuguoxiang@huawei.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170901131409.6712-1-kraxel@redhat.com
2017-08-31pcspk: use QEMU_ALIGN_DOWNMarc-André Lureau
I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2017-08-01trace-events: fix code style: print 0x before hex numbersVladimir Sementsov-Ogievskiy
The only exception are groups of numers separated by symbols '.', ' ', ':', '/', like 'ab.09.7d'. This patch is made by the following: > find . -name trace-events | xargs python script.py where script.py is the following python script: ========================= #!/usr/bin/env python import sys import re import fileinput rhex = '%[-+ *.0-9]*(?:[hljztL]|ll|hh)?(?:x|X|"\s*PRI[xX][^"]*"?)' rgroup = re.compile('((?:' + rhex + '[.:/ ])+' + rhex + ')') rbad = re.compile('(?<!0x)' + rhex) files = sys.argv[1:] for fname in files: for line in fileinput.input(fname, inplace=True): arr = re.split(rgroup, line) for i in range(0, len(arr), 2): arr[i] = re.sub(rbad, '0x\g<0>', arr[i]) sys.stdout.write(''.join(arr)) ========================= Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Cornelia Huck <cohuck@redhat.com> Message-id: 20170731160135.12101-5-vsementsov@virtuozzo.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-07-31docs: fix broken paths to docs/devel/tracing.txtPhilippe Mathieu-Daudé
With the move of some docs/ to docs/devel/ on ac06724a71, no references were updated. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-07-17audio/adlib: remove limitation of one adlib cardHervé Poussineau
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20170621043401.19842-3-hpoussin@reactos.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-07-17audio/fmopl: modify timer callback to give opaque and channel parameters in ↵Hervé Poussineau
two arguments Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20170621043401.19842-2-hpoussin@reactos.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-19audio: Rename hw/audio/audio.h to hw/audio/soundhw.hEduardo Habkost
All the functions in hw/audio/audio.h are called "soundhw_*()" and live in hw/audio/audiohw.c. Rename the header file for consistency. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Hervé Poussineau <hpoussin@reactos.org> Message-id: 20170508205735.23444-4-ehabkost@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-19audio: Rename audio_init() to soundhw_init()Eduardo Habkost
To make it consistent with the remaining soundhw.c functions and avoid confusion with the audio_init() function in audio/audio.c, rename audio_init() to soundhw_init(). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Message-id: 20170508205735.23444-3-ehabkost@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-19audio: Move arch_init audio code to hw/audio/soundhw.cEduardo Habkost
There's no reason to keep the soundhw table in arch_init.c. Move that code to a new hw/audio/soundhw.c file. While moving the code, trivial coding style issues were fixed. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20170508205735.23444-2-ehabkost@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-17qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatableEduardo Habkost
cannot_instantiate_with_device_add_yet was introduced by commit efec3dd631d94160288392721a5f9c39e50fb2bc to replace no_user. It was supposed to be a temporary measure. When it was introduced, we had 54 cannot_instantiate_with_device_add_yet=true lines in the code. Today (3 years later) this number has not shrunk: we now have 57 cannot_instantiate_with_device_add_yet=true lines. I think it is safe to say it is not a temporary measure, and we won't see the flag go away soon. Instead of a long field name that misleads people to believe it is temporary, replace it a shorter and less misleading field: user_creatable. Except for code comments, changes were generated using the following Coccinelle patch: @@ expression DC; @@ ( -DC->cannot_instantiate_with_device_add_yet = false; +DC->user_creatable = true; | -DC->cannot_instantiate_with_device_add_yet = true; +DC->user_creatable = false; ) @@ typedef ObjectClass; expression dc; identifier class, data; @@ static void device_class_init(ObjectClass *class, void *data) { ... dc->hotpluggable = true; +dc->user_creatable = true; ... } @@ @@ struct DeviceClass { ... -bool cannot_instantiate_with_device_add_yet; +bool user_creatable; ... } @@ expression DC; @@ ( -!DC->cannot_instantiate_with_device_add_yet +DC->user_creatable | -DC->cannot_instantiate_with_device_add_yet +!DC->user_creatable ) Cc: Alistair Francis <alistair.francis@xilinx.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Marcel Apfelbaum <marcel@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Thomas Huth <thuth@redhat.com> Acked-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Acked-by: Marcel Apfelbaum <marcel@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20170503203604.31462-2-ehabkost@redhat.com> [ehabkost: kept "TODO remove once we're there" comment] Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-05-04audio: Use ARRAY_SIZE from qemu/osdep.hJuan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20170425223739.6703-27-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: un-export OPLResetChipJuan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20170425223739.6703-26-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: Remove unused typedefsJuan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-25-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: UpdateHandler is not used anymoreJuan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-24-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: IRQHandler is not used anymoreJuan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-23-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: OPLSetUpdateHandler is not used anywhereJuan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-22-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: OPLSetIRQHandler is not used anywhereJuan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-21-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: GUSsample is int16_tJuan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-20-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: GUSword is uint16_tJuan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-19-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: GUSword is uint16_tJuan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-18-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: remove GUScharJuan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-17-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: GUSbyte is uint8_tJuan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-16-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: Remove unused fieldsJuan Quintela
These were used for the remove stuff. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-15-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: Remove type fieldJuan Quintela
It was not used anymore as now there is only one type of devices. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-14-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: Remove Unused OPL_TYPE_*Juan Quintela
Since we removed the previous unused devices, they are not used anymore. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-13-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: Unfold OPLSAMPLEJuan Quintela
It was used only once, and now it was always int16_t. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-12-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: Remove INT32Juan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-11-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: remove INT16Juan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-10-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: Remove INT8Juan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-9-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: remove UINT32Juan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-8-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: remove UINT16Juan Quintela
More modernitation. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-7-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: Remove UINT8Juan Quintela
uint8_t has existed since ..... all this century? Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-6-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: YM3812 was always definedJuan Quintela
So, remove the ifdefs. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-5-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: Remove YM3526 supportJuan Quintela
It was never compiled in. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-4-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04audio: remove Y8950 configurationJuan Quintela
Include file has never been on qemu and it has been undefined from the very beginning. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-3-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04adlib: Remove support for YMF262Juan Quintela
Notice that the code was supposed to be in the file ymf262.h, that has never been on qemu source tree. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-id: 20170425223739.6703-2-quintela@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04hw/audio: convert exit callback in HDACodecDeviceClass to voidZihan Yang
The exit callback always return 0, convert it to void Signed-off-by: Zihan Yang <tgnyang@gmail.com> Message-id: 1493211188-24086-5-git-send-email-tgnyang@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-04hw/audio: replace exit with unrealize in hda_codec_device_class_initZihan Yang
The exit callback of DeviceClass will be removed in the future, so convert to unrealize in the init functioin Signed-off-by: Zihan Yang <tgnyang@gmail.com> Message-id: 1493211188-24086-4-git-send-email-tgnyang@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-11es1370: wire up reset via DeviceClassGerd Hoffmann
Instead of using qemu_register_reset(). That way we get proper cleanup for free. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1484054281-26139-1-git-send-email-kraxel@redhat.com
2017-01-11audio: ac97: add exit functionLi Qiang
Currently the ac97 device emulation doesn't have a exit function, hot unplug this device will leak some memory. Add a exit function to avoid this. Signed-off-by: Li Qiang <liqiang6-s@360.cn> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 58520052.4825ed0a.27a71.6cae@mx.google.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>