summaryrefslogtreecommitdiffstats
path: root/hw/intel-hda.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'kraxel/q35.1' into stagingAnthony Liguori2013-01-111-7/+34
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kraxel/q35.1: Makefile: install the "acpi-dsdt.aml" and "q35-acpi-dsdt.aml" blobs too pc: rename machine types q35: document chipset devices q35: add ich9 intel hda controller Conflicts: hw/intel-hda.c aliguori: resolve conflict with static const change from Andreas. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * q35: add ich9 intel hda controllerGerd Hoffmann2013-01-111-7/+34
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | Make all static TypeInfos constAndreas Färber2013-01-101-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register all types natively through QEMU Object Model), TypeInfo as used in the common, non-iterative pattern is no longer amended with information and should therefore be const. Fix the documented QOM examples: sed -i 's/static TypeInfo/static const TypeInfo/g' include/qom/object.h Since frequently the wrong examples are being copied by contributors of new devices, fix all types in the tree: sed -i 's/^static TypeInfo/static const TypeInfo/g' */*.c sed -i 's/^static TypeInfo/static const TypeInfo/g' */*/*.c This also avoids to piggy-back these changes onto real functional changes or other refactorings. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* softmmu: move include files to include/sysemu/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* misc: move include files to include/qemu/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* pci: update all users to look in pci/Michael S. Tsirkin2012-12-171-2/+2
| | | | | | update all users so we can remove the makefile hack. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* Rename target_phys_addr_t to hwaddrAvi Kivity2012-10-231-13/+13
| | | | | | | | | | | | | | | target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are reserved) and its purpose doesn't match the name (most target_phys_addr_t addresses are not target specific). Replace it with a finger-friendly, standards conformant hwaddr. Outstanding patchsets can be fixed up with the command git rebase -i --exec 'find -name "*.[ch]" | xargs s/target_phys_addr_t/hwaddr/g' origin Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Make target_phys_addr_t 64 bits unconditionallyAvi Kivity2012-10-041-7/+1
| | | | | | | | | | The hassle and compile time overhead of maintaining both 32-bit and 64-bit capable source isn't worth the tiny performance advantage which is seen on a minority of configurations. Switch to compiling libhw only once, with target_phys_addr_t unconditionally typedefed to uint64_t. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge branch pci into masterMichael S. Tsirkin2012-07-291-2/+1
|\ | | | | | | | | | | | | | | Merge master and pci branch, resolve build breakage in hw/esp.c introduced by f90c2bcd. Conflicts: hw/esp.c
| * pci: convert PCIUnregisterFunc to voidAlex Williamson2012-07-041-2/+1
| | | | | | | | | | | | | | | | Not a single driver has any possibility of failure on their exit function, let's keep it that way. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | Merge remote-tracking branch 'afaerber-or/qom-next-2' into stagingAnthony Liguori2012-06-181-15/+22
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * afaerber-or/qom-next-2: (22 commits) qom: Push error reporting to object_property_find() qdev: Remove qdev_prop_exists() qbus: Initialize in standard way qbus: Make child devices links qdev: Connect busses with their parent devices qdev: Convert busses to QEMU Object Model qdev: Move SysBus initialization to sysbus.c qdev: Use wrapper for qdev_get_path qdev: Remove qdev_prop_set_defaults qdev: Clean up global properties qdev: Move bus properties to abstract superclasses qdev: Move bus properties to a separate global qdev: Push "type" property up to Object arm_l2x0: Rename "type" property to "cache-type" m48t59: Rename "type" property to "model" qom: Assert that public types have a non-NULL parent field qom: Drop type_register_static_alias() macro qom: Make Object a type qom: Add class_base_init qom: Add object_child_foreach() ...
| * qbus: Make child devices linksAnthony Liguori2012-06-181-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | Make qbus children show up as link<> properties. There is no stable addressing for qbus children so we use an unstable naming convention. This is okay in QOM though because the composition name is expected to be what's stable. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * qdev: Convert busses to QEMU Object ModelAnthony Liguori2012-06-181-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is far less interesting than it sounds. We simply add an Object to each BusState and then register the types appropriately. Most of the interesting refactoring will follow in the next patches. Since we're changing fundamental type names (BusInfo -> BusClass), it all needs to convert at once. Fortunately, not a lot of code is affected. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> [AF: Made all new bus TypeInfos static const.] [AF: Made qbus_free() call object_delete(), required {qom,glib}_allocated] Signed-off-by: Andreas Färber <afaerber@suse.de>
| * qdev: Move bus properties to abstract superclassesPaolo Bonzini2012-06-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In qdev, each bus in practice identified an abstract superclass, but this was mostly hidden. In QOM, instead, these abstract classes are explicit so we can move bus properties there. All bus property walks are removed, and all device property walks are changed to look along the class hierarchy instead. We would have duplicates if class A defines some properties and its subclass B does not define any, because class_b->props will be left equal to class_a->props. The solution here is to reintroduce the class_base_init TypeInfo callback, that was present in one of the early QOM versions but removed (on my request...) before committing. This breaks global bus properties, an obscure feature when used with the command-line which is actually useful and used when used by backwards-compatible machine types. So this patch also adjusts the global bus properties in hw/pc_piix.c to refer to the abstract class. Globals and other properties must be modified in the same patch to avoid complications related to initialization ordering. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * qdev: Move bus properties to a separate globalPaolo Bonzini2012-06-181-4/+6
| | | | | | | | | | | | | | Simple code movement in order to simplify future refactoring. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* | msi: Invoke msi/msix_write_config from PCI coreJan Kiszka2012-06-071-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | Also this functions is better invoked by the core than by each and every device. This allows to drop the config_write callbacks from ich and intel-hda. CC: Alexander Graf <agraf@suse.de> CC: Gerd Hoffmann <kraxel@redhat.com> CC: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | msi: Invoke msi/msix_reset from PCI coreJan Kiszka2012-06-071-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | There is no point in pushing this burden to the devices, they tend to forget to call them (like intel-hda, ahci, xhci did). Instead, reset functions are now called from pci_device_reset. They do nothing if MSI/MSI-X is not in use. CC: Alexander Graf <agraf@suse.de> CC: Gerd Hoffmann <kraxel@redhat.com> CC: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | intel-hda: Fix reset of MSI functionJan Kiszka2012-06-071-0/+3
|/ | | | | | | | | Call msi_reset on device reset as still required by the core. CC: Gerd Hoffmann <kraxel@redhat.com> CC: qemu-stable@nongnu.org Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* qom: Unify type registrationAndreas Färber2012-02-151-2/+3
| | | | | | | | | | | | | Replace device_init() with generalized type_init(). While at it, unify naming convention: type_init([$prefix_]register_types) Also, type_init() is a function, so add preceding blank line where necessary and don't put a semicolon after the closing brace. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Cc: malc <av1474@comtv.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: kill off DeviceInfoAnthony Liguori2012-02-031-1/+1
| | | | | | | It is no longer used in the tree since everything is done natively through QEMU Object Model. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: register all types natively through QEMU Object ModelAnthony Liguori2012-02-031-17/+20
| | | | | | | | | | | | | | | | | | | | | This was done in a mostly automated fashion. I did it in three steps and then rebased it into a single step which avoids repeatedly touching every file in the tree. The first step was a sed-based addition of the parent type to the subclass registration functions. The second step was another sed-based removal of subclass registration functions while also adding virtual functions from the base class into a class_init function as appropriate. Finally, a python script was used to convert the DeviceInfo structures and qdev_register_subclass functions to TypeInfo structures, class_init functions, and type_register_static calls. We are almost fully converted to QOM after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: convert to QEMU Object ModelAnthony Liguori2012-01-271-19/+37
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* hda-codec: convert to QEMU Object ModelAnthony Liguori2012-01-271-13/+18
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: use a wrapper to access reset and promote reset to a class methodAnthony Liguori2012-01-271-3/+1
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: don't access name through infoAnthony Liguori2012-01-271-1/+1
| | | | | | We already have a QOM interface for this so let's use it. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: move qdev->info to classAnthony Liguori2012-01-271-3/+3
| | | | | | | | Right now, DeviceInfo acts as the class for qdev. In order to switch to a proper ObjectClass derivative, we need to ween all of the callers off of interacting directly with the info pointer. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* intel-hda: fix stream searchGerd Hoffmann2011-11-021-1/+1
| | | | | | | | | commit ba43d28916c4f51c19bd7366089155ce81bee058 introduces a bug: The stream-not-found case doesn't error out any more, instead the code silently uses the first stream. Fix it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* intel-hda: Use PCI DMA stub functionsDavid Gibson2011-11-011-7/+7
| | | | | | | | | This updates the intel-hda device emulation to use the explicit PCI DMA functions, instead of directly calling physical memory access functions. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: switch children device list to QTAILQPaolo Bonzini2011-10-281-3/+3
| | | | | | | | | | SCSI buses will need to read the children list first-to-last. This requires using a QTAILQ, because hell breaks loose if you just try inserting at the tail (thus reversing the order of all existing visits from last-to-first to first-to-tail). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* hda: do not mix output and input stream states, RHBZ #740493Marc-André Lureau2011-10-251-4/+5
| | | | | | | | | | | | Windows 7 may use the same stream number for input and output. Current code will confuse streams. Changes since v1: - keep running_compat[] for migration version 1 - add running_real[] for migration version 2 Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* hda: do not mix output and input streams, RHBZ #740493Marc-André Lureau2011-10-251-4/+5
| | | | | | | | | | | Windows 7 may use the same stream number for input and output. That will result in lot of garbage on playback. The hardcoded value of 4 needs to be in sync with GCAP streams description and IN/OUT registers. Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* Use glib memory allocation and free functionsAnthony Liguori2011-08-201-2/+2
| | | | | | qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: rename pci_register_bar_region() to pci_register_bar()Avi Kivity2011-08-081-1/+1
| | | | | | | Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* intel-hda: convert to memory APIAvi Kivity2011-08-081-16/+19
| | | | | | | Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* intel-hda: use specific endian ld/st_physAlexander Graf2011-07-121-17/+4
| | | | | Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hw/intel-hda.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-4/+4
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* MSI: Robust resource releaseJan Kiszka2011-05-051-3/+1
| | | | | | | | msi_init may fail, so we need to check on uninit if the cap was actually installed. This also avoids that the users need to check. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hda-intel: convert to pci_register_bar_simple()Avi Kivity2011-04-071-10/+1
| | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* change all other clock references to use nanosecond resolution accessorsPaolo Bonzini2011-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | This was done with: sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \ $(git grep -l 'qemu_get_clock\>' ) sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \ $(git grep -l 'qemu_new_timer\>' ) after checking that get_clock and new_timer never occur twice on the same line. There were no missed occurrences; however, even if there had been, they would have been caught by the compiler. There was exactly one false positive in qemu_run_timers: - current_time = qemu_get_clock (clock); + current_time = qemu_get_clock_ns (clock); which is of course not in this patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Add endianness as io mem parameterAlexander Graf2010-12-111-1/+2
| | | | | | | | | | | | | As stated before, devices can be little, big or native endian. The target endianness is not of their concern, so we need to push things down a level. This patch adds a parameter to cpu_register_io_memory that allows a device to choose its endianness. For now, all devices simply choose native endian, because that's the same behavior as before. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* intel-hda: fix codec addressing.Gerd Hoffmann2010-11-091-4/+5
| | | | | | | | | | | | | | | | The HDA bus supports up to 15 codecs, with addresses 0 ... 14. We get that wrong in two places: * When handing out addresses we accept address 15 as valid. * The bitmasks for two registers (WAKEEN and STATESTS) don't have bit 14 set. This patch fixes it. [ v2: codestyle: add braces ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* Revert "intel-hda: fix codec addressing."malc2010-11-091-4/+4
| | | | | | Misses braces This reverts commit acc086837e49b44f15eff6007bb1726844df7aec.
* intel-hda: fix codec addressing.Gerd Hoffmann2010-11-091-4/+4
| | | | | | | | | | | | | | The HDA bus supports up to 15 codecs, with addresses 0 ... 14. We get that wrong in two places: * When handing out addresses we accept address 15 as valid. * The bitmasks for two registers (WAKEEN and STATESTS) don't have bit 14 set. This patch fixes it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* intel-hda: add msi supportGerd Hoffmann2010-11-091-2/+31
| | | | | | | | | | This patch adds MSI support to the intel hda audio driver. It is enabled by default, use '-device intel-hda,msi=0' to disable it. [ v2: codestyle: add braces ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* intel-hda: update irq status on WAKEEN changes.Gerd Hoffmann2010-11-091-0/+6
| | | | | | | | When the guest updates the WAKEEN register we must re-calculate the IRQ status. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* intel-hda: Honor WAKEEN bits.François Revol2010-11-091-1/+2
| | | | | | | | | | HDA: Honor WAKEEN bits when deciding to raise an interrupt on codec status change. This prevents an interrupt storm with the Haiku HDA driver which does not handle codec status changes in the irq handler. Signed-off-by: François Revol <revol@free.fr> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* intel-hda: exit cleanupGerd Hoffmann2010-11-091-0/+20
| | | | | | | | | Add pci exit callback for the intel-hda device and cleanup properly. Also add an exit callback to the HDA bus implementation and make sure it is called on qdev_free(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* Add Intel HD Audio support to qemu.Gerd Hoffmann2010-11-011-0/+1250
This patch adds three devices to qemu: intel-hda Intel HD Audio Controller, the PCI device. Provides a HDA bus. Emulates ICH6 at the moment. Adding a ICH9 PCIE variant shouldn't be hard. hda-duplex HDA Codec. Attaches to the HDA bus. Supports 16bit stereo, rates 16k -> 96k, playback, recording and volume control (with CONFIG_MIXEMU=y). hda-output HDA Codec without recording support. Subset of the hda-duplex codec. Use this if you don't want your guests access your mic. Usage: add '-device intel-hda -device hda-duplex' to your command line. Tested guests: * Linux works. * Win7 works. * DOS (mpxplay) works. * WinXP doesn't work. [ v2 changes ] * Fixed endianess, big endian hosts work now. * Fixed some emulation bugs. * Added immediate command emulation. * Added vmstate support. * Make it behave like all other sound card drivers: - can be configured via '--audio-card-list=hda' - can be added to a VM using '-soundhw hda' * Code style fixups. * Zapped guest-triggerable asserts. * Handle partial reads/writes of audio data correctly. Cc: malc <av1474@comtv.ru> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
OpenPOWER on IntegriCloud