- Add missing MCP65 id which was accidentally removed in previous commit.
authorHasso Tepper <hasso@dragonflybsd.org>
Sat, 1 Dec 2007 08:32:11 +0000 (08:32 +0000)
committerHasso Tepper <hasso@dragonflybsd.org>
Sat, 1 Dec 2007 08:32:11 +0000 (08:32 +0000)
- Add Analog Devices AD1984 codec id.
- Enable pcbeep control for Acer + ALC268 (nid 29). Give enough (fake)
  hints so the parser will grab it and allocate "speaker" control.
- Fix regression while preparing DAC and ADC for multichannel
  format. Since playback policy is to output to every possible path,
  ensure that each DAC is started.

Obtained-from: FreeBSD

sys/dev/sound/pci/hda/hdac.c

index 8c593c7..1494bce 100644 (file)
@@ -24,8 +24,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/sound/pci/hda/hdac.c,v 1.36.2.7 2007/11/27 23:37:16 ariff Exp $
- * $DragonFly: src/sys/dev/sound/pci/hda/hdac.c,v 1.13 2007/11/30 08:06:00 hasso Exp $
+ * $FreeBSD: src/sys/dev/sound/pci/hda/hdac.c,v 1.36.2.8 2007/11/30 15:11:42 ariff Exp $
+ * $DragonFly: src/sys/dev/sound/pci/hda/hdac.c,v 1.14 2007/12/01 08:32:11 hasso Exp $
  */
 
 /*
 
 #include "mixer_if.h"
 
-#define HDA_DRV_TEST_REV       "20071122_0049"
+#define HDA_DRV_TEST_REV       "20071129_0050"
 #define HDA_WIDGET_PARSER_REV  1
 
-SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/hda/hdac.c,v 1.13 2007/11/30 08:06:00 hasso Exp $");
+SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/hda/hdac.c,v 1.14 2007/12/01 08:32:11 hasso Exp $");
 
 #define HDA_BOOTVERBOSE(stmt)  do {                    \
        if (bootverbose != 0) {                         \
@@ -442,6 +442,7 @@ static const struct {
        { HDA_NVIDIA_MCP61_1, "NVidia MCP61" },
        { HDA_NVIDIA_MCP61_2, "NVidia MCP61" },
        { HDA_NVIDIA_MCP65_1, "NVidia MCP65" },
+       { HDA_NVIDIA_MCP65_2, "NVidia MCP65" },
        { HDA_NVIDIA_MCP67_1, "NVidia MCP67" },
        { HDA_NVIDIA_MCP67_2, "NVidia MCP67" },
        { HDA_ATI_SB450,     "ATI SB450"    },
@@ -538,6 +539,7 @@ static const struct {
 #define ANALOGDEVICES_VENDORID 0x11d4
 #define HDA_CODEC_AD1981HD     HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1981)
 #define HDA_CODEC_AD1983       HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1983)
+#define HDA_CODEC_AD1984       HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1984)
 #define HDA_CODEC_AD1986A      HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1986)
 #define HDA_CODEC_AD1988       HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1988)
 #define HDA_CODEC_AD1988B      HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x198b)
@@ -607,6 +609,7 @@ static const struct {
        { HDA_CODEC_ALC888,    "Realtek ALC888" },
        { HDA_CODEC_AD1981HD,  "Analog Devices AD1981HD" },
        { HDA_CODEC_AD1983,    "Analog Devices AD1983" },
+       { HDA_CODEC_AD1984,    "Analog Devices AD1984" },
        { HDA_CODEC_AD1986A,   "Analog Devices AD1986A" },
        { HDA_CODEC_AD1988,    "Analog Devices AD1988" },
        { HDA_CODEC_AD1988B,   "Analog Devices AD1988B" },
@@ -3184,9 +3187,15 @@ hdac_stream_setup(struct hdac_chan *ch)
                );
                hdac_command(sc,
                    HDA_CMD_SET_CONV_FMT(cad, ch->io[i], fmt), cad);
-               hdac_command(sc,
-                   HDA_CMD_SET_CONV_STREAM_CHAN(cad, ch->io[i],
-                   (chn < totalchn) ? ((ch->sid << 4) | chn) : 0), cad);
+               if (ch->dir == PCMDIR_REC)
+                       hdac_command(sc,
+                           HDA_CMD_SET_CONV_STREAM_CHAN(cad, ch->io[i],
+                           (chn < totalchn) ? ((ch->sid << 4) | chn) : 0),
+                           cad);
+               else
+                       hdac_command(sc,
+                           HDA_CMD_SET_CONV_STREAM_CHAN(cad, ch->io[i],
+                           ch->sid << 4), cad);
                chn +=
                    HDA_PARAM_AUDIO_WIDGET_CAP_STEREO(w->param.widget_cap) ?
                    2 : 1;
@@ -4308,6 +4317,22 @@ hdac_vendor_patch_parse(struct hdac_devinfo *devinfo)
                        }
                }
                break;
+       case HDA_CODEC_ALC268:
+               if (HDA_DEV_MATCH(ACER_ALL_SUBVENDOR, subvendor)) {
+                       w = hdac_widget_get(devinfo, 29);
+                       if (w != NULL) {
+                               w->enable = 1;
+                               w->type =
+                                   HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_BEEP_WIDGET;
+                               w->param.widget_cap &=
+                                   ~HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_MASK;
+                               w->param.widget_cap |=
+                                   HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_BEEP_WIDGET <<
+                                   HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT;
+                               strlcpy(w->name, "beep widget", sizeof(w->name));
+                       }
+               }
+               break;
        case HDA_CODEC_ALC262:
                if (subvendor == HP_DC7700_SUBVENDOR) {
                        ctl = hdac_audio_ctl_amp_get(devinfo, 22, 0, 1);