Merge branch 'fix/hda' into topic/hda
authorTakashi Iwai <tiwai@suse.de>
Thu, 5 Nov 2009 07:56:20 +0000 (08:56 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 5 Nov 2009 07:56:20 +0000 (08:56 +0100)
1  2 
Documentation/sound/alsa/HD-Audio-Models.txt
sound/pci/hda/hda_intel.c
sound/pci/hda/patch_realtek.c

index 75fddb40f4163d44d33166a486094f1c593852a0,4bf953b55b8ee7b573046e723274bf819a6b59f9..4c7f9aee5c4eb0a7b806630d071f66b7b6800d59
@@@ -359,6 -359,7 +359,7 @@@ STAC9227/9228/9229/927
    5stack-no-fp        D965 5stack without front panel
    dell-3stack Dell Dimension E520
    dell-bios   Fixes with Dell BIOS setup
+   volknob     Fixes with volume-knob widget 0x24
    auto                BIOS setup (default)
  
  STAC92HD71B*
@@@ -388,7 -389,7 +389,7 @@@ STAC92HD73
  STAC92HD83*
  ===========
    ref         Reference board
 -  mic-ref     Reference board with power managment for ports
 +  mic-ref     Reference board with power management for ports
    dell-s14    Dell laptop
    auto                BIOS setup (default)
  
index a0eface6e99af462f9af8626c7be51cf6620ca71,e340792f6cb325eabfca7c2e350aa987a9c35907..55c7da30bb61a6ad75e9154cf7d6da7e34ce55b1
@@@ -60,7 -60,7 +60,7 @@@ static int bdl_pos_adj[SNDRV_CARDS] = {
  static int probe_mask[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1};
  static int probe_only[SNDRV_CARDS];
  static int single_cmd;
 -static int enable_msi;
 +static int enable_msi = -1;
  #ifdef CONFIG_SND_HDA_PATCH_LOADER
  static char *patch[SNDRV_CARDS];
  #endif
@@@ -677,14 -677,6 +677,14 @@@ static unsigned int azx_rirb_get_respon
                }
        }
  
 +      if (!chip->polling_mode) {
 +              snd_printk(KERN_WARNING SFX "azx_get_response timeout, "
 +                         "switching to polling mode: last cmd=0x%08x\n",
 +                         chip->last_cmd[addr]);
 +              chip->polling_mode = 1;
 +              goto again;
 +      }
 +
        if (chip->msi) {
                snd_printk(KERN_WARNING SFX "No response from codec, "
                           "disabling MSI: last cmd=0x%08x\n",
                goto again;
        }
  
 -      if (!chip->polling_mode) {
 -              snd_printk(KERN_WARNING SFX "azx_get_response timeout, "
 -                         "switching to polling mode: last cmd=0x%08x\n",
 -                         chip->last_cmd[addr]);
 -              chip->polling_mode = 1;
 -              goto again;
 -      }
 -
        if (chip->probing) {
                /* If this critical timeout happens during the codec probing
                 * phase, this is likely an access to a non-existing codec
@@@ -2300,9 -2300,11 +2300,9 @@@ static void __devinit check_probe_mask(
  }
  
  /*
 - * white-list for enable_msi
 + * white/black-list for enable_msi
   */
 -static struct snd_pci_quirk msi_white_list[] __devinitdata = {
 -      SND_PCI_QUIRK(0x103c, 0x30f7, "HP Pavilion dv4t-1300", 1),
 -      SND_PCI_QUIRK(0x103c, 0x3607, "HP Compa CQ40", 1),
 +static struct snd_pci_quirk msi_black_list[] __devinitdata = {
        {}
  };
  
@@@ -2310,12 -2312,10 +2310,12 @@@ static void __devinit check_msi(struct 
  {
        const struct snd_pci_quirk *q;
  
 -      chip->msi = enable_msi;
 -      if (chip->msi)
 +      if (enable_msi >= 0) {
 +              chip->msi = !!enable_msi;
                return;
 -      q = snd_pci_quirk_lookup(chip->pci, msi_white_list);
 +      }
 +      chip->msi = 1;  /* enable MSI as default */
 +      q = snd_pci_quirk_lookup(chip->pci, msi_black_list);
        if (q) {
                printk(KERN_INFO
                       "hda_intel: msi for device %04x:%04x set to %d\n",
@@@ -2674,6 -2674,7 +2674,7 @@@ static struct pci_device_id azx_ids[] 
        { PCI_DEVICE(0x10de, 0x044b), .driver_data = AZX_DRIVER_NVIDIA },
        { PCI_DEVICE(0x10de, 0x055c), .driver_data = AZX_DRIVER_NVIDIA },
        { PCI_DEVICE(0x10de, 0x055d), .driver_data = AZX_DRIVER_NVIDIA },
+       { PCI_DEVICE(0x10de, 0x0590), .driver_data = AZX_DRIVER_NVIDIA },
        { PCI_DEVICE(0x10de, 0x0774), .driver_data = AZX_DRIVER_NVIDIA },
        { PCI_DEVICE(0x10de, 0x0775), .driver_data = AZX_DRIVER_NVIDIA },
        { PCI_DEVICE(0x10de, 0x0776), .driver_data = AZX_DRIVER_NVIDIA },
index 4c8e5216506b4e5ece923b1bd743e38f346e5e66,ff20048504b6484057e4a5464809c52773d7594e..b592419b2083b168d94a8bff118e2929bd74d08c
@@@ -275,7 -275,7 +275,7 @@@ struct alc_spec 
        struct snd_kcontrol_new *cap_mixer;     /* capture mixer */
        unsigned int beep_amp;  /* beep amp value, set via set_beep_amp() */
  
-       const struct hda_verb *init_verbs[5];   /* initialization verbs
+       const struct hda_verb *init_verbs[10];  /* initialization verbs
                                                 * don't forget NULL
                                                 * termination!
                                                 */
@@@ -965,6 -965,8 +965,8 @@@ static void alc_automute_pin(struct hda
        unsigned int nid = spec->autocfg.hp_pins[0];
        int i;
  
+       if (!nid)
+               return;
        pincap = snd_hda_query_pin_caps(codec, nid);
        if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
                snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0);
@@@ -4324,20 -4326,6 +4326,20 @@@ static int add_control(struct alc_spec 
        return 0;
  }
  
 +static int add_control_with_pfx(struct alc_spec *spec, int type,
 +                              const char *pfx, const char *dir,
 +                              const char *sfx, unsigned long val)
 +{
 +      char name[32];
 +      snprintf(name, sizeof(name), "%s %s %s", pfx, dir, sfx);
 +      return add_control(spec, type, name, val);
 +}
 +
 +#define add_pb_vol_ctrl(spec, type, pfx, val) \
 +      add_control_with_pfx(spec, type, pfx, "Playback", "Volume", val)
 +#define add_pb_sw_ctrl(spec, type, pfx, val) \
 +      add_control_with_pfx(spec, type, pfx, "Playback", "Switch", val)
 +
  #define alc880_is_fixed_pin(nid)      ((nid) >= 0x14 && (nid) <= 0x17)
  #define alc880_fixed_pin_idx(nid)     ((nid) - 0x14)
  #define alc880_is_multi_pin(nid)      ((nid) >= 0x18)
@@@ -4391,6 -4379,7 +4393,6 @@@ static int alc880_auto_fill_dac_nids(st
  static int alc880_auto_create_multi_out_ctls(struct alc_spec *spec,
                                             const struct auto_pin_cfg *cfg)
  {
 -      char name[32];
        static const char *chname[4] = {
                "Front", "Surround", NULL /*CLFE*/, "Side"
        };
                nid = alc880_idx_to_mixer(alc880_dac_to_idx(spec->multiout.dac_nids[i]));
                if (i == 2) {
                        /* Center/LFE */
 -                      err = add_control(spec, ALC_CTL_WIDGET_VOL,
 -                                        "Center Playback Volume",
 +                      err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL,
 +                                            "Center",
                                          HDA_COMPOSE_AMP_VAL(nid, 1, 0,
                                                              HDA_OUTPUT));
                        if (err < 0)
                                return err;
 -                      err = add_control(spec, ALC_CTL_WIDGET_VOL,
 -                                        "LFE Playback Volume",
 +                      err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL,
 +                                            "LFE",
                                          HDA_COMPOSE_AMP_VAL(nid, 2, 0,
                                                              HDA_OUTPUT));
                        if (err < 0)
                                return err;
 -                      err = add_control(spec, ALC_CTL_BIND_MUTE,
 -                                        "Center Playback Switch",
 +                      err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE,
 +                                           "Center",
                                          HDA_COMPOSE_AMP_VAL(nid, 1, 2,
                                                              HDA_INPUT));
                        if (err < 0)
                                return err;
 -                      err = add_control(spec, ALC_CTL_BIND_MUTE,
 -                                        "LFE Playback Switch",
 +                      err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE,
 +                                           "LFE",
                                          HDA_COMPOSE_AMP_VAL(nid, 2, 2,
                                                              HDA_INPUT));
                        if (err < 0)
                                pfx = "Speaker";
                        else
                                pfx = chname[i];
 -                      sprintf(name, "%s Playback Volume", pfx);
 -                      err = add_control(spec, ALC_CTL_WIDGET_VOL, name,
 +                      err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, pfx,
                                          HDA_COMPOSE_AMP_VAL(nid, 3, 0,
                                                              HDA_OUTPUT));
                        if (err < 0)
                                return err;
 -                      sprintf(name, "%s Playback Switch", pfx);
 -                      err = add_control(spec, ALC_CTL_BIND_MUTE, name,
 +                      err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE, pfx,
                                          HDA_COMPOSE_AMP_VAL(nid, 3, 2,
                                                              HDA_INPUT));
                        if (err < 0)
@@@ -4455,6 -4446,7 +4457,6 @@@ static int alc880_auto_create_extra_out
  {
        hda_nid_t nid;
        int err;
 -      char name[32];
  
        if (!pin)
                return 0;
                        spec->multiout.extra_out_nid[0] = nid;
                /* control HP volume/switch on the output mixer amp */
                nid = alc880_idx_to_mixer(alc880_fixed_pin_idx(pin));
 -              sprintf(name, "%s Playback Volume", pfx);
 -              err = add_control(spec, ALC_CTL_WIDGET_VOL, name,
 +              err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, pfx,
                                  HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT));
                if (err < 0)
                        return err;
 -              sprintf(name, "%s Playback Switch", pfx);
 -              err = add_control(spec, ALC_CTL_BIND_MUTE, name,
 +              err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE, pfx,
                                  HDA_COMPOSE_AMP_VAL(nid, 3, 2, HDA_INPUT));
                if (err < 0)
                        return err;
        } else if (alc880_is_multi_pin(pin)) {
                /* set manual connection */
                /* we have only a switch on HP-out PIN */
 -              sprintf(name, "%s Playback Switch", pfx);
 -              err = add_control(spec, ALC_CTL_WIDGET_MUTE, name,
 +              err = add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx,
                                  HDA_COMPOSE_AMP_VAL(pin, 3, 0, HDA_OUTPUT));
                if (err < 0)
                        return err;
@@@ -4492,13 -4487,16 +4494,13 @@@ static int new_analog_input(struct alc_
                            const char *ctlname,
                            int idx, hda_nid_t mix_nid)
  {
 -      char name[32];
        int err;
  
 -      sprintf(name, "%s Playback Volume", ctlname);
 -      err = add_control(spec, ALC_CTL_WIDGET_VOL, name,
 +      err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, ctlname,
                          HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT));
        if (err < 0)
                return err;
 -      sprintf(name, "%s Playback Switch", ctlname);
 -      err = add_control(spec, ALC_CTL_WIDGET_MUTE, name,
 +      err = add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, ctlname,
                          HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT));
        if (err < 0)
                return err;
@@@ -5991,6 -5989,7 +5993,6 @@@ static int alc260_add_playback_controls
  {
        hda_nid_t nid_vol;
        unsigned long vol_val, sw_val;
 -      char name[32];
        int err;
  
        if (nid >= 0x0f && nid < 0x11) {
  
        if (!(*vol_bits & (1 << nid_vol))) {
                /* first control for the volume widget */
 -              snprintf(name, sizeof(name), "%s Playback Volume", pfx);
 -              err = add_control(spec, ALC_CTL_WIDGET_VOL, name, vol_val);
 +              err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, pfx, vol_val);
                if (err < 0)
                        return err;
                *vol_bits |= (1 << nid_vol);
        }
 -      snprintf(name, sizeof(name), "%s Playback Switch", pfx);
 -      err = add_control(spec, ALC_CTL_WIDGET_MUTE, name, sw_val);
 +      err = add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx, sw_val);
        if (err < 0)
                return err;
        return 1;
@@@ -10954,6 -10955,7 +10956,6 @@@ static int alc262_check_volbit(hda_nid_
  static int alc262_add_out_vol_ctl(struct alc_spec *spec, hda_nid_t nid,
                                  const char *pfx, int *vbits)
  {
 -      char name[32];
        unsigned long val;
        int vbit;
  
        if (*vbits & vbit) /* a volume control for this mixer already there */
                return 0;
        *vbits |= vbit;
 -      snprintf(name, sizeof(name), "%s Playback Volume", pfx);
        if (vbit == 2)
                val = HDA_COMPOSE_AMP_VAL(0x0e, 2, 0, HDA_OUTPUT);
        else
                val = HDA_COMPOSE_AMP_VAL(0x0c, 3, 0, HDA_OUTPUT);
 -      return add_control(spec, ALC_CTL_WIDGET_VOL, name, val);
 +      return add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, pfx, val);
  }
  
  static int alc262_add_out_sw_ctl(struct alc_spec *spec, hda_nid_t nid,
                                 const char *pfx)
  {
 -      char name[32];
        unsigned long val;
  
        if (!nid)
                return 0;
 -      snprintf(name, sizeof(name), "%s Playback Switch", pfx);
        if (nid == 0x16)
                val = HDA_COMPOSE_AMP_VAL(nid, 2, 0, HDA_OUTPUT);
        else
                val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT);
 -      return add_control(spec, ALC_CTL_WIDGET_MUTE, name, val);
 +      return add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx, val);
  }
  
  /* add playback controls from the parsed DAC table */
@@@ -12319,9 -12324,11 +12321,9 @@@ static struct snd_kcontrol_new alc268_t
  static int alc268_new_analog_output(struct alc_spec *spec, hda_nid_t nid,
                                    const char *ctlname, int idx)
  {
 -      char name[32];
        hda_nid_t dac;
        int err;
  
 -      sprintf(name, "%s Playback Volume", ctlname);
        switch (nid) {
        case 0x14:
        case 0x16:
        }
        if (spec->multiout.dac_nids[0] != dac &&
            spec->multiout.dac_nids[1] != dac) {
 -              err = add_control(spec, ALC_CTL_WIDGET_VOL, name,
 +              err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, ctlname,
                                  HDA_COMPOSE_AMP_VAL(dac, 3, idx,
                                                      HDA_OUTPUT));
                if (err < 0)
                spec->multiout.dac_nids[spec->multiout.num_dacs++] = dac;
        }
  
 -      sprintf(name, "%s Playback Switch", ctlname);
        if (nid != 0x16)
 -              err = add_control(spec, ALC_CTL_WIDGET_MUTE, name,
 +              err = add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, ctlname,
                          HDA_COMPOSE_AMP_VAL(nid, 3, idx, HDA_OUTPUT));
        else /* mono */
 -              err = add_control(spec, ALC_CTL_WIDGET_MUTE, name,
 +              err = add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, ctlname,
                          HDA_COMPOSE_AMP_VAL(nid, 2, idx, HDA_OUTPUT));
        if (err < 0)
                return err;
@@@ -12377,7 -12385,8 +12379,7 @@@ static int alc268_auto_create_multi_out
  
        nid = cfg->speaker_pins[0];
        if (nid == 0x1d) {
 -              err = add_control(spec, ALC_CTL_WIDGET_VOL,
 -                                "Speaker Playback Volume",
 +              err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, "Speaker",
                                  HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT));
                if (err < 0)
                        return err;
  
        nid = cfg->line_out_pins[1] | cfg->line_out_pins[2];
        if (nid == 0x16) {
 -              err = add_control(spec, ALC_CTL_WIDGET_MUTE,
 -                                "Mono Playback Switch",
 +              err = add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, "Mono",
                                  HDA_COMPOSE_AMP_VAL(nid, 2, 0, HDA_OUTPUT));
                if (err < 0)
                        return err;
@@@ -12594,7 -12604,8 +12596,8 @@@ static struct snd_pci_quirk alc268_cfg_
        SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One",
                                                ALC268_ACER_ASPIRE_ONE),
        SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL),
-       SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron Mini9", ALC268_DELL),
+       SND_PCI_QUIRK_MASK(0x1028, 0xfff0, 0x02b0,
+                       "Dell Inspiron Mini9/Vostro A90", ALC268_DELL),
        /* almost compatible with toshiba but with optional digital outs;
         * auto-probing seems working fine
         */
@@@ -14246,7 -14257,9 +14249,7 @@@ static int alc861_auto_fill_dac_nids(st
  static int alc861_create_out_sw(struct hda_codec *codec, const char *pfx,
                                hda_nid_t nid, unsigned int chs)
  {
 -      char name[32];
 -      snprintf(name, sizeof(name), "%s Playback Switch", pfx);
 -      return add_control(codec->spec, ALC_CTL_WIDGET_MUTE, name,
 +      return add_pb_sw_ctrl(codec->spec, ALC_CTL_WIDGET_MUTE, pfx,
                           HDA_COMPOSE_AMP_VAL(nid, chs, 0, HDA_OUTPUT));
  }
  
@@@ -15370,6 -15383,7 +15373,6 @@@ static void alc861vd_auto_init_analog_i
  static int alc861vd_auto_create_multi_out_ctls(struct alc_spec *spec,
                                             const struct auto_pin_cfg *cfg)
  {
 -      char name[32];
        static const char *chname[4] = {"Front", "Surround", "CLFE", "Side"};
        hda_nid_t nid_v, nid_s;
        int i, err;
  
                if (i == 2) {
                        /* Center/LFE */
 -                      err = add_control(spec, ALC_CTL_WIDGET_VOL,
 -                                        "Center Playback Volume",
 +                      err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL,
 +                                            "Center",
                                          HDA_COMPOSE_AMP_VAL(nid_v, 1, 0,
                                                              HDA_OUTPUT));
                        if (err < 0)
                                return err;
 -                      err = add_control(spec, ALC_CTL_WIDGET_VOL,
 -                                        "LFE Playback Volume",
 +                      err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL,
 +                                            "LFE",
                                          HDA_COMPOSE_AMP_VAL(nid_v, 2, 0,
                                                              HDA_OUTPUT));
                        if (err < 0)
                                return err;
 -                      err = add_control(spec, ALC_CTL_BIND_MUTE,
 -                                        "Center Playback Switch",
 +                      err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE,
 +                                           "Center",
                                          HDA_COMPOSE_AMP_VAL(nid_s, 1, 2,
                                                              HDA_INPUT));
                        if (err < 0)
                                return err;
 -                      err = add_control(spec, ALC_CTL_BIND_MUTE,
 -                                        "LFE Playback Switch",
 +                      err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE,
 +                                           "LFE",
                                          HDA_COMPOSE_AMP_VAL(nid_s, 2, 2,
                                                              HDA_INPUT));
                        if (err < 0)
                                        pfx = "PCM";
                        } else
                                pfx = chname[i];
 -                      sprintf(name, "%s Playback Volume", pfx);
 -                      err = add_control(spec, ALC_CTL_WIDGET_VOL, name,
 +                      err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, pfx,
                                          HDA_COMPOSE_AMP_VAL(nid_v, 3, 0,
                                                              HDA_OUTPUT));
                        if (err < 0)
                        if (cfg->line_outs == 1 &&
                            cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)
                                pfx = "Speaker";
 -                      sprintf(name, "%s Playback Switch", pfx);
 -                      err = add_control(spec, ALC_CTL_BIND_MUTE, name,
 +                      err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE, pfx,
                                          HDA_COMPOSE_AMP_VAL(nid_s, 3, 2,
                                                              HDA_INPUT));
                        if (err < 0)
@@@ -15446,6 -15462,7 +15449,6 @@@ static int alc861vd_auto_create_extra_o
  {
        hda_nid_t nid_v, nid_s;
        int err;
 -      char name[32];
  
        if (!pin)
                return 0;
                nid_s = alc861vd_idx_to_mixer_switch(
                                alc880_fixed_pin_idx(pin));
  
 -              sprintf(name, "%s Playback Volume", pfx);
 -              err = add_control(spec, ALC_CTL_WIDGET_VOL, name,
 +              err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, pfx,
                                  HDA_COMPOSE_AMP_VAL(nid_v, 3, 0, HDA_OUTPUT));
                if (err < 0)
                        return err;
 -              sprintf(name, "%s Playback Switch", pfx);
 -              err = add_control(spec, ALC_CTL_BIND_MUTE, name,
 +              err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE, pfx,
                                  HDA_COMPOSE_AMP_VAL(nid_s, 3, 2, HDA_INPUT));
                if (err < 0)
                        return err;
        } else if (alc880_is_multi_pin(pin)) {
                /* set manual connection */
                /* we have only a switch on HP-out PIN */
 -              sprintf(name, "%s Playback Switch", pfx);
 -              err = add_control(spec, ALC_CTL_WIDGET_MUTE, name,
 +              err = add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx,
                                  HDA_COMPOSE_AMP_VAL(pin, 3, 0, HDA_OUTPUT));
                if (err < 0)
                        return err;
@@@ -17241,17 -17261,21 +17244,17 @@@ static int alc662_auto_fill_dac_nids(st
        return 0;
  }
  
 -static int alc662_add_vol_ctl(struct alc_spec *spec, const char *pfx,
 +static inline int alc662_add_vol_ctl(struct alc_spec *spec, const char *pfx,
                              hda_nid_t nid, unsigned int chs)
  {
 -      char name[32];
 -      sprintf(name, "%s Playback Volume", pfx);
 -      return add_control(spec, ALC_CTL_WIDGET_VOL, name,
 +      return add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, pfx,
                           HDA_COMPOSE_AMP_VAL(nid, chs, 0, HDA_OUTPUT));
  }
  
 -static int alc662_add_sw_ctl(struct alc_spec *spec, const char *pfx,
 +static inline int alc662_add_sw_ctl(struct alc_spec *spec, const char *pfx,
                             hda_nid_t nid, unsigned int chs)
  {
 -      char name[32];
 -      sprintf(name, "%s Playback Switch", pfx);
 -      return add_control(spec, ALC_CTL_WIDGET_MUTE, name,
 +      return add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx,
                           HDA_COMPOSE_AMP_VAL(nid, chs, 0, HDA_INPUT));
  }
  
@@@ -17329,11 -17353,13 +17332,11 @@@ static int alc662_auto_create_extra_out
                return 0;
        nid = alc662_look_for_dac(codec, pin);
        if (!nid) {
 -              char name[32];
                /* the corresponding DAC is already occupied */
                if (!(get_wcaps(codec, pin) & AC_WCAP_OUT_AMP))
                        return 0; /* no way */
                /* create a switch only */
 -              sprintf(name, "%s Playback Switch", pfx);
 -              return add_control(spec, ALC_CTL_WIDGET_MUTE, name,
 +              return add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx,
                                   HDA_COMPOSE_AMP_VAL(pin, 3, 0, HDA_OUTPUT));
        }
  
  
  /* create playback/capture controls for input pins */
  #define alc662_auto_create_input_ctls \
-       alc880_auto_create_input_ctls
+       alc882_auto_create_input_ctls
  
  static void alc662_auto_set_output_and_unmute(struct hda_codec *codec,
                                              hda_nid_t nid, int pin_type,