[Spice-commits] Branch 'audio.2' - 5 commits - Makefile.objs arch_init.c audio/paaudio.c configure hw/audiodev.h hw/hda-audio.c hw/intel-hda.c

Gerd Hoffmann kraxel at kemper.freedesktop.org
Fri Oct 29 03:51:16 PDT 2010


 Makefile.objs   |    2 +-
 arch_init.c     |   10 ++++++++++
 audio/paaudio.c |    4 ++--
 configure       |    4 ++--
 hw/audiodev.h   |    3 +++
 hw/hda-audio.c  |    2 ++
 hw/intel-hda.c  |   41 +++++++++++++++++++++++++++++++----------
 7 files changed, 51 insertions(+), 15 deletions(-)

New commits:
commit 76f7ec9ab47f071932656931b378190c2e54f660
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Fri Oct 29 11:09:20 2010 +0200

    pa: setup buffer - codestyle fix

diff --git a/audio/paaudio.c b/audio/paaudio.c
index d13d1ac..34bde23 100644
--- a/audio/paaudio.c
+++ b/audio/paaudio.c
@@ -299,8 +299,8 @@ static int qpa_init_out (HWVoiceOut *hw, struct audsettings *as)
      * qemu audio tick runs at 250 Hz (by default), so processing
      * data chunks worth 4 ms of sound should be a good fit.
      */
-    ba.tlength = pa_usec_to_bytes(4 * 1000, &ss);
-    ba.minreq = pa_usec_to_bytes(2 * 1000, &ss);
+    ba.tlength = pa_usec_to_bytes (4 * 1000, &ss);
+    ba.minreq = pa_usec_to_bytes (2 * 1000, &ss);
     ba.maxlength = -1;
     ba.prebuf = -1;
 
commit 8e93f636dc2769bcba65d2e6c68d274ed145b963
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Fri Oct 29 11:06:24 2010 +0200

    intel-hda: code style: kill tabs

diff --git a/hw/intel-hda.c b/hw/intel-hda.c
index 38e088d..053936a 100644
--- a/hw/intel-hda.c
+++ b/hw/intel-hda.c
@@ -778,7 +778,7 @@ static const struct IntelHDAReg regtab[] = {
 
 #define HDA_STREAM(_t, _i)                                            \
     [ ST_REG(_i, ICH6_REG_SD_CTL) ] = {                               \
-	.stream   = _i,                                               \
+        .stream   = _i,                                               \
         .name     = _t stringify(_i) " CTL",                          \
         .size     = 4,                                                \
         .wmask    = 0x1cff001f,                                       \
@@ -786,7 +786,7 @@ static const struct IntelHDAReg regtab[] = {
         .whandler = intel_hda_set_st_ctl,                             \
     },                                                                \
     [ ST_REG(_i, ICH6_REG_SD_CTL) + 2] = {                            \
-	.stream   = _i,                                               \
+        .stream   = _i,                                               \
         .name     = _t stringify(_i) " CTL(stnr)",                    \
         .size     = 1,                                                \
         .shift    = 16,                                               \
@@ -805,53 +805,53 @@ static const struct IntelHDAReg regtab[] = {
         .whandler = intel_hda_set_st_ctl,                             \
     },                                                                \
     [ ST_REG(_i, ICH6_REG_SD_LPIB) ] = {                              \
-	.stream   = _i,                                               \
+        .stream   = _i,                                               \
         .name     = _t stringify(_i) " LPIB",                         \
         .size     = 4,                                                \
         .offset   = offsetof(IntelHDAState, st[_i].lpib),             \
     },                                                                \
     [ ST_REG(_i, ICH6_REG_SD_LPIB) + 0x2000 ] = {                     \
-	.stream   = _i,                                               \
+        .stream   = _i,                                               \
         .name     = _t stringify(_i) " LPIB(alias)",                  \
         .size     = 4,                                                \
         .offset   = offsetof(IntelHDAState, st[_i].lpib),             \
     },                                                                \
     [ ST_REG(_i, ICH6_REG_SD_CBL) ] = {                               \
-	.stream   = _i,                                               \
+        .stream   = _i,                                               \
         .name     = _t stringify(_i) " CBL",                          \
         .size     = 4,                                                \
         .wmask    = 0xffffffff,                                       \
         .offset   = offsetof(IntelHDAState, st[_i].cbl),              \
     },                                                                \
     [ ST_REG(_i, ICH6_REG_SD_LVI) ] = {                               \
-	.stream   = _i,                                               \
+        .stream   = _i,                                               \
         .name     = _t stringify(_i) " LVI",                          \
         .size     = 2,                                                \
         .wmask    = 0x00ff,                                           \
         .offset   = offsetof(IntelHDAState, st[_i].lvi),              \
     },                                                                \
     [ ST_REG(_i, ICH6_REG_SD_FIFOSIZE) ] = {                          \
-	.stream   = _i,                                               \
+        .stream   = _i,                                               \
         .name     = _t stringify(_i) " FIFOS",                        \
         .size     = 2,                                                \
         .reset    = HDA_BUFFER_SIZE,                                  \
     },                                                                \
     [ ST_REG(_i, ICH6_REG_SD_FORMAT) ] = {                            \
-	.stream   = _i,                                               \
+        .stream   = _i,                                               \
         .name     = _t stringify(_i) " FMT",                          \
         .size     = 2,                                                \
         .wmask    = 0x7f7f,                                           \
         .offset   = offsetof(IntelHDAState, st[_i].fmt),              \
     },                                                                \
     [ ST_REG(_i, ICH6_REG_SD_BDLPL) ] = {                             \
-	.stream   = _i,                                               \
+        .stream   = _i,                                               \
         .name     = _t stringify(_i) " BDLPL",                        \
         .size     = 4,                                                \
         .wmask    = 0xffffff80,                                       \
         .offset   = offsetof(IntelHDAState, st[_i].bdlp_lbase),       \
     },                                                                \
     [ ST_REG(_i, ICH6_REG_SD_BDLPU) ] = {                             \
-	.stream   = _i,                                               \
+        .stream   = _i,                                               \
         .name     = _t stringify(_i) " BDLPU",                        \
         .size     = 4,                                                \
         .wmask    = 0xffffffff,                                       \
commit fd8638abfceedbe2cc73dad548f82d86b6d8391f
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Fri Oct 29 11:01:21 2010 +0200

    intel-hda/hda-audio: add authorship notice

diff --git a/hw/hda-audio.c b/hw/hda-audio.c
index 7524990..d99bdd7 100644
--- a/hw/hda-audio.c
+++ b/hw/hda-audio.c
@@ -1,6 +1,8 @@
 /*
  * Copyright (C) 2010 Red Hat, Inc.
  *
+ * written by Gerd Hoffmann <kraxel at redhat.com>
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 or
diff --git a/hw/intel-hda.c b/hw/intel-hda.c
index cb72fb8..38e088d 100644
--- a/hw/intel-hda.c
+++ b/hw/intel-hda.c
@@ -1,6 +1,8 @@
 /*
  * Copyright (C) 2010 Red Hat, Inc.
  *
+ * written by Gerd Hoffmann <kraxel at redhat.com>
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 or
commit 3b0ea12bb1605c5f6ae6031b9c06db959e113eff
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Fri Oct 29 11:00:02 2010 +0200

    intel-hda: -soundhw windup

diff --git a/arch_init.c b/arch_init.c
index a910033..cea3c8b 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -499,6 +499,16 @@ struct soundhw soundhw[] = {
     },
 #endif
 
+#ifdef CONFIG_HDA
+    {
+        "hda",
+        "Intel HD Audio",
+        0,
+        0,
+        { .init_pci = intel_hda_and_codec_init }
+    },
+#endif
+
 #endif /* HAS_AUDIO_CHOICE */
 
     { NULL, NULL, 0, 0, { NULL } }
diff --git a/hw/audiodev.h b/hw/audiodev.h
index 39a729b..8e930b2 100644
--- a/hw/audiodev.h
+++ b/hw/audiodev.h
@@ -15,3 +15,6 @@ int ac97_init(PCIBus *buf);
 
 /* cs4231a.c */
 int cs4231a_init(qemu_irq *pic);
+
+/* intel-hda.c + hda-audio.c */
+int intel_hda_and_codec_init(PCIBus *bus);
diff --git a/hw/intel-hda.c b/hw/intel-hda.c
index 94d440e..cb72fb8 100644
--- a/hw/intel-hda.c
+++ b/hw/intel-hda.c
@@ -17,6 +17,7 @@
 
 #include "hw.h"
 #include "pci.h"
+#include "audiodev.h"
 #include "intel-hda.h"
 #include "intel-hda-defs.h"
 
@@ -1154,3 +1155,21 @@ static void intel_hda_register(void)
     pci_qdev_register(&intel_hda_info);
 }
 device_init(intel_hda_register);
+
+/*
+ * create intel hda controller with codec attached to it,
+ * so '-soundhw hda' works.
+ */
+int intel_hda_and_codec_init(PCIBus *bus)
+{
+    PCIDevice *controller;
+    BusState *hdabus;
+    DeviceState *codec;
+
+    controller = pci_create_simple(bus, -1, "intel-hda");
+    hdabus = QLIST_FIRST(&controller->qdev.child_bus);
+    codec = qdev_create(hdabus, "hda-duplex");
+    qdev_init_nofail(codec);
+    return 0;
+}
+
commit d1431a5d9e131e85b0b8457347c6e9f6bbd7806b
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Fri Oct 29 10:44:17 2010 +0200

    intel-hda: configure windup

diff --git a/Makefile.objs b/Makefile.objs
index 79c12f8..9949b03 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -205,7 +205,6 @@ hw-obj-y += msix.o
 hw-obj-y += ne2000.o
 hw-obj-y += eepro100.o
 hw-obj-y += pcnet.o
-hw-obj-y += intel-hda.o hda-audio.o
 
 hw-obj-$(CONFIG_SMC91C111) += smc91c111.o
 hw-obj-$(CONFIG_LAN9118) += lan9118.o
@@ -247,6 +246,7 @@ sound-obj-$(CONFIG_AC97) += ac97.o
 sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o
 sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o
 sound-obj-$(CONFIG_CS4231A) += cs4231a.o
+sound-obj-$(CONFIG_HDA) += intel-hda.o hda-audio.o
 
 adlib.o fmopl.o: QEMU_CFLAGS += -DBUILD_Y8950=0
 hw-obj-$(CONFIG_SOUND) += $(sound-obj-y)
diff --git a/configure b/configure
index f62c1fe..7025d2b 100755
--- a/configure
+++ b/configure
@@ -76,8 +76,8 @@ sparc_cpu=""
 cross_prefix=""
 cc="gcc"
 audio_drv_list=""
-audio_card_list="ac97 es1370 sb16"
-audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus"
+audio_card_list="ac97 es1370 sb16 hda"
+audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus hda"
 block_drv_whitelist=""
 host_cc="gcc"
 ar="ar"


More information about the Spice-commits mailing list