summaryrefslogtreecommitdiff
path: root/hw/audio
AgeCommit message (Collapse)Author
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>
2017-01-11audio: es1370: add exit functionLi Qiang
Currently the es1370 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: 585200c9.a968ca0a.1ab80.4c98@mx.google.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-11hw/audio: QOM'ify pl041.cxiaoqiang zhao
split the old SysBus init function into an instance_init and Device realize function Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com> Message-id: 20161231011720.3965-3-zxq_yx_007@163.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-11hw/audio: QOM'ify marvell_88w8618.cxiaoqiang zhao
split the old SysBus init function into an instance_init and Device realize function Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com> Message-id: 20161231011720.3965-2-zxq_yx_007@163.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-09i2c: Allow I2C devices to NAK start eventsCorey Minyard
Add a return value to the event handler. Some I2C devices will NAK if they have no data, so allow them to do this. This required the following changes: Go through all the event handlers and change them to return int and return 0. Modify i2c_start_transfer to terminate the transaction on a NAK. Modify smbus handing to not assert if a NAK occurs on a second operation, and terminate the transaction and return -1 instead. Add some information on semantics to I2CSlaveClass. Signed-off-by: Corey Minyard <cminyard@mvista.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-11-28migration/pcspk: Add a property to state if pcspk is migratedDr. David Alan Gilbert
Allow us to turn migration of pcspk off for compatibility. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20161128133201.16104-2-dgilbert@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-10-26audio: intel-hda: check stream entry count during transferPrasad J Pandit
Intel HDA emulator uses stream of buffers during DMA data transfers. Each entry has buffer length and buffer pointer position, which are used to derive bytes to 'copy'. If this length and buffer pointer were to be same, 'copy' could be set to zero(0), leading to an infinite loop. Add check to avoid it. Reported-by: Huawei PSIRT <psirt@huawei.com> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1476949224-6865-1-git-send-email-ppandit@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-09-15pcspk: adding vmstate for save/restorePavel Dovgalyuk
VMState added by this patch preserves correct loading of the PC speaker device state. Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-Id: <20160915090133.6440.65457.stgit@PASHA-ISP> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-09-08portio: keep references on portioMarc-André Lureau
The isa_register_portio_list() function allocates ioports data/state. Let's keep the reference to this data on some owner. This isn't enough to fix leaks, but at least, ASAN stops complaining of direct leaks. Further cleanup would require calling portio_list_del/destroy(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2016-08-12trace-events: fix first line comment in trace-eventsLaurent Vivier
Documentation is docs/tracing.txt instead of docs/trace-events.txt. find . -name trace-events -exec \ sed -i "s?See docs/trace-events.txt for syntax documentation.?See docs/tracing.txt for syntax documentation.?" \ {} \; Signed-off-by: Laurent Vivier <lvivier@redhat.com> Message-id: 1470669081-17860-1-git-send-email-lvivier@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-07-12Clean up decorations and whitespace around header guardsMarkus Armbruster
Cleaned up with scripts/clean-header-guards.pl. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2016-07-12Clean up ill-advised or unusual header guardsMarkus Armbruster
Cleaned up with scripts/clean-header-guards.pl. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2016-07-05pci: Convert msi_init() to Error and fix callers to check itCao jin
msi_init() reports errors with error_report(), which is wrong when it's used in realize(). Fix by converting it to Error. Fix its callers to handle failure instead of ignoring it. For those callers who don't handle the failure, it might happen: when user want msi on, but he doesn't get what he want because of msi_init fails silently. cc: Gerd Hoffmann <kraxel@redhat.com> cc: John Snow <jsnow@redhat.com> cc: Dmitry Fleytman <dmitry@daynix.com> cc: Jason Wang <jasowang@redhat.com> cc: Michael S. Tsirkin <mst@redhat.com> cc: Hannes Reinecke <hare@suse.de> cc: Paolo Bonzini <pbonzini@redhat.com> cc: Alex Williamson <alex.williamson@redhat.com> cc: Markus Armbruster <armbru@redhat.com> cc: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Hannes Reinecke <hare@suse.com>
2016-07-05intel-hda: change msi property typeCao jin
>From uint32 to enum OnOffAuto. cc: Gerd Hoffmann <kraxel@redhat.com> cc: Michael S. Tsirkin <mst@redhat.com> cc: Markus Armbruster <armbru@redhat.com> cc: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-06-30pcspk: fix KVMPaolo Bonzini
The link property that was added to the pcspk device has the wrong type: it is only correct for TCG and for KVM's userspace or split irqchip options. The default KVM option (fully in-kernel irqchip) breaks because it uses a PIT whose type is a sibling of TYPE_I8254. Fixes: 873b4d3f0571a1e415cf089a67a230ea8a12d059 Tested-by: Peter Lieven <pl@kamp.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1467298657-6588-1-git-send-email-pbonzini@redhat.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-06-29pcspk: convert "pit" property type from ptr to linkEfimov Vasily
The speaker device needs pointer to ISA PIT device to operate. But according to qdev-properties.h, properties of pointer type should be avoided. It seems a link type property is a good substitution. Signed-off-by: Efimov Vasily <real@ispras.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-06-20Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' ↵Peter Maydell
into staging # gpg: Signature made Mon 20 Jun 2016 21:29:27 BST # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/tracing-pull-request: (42 commits) trace: split out trace events for linux-user/ directory trace: split out trace events for qom/ directory trace: split out trace events for target-ppc/ directory trace: split out trace events for target-s390x/ directory trace: split out trace events for target-sparc/ directory trace: split out trace events for net/ directory trace: split out trace events for audio/ directory trace: split out trace events for ui/ directory trace: split out trace events for hw/alpha/ directory trace: split out trace events for hw/arm/ directory trace: split out trace events for hw/acpi/ directory trace: split out trace events for hw/vfio/ directory trace: split out trace events for hw/s390x/ directory trace: split out trace events for hw/pci/ directory trace: split out trace events for hw/ppc/ directory trace: split out trace events for hw/9pfs/ directory trace: split out trace events for hw/i386/ directory trace: split out trace events for hw/isa/ directory trace: split out trace events for hw/sd/ directory trace: split out trace events for hw/sparc/ directory ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-06-20Merge remote-tracking branch 'remotes/mwalle/tags/lm32-queue/20160620' into ↵Peter Maydell
staging lm32/milkymist: some qomifying # gpg: Signature made Mon 20 Jun 2016 17:27:53 BST # gpg: using RSA key 0xB458ABB0D8D378E3 # gpg: Good signature from "Michael Walle <michael@walle.cc>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 2190 3E48 4537 A7C2 90CE 3EB2 B458 ABB0 D8D3 78E3 * remotes/mwalle/tags/lm32-queue/20160620: milkymist: update specification URLs hw/intc: QOM'ify lm32_pic.c hw/display: QOM'ify milkymist-vgafb.c hw/display: QOM'ify milkymist-tmu2.c hw/timer: QOM'ify milkymist_sysctl hw/timer: QOM'ify lm32_timer Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-06-20trace: split out trace events for hw/audio/ directoryDaniel P. Berrange
Move all trace-events for files in the hw/audio/ directory to their own file. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1466066426-16657-13-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-06-20milkymist: update specification URLsMichael Walle
The old milkymist.org domain just forwards to mm-labs.hk nowadays. I've created a mirror of the documents. Signed-off-by: Michael Walle <michael@walle.cc>