summaryrefslogtreecommitdiff
path: root/hw/audio
AgeCommit message (Collapse)AuthorFilesLines
2018-03-26hw/audio: Fix crashes when devices are used on ISA bus without DMAThomas Huth3-4/+20
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 Arbuckle1-36/+43
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é2-4/+3
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 Francis3-21/+21
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é1-1/+0
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é1-1/+0
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é1-1/+0
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 Habkost3-0/+12
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 Gilbert1-1/+3
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 Parker1-47/+11
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 Hoffmann1-1/+5
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é Lureau1-1/+1
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-Ogievskiy1-2/+2
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é1-1/+1
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é Poussineau1-10/+2
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é Poussineau3-9/+18
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 Habkost9-9/+9
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 Habkost1-1/+1
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 Habkost2-0/+158
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 Habkost2-2/+2
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 Quintela1-5/+1
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 Quintela2-2/+1
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 Quintela1-4/+0
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 Quintela2-4/+0
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 Quintela2-6/+0
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 Quintela2-6/+1
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 Quintela2-6/+0
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 Quintela4-17/+7
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 Quintela2-11/+11
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 Quintela1-2/+0
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 Quintela2-6/+4
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 Quintela3-35/+33
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 Quintela1-6/+0
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 Quintela3-19/+10
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 Quintela2-19/+0
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 Quintela2-12/+1
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 Quintela2-51/+45
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 Quintela2-4/+3
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 Quintela1-1/+0
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 Quintela2-16/+15
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 Quintela1-1/+0
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 Quintela2-23/+24
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 Quintela2-8/+0
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 Quintela2-4/+2
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 Quintela3-168/+0
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 Quintela1-44/+1
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 Yang2-3/+2
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 Yang1-3/+2
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 Hoffmann1-3/+3
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 Qiang1-0/+11
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>