aboutsummaryrefslogtreecommitdiff
path: root/hw/audio
AgeCommit message (Collapse)AuthorFilesLines
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>
2017-01-11audio: es1370: add exit functionLi Qiang1-0/+14
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 zhao1-11/+14
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 zhao1-7/+11
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 Minyard1-1/+3
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 Gilbert1-0/+10
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 Pandit1-1/+2
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 Dovgalyuk1-2/+15
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é Lureau2-4/+9
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 Vivier1-1/+1
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 Armbruster4-4/+4
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 Armbruster1-2/+2
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 jin1-4/+20
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 jin1-4/+5
>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 Bonzini1-1/+1
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 Vasily1-2/+7
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 Maydell1-0/+19
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>