Changeset 402
- Timestamp:
- Nov 22, 2008, 9:25:45 PM (17 years ago)
- Location:
- GPL/branches/uniaud32-2.0
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-2.0/alsa-kernel/core/control.c
r399 r402 118 118 119 119 ctl = file->private_data; 120 fasync_helper(-1, file, 0, &ctl->fasync);121 120 file->private_data = NULL; 122 121 card = ctl->card; … … 234 233 kctl.id.device = ncontrol->device; 235 234 kctl.id.subdevice = ncontrol->subdevice; 236 if (ncontrol->name) 235 if (ncontrol->name) { 237 236 strlcpy(kctl.id.name, ncontrol->name, sizeof(kctl.id.name)); 237 if (strcmp(ncontrol->name, kctl.id.name) != 0) 238 snd_printk(KERN_WARNING 239 "Control name '%s' truncated to '%s'\n", 240 ncontrol->name, kctl.id.name); 241 } 238 242 kctl.id.index = ncontrol->index; 239 243 kctl.count = ncontrol->count ? ncontrol->count : 1; -
GPL/branches/uniaud32-2.0/alsa-kernel/core/init.c
r399 r402 282 282 spin_unlock(&shutdown_lock); 283 283 284 if (likely(df)) 284 if (likely(df)) { 285 if ((file->f_flags & FASYNC) && df->disconnected_f_op->fasync) 286 df->disconnected_f_op->fasync(-1, file, 0); 285 287 return df->disconnected_f_op->release(inode, file); 288 } 286 289 287 290 #ifndef TARGET_OS2 -
GPL/branches/uniaud32-2.0/alsa-kernel/core/pcm_native.c
r399 r402 2200 2200 return -ENXIO; 2201 2201 pcm = substream->pcm; 2202 fasync_helper(-1, file, 0, &substream->runtime->fasync);2203 2202 mutex_lock(&pcm->open_mutex); 2204 2203 snd_pcm_release_substream(substream); -
GPL/branches/uniaud32-2.0/alsa-kernel/core/rawmidi.c
r399 r402 153 153 static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up) 154 154 { 155 if (!substream->opened) 156 return; 155 157 if (up) { 156 158 tasklet_hi_schedule(&substream->runtime->tasklet); … … 163 165 static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) 164 166 { 167 if (!substream->opened) 168 return; 165 169 substream->ops->trigger(substream, up); 166 170 if (!up && substream->runtime->event) … … 878 882 struct snd_rawmidi_runtime *runtime = substream->runtime; 879 883 884 if (!substream->opened) 885 return -EBADFD; 880 886 if (runtime->buffer == NULL) { 881 887 snd_printd("snd_rawmidi_receive: input is not active!!!\n"); … … 1147 1153 unsigned char *buffer, int count) 1148 1154 { 1155 if (!substream->opened) 1156 return -EBADFD; 1149 1157 count = snd_rawmidi_transmit_peek(substream, buffer, count); 1150 1158 if (count < 0) -
GPL/branches/uniaud32-2.0/alsa-kernel/core/seq/seq.c
r305 r402 48 48 int seq_default_timer_card = -1; 49 49 int seq_default_timer_device = 50 #ifdef CONFIG_SND_SEQ_RTCTIMER_DEFAULT 50 #ifdef CONFIG_SND_SEQ_HRTIMER_DEFAULT 51 SNDRV_TIMER_GLOBAL_HRTIMER 52 #elif defined(CONFIG_SND_SEQ_RTCTIMER_DEFAULT) 51 53 SNDRV_TIMER_GLOBAL_RTC 52 54 #else -
GPL/branches/uniaud32-2.0/alsa-kernel/core/timer.c
r399 r402 1280 1280 tu = file->private_data; 1281 1281 file->private_data = NULL; 1282 fasync_helper(-1, file, 0, &tu->fasync);1283 1282 if (tu->timeri) 1284 1283 snd_timer_close(tu->timeri); -
GPL/branches/uniaud32-2.0/alsa-kernel/include/sound/ac97_codec.h
r358 r402 282 282 #define AC97_AD_TEST 0x5a /* test register */ 283 283 #define AC97_AD_TEST2 0x5c /* undocumented test register 2 */ 284 #define AC97_AD_HPFD_SHIFT 12 /* High Pass Filter Disable */ 284 285 #define AC97_AD_CODEC_CFG 0x70 /* codec configuration */ 285 286 #define AC97_AD_JACK_SPDIF 0x72 /* Jack Sense & S/PDIF */ 286 287 #define AC97_AD_SERIAL_CFG 0x74 /* Serial Configuration */ 287 288 #define AC97_AD_MISC 0x76 /* Misc Control Bits */ 289 #define AC97_AD_VREFD_SHIFT 2 /* V_REFOUT Disable (AD1888) */ 288 290 289 291 /* specific - Cirrus Logic */ -
GPL/branches/uniaud32-2.0/alsa-kernel/include/sound/asound.h
r399 r402 602 602 #define SNDRV_TIMER_GLOBAL_RTC 1 603 603 #define SNDRV_TIMER_GLOBAL_HPET 2 604 #define SNDRV_TIMER_GLOBAL_HRTIMER 3 604 605 605 606 /* info flags */ -
GPL/branches/uniaud32-2.0/alsa-kernel/include/sound/core.h
r399 r402 377 377 * @fmt: format string 378 378 * 379 * Works like print () but prints the file and the line of the caller379 * Works like printk() but prints the file and the line of the caller 380 380 * when configured with CONFIG_SND_VERBOSE_PRINTK. 381 381 */ … … 408 408 #endif 409 409 410 /** 411 * snd_BUG - give a BUG warning message and stack trace 412 * 413 * Calls WARN() if CONFIG_SND_DEBUG is set. 414 * Ignored when CONFIG_SND_DEBUG is not set. 415 */ 410 416 #define snd_BUG() WARN(1, "BUG?\n") 417 418 /** 419 * snd_BUG_ON - debugging check macro 420 * @cond: condition to evaluate 421 * 422 * When CONFIG_SND_DEBUG is set, this macro evaluates the given condition, 423 * and call WARN() and returns the value if it's non-zero. 424 * 425 * When CONFIG_SND_DEBUG is not set, this just returns zero, and the given 426 * condition is ignored. 427 * 428 * NOTE: the argument won't be evaluated at all when CONFIG_SND_DEBUG=n. 429 * Thus, don't put any statement that influences on the code behavior, 430 * such as pre/post increment, to the argument of this macro. 431 * If you want to evaluate and give a warning, use standard WARN_ON(). 432 */ 433 411 434 #define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond)) 412 435 … … 414 437 415 438 #ifndef TARGET_OS2 416 #define snd_printd(fmt, args...) /* nothing */ 417 #define snd_BUG() /* nothing */ 418 #define snd_BUG_ON(cond) ({/*(void)(cond);*/ 0;}) /* always false */ 439 #define snd_printd(fmt, args...) do { } while (0) 440 #define snd_BUG() do { } while (0) 441 static inline int __snd_bug_on(int cond) 442 { 443 return 0; 444 } 445 #define snd_BUG_ON(cond) __snd_bug_on(0 && (cond)) /* always false */ 419 446 #else 420 447 #define snd_printd snd_printk 421 #define snd_BUG() /* nothing */ 422 #define snd_BUG_ON(cond) 0 /* always false */ 448 #define snd_BUG() do { } while (0) 449 static inline int __snd_bug_on(int cond) 450 { 451 return 0; 452 } 453 #define snd_BUG_ON(cond) __snd_bug_on(0 && (cond)) /* always false */ 423 454 #endif 424 455 -
GPL/branches/uniaud32-2.0/alsa-kernel/include/sound/soc.h
r399 r402 22 22 #include <sound/ac97_codec.h> 23 23 24 #define SND_SOC_VERSION "0.13.2"25 26 24 /* 27 25 * Convenience kcontrol builders … … 29 27 #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ 30 28 ((unsigned long)&(struct soc_mixer_control) \ 31 {.reg = xreg, .shift = xshift, .max = xmax, .invert = xinvert}) 29 {.reg = xreg, .shift = xshift, .rshift = xshift, .max = xmax, \ 30 .invert = xinvert}) 32 31 #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ 33 32 ((unsigned long)&(struct soc_mixer_control) \ … … 426 425 427 426 /* dapm */ 427 u32 pop_time; 428 428 struct list_head dapm_widgets; 429 429 struct list_head dapm_paths; … … 517 517 struct work_struct deferred_resume_work; 518 518 void *codec_data; 519 #ifdef CONFIG_DEBUG_FS 520 struct dentry *debugfs_root; 521 #endif 519 522 }; 520 523 -
GPL/branches/uniaud32-2.0/alsa-kernel/include/sound/version.h
r399 r402 1 1 /* include/version.h */ 2 #define CONFIG_SND_VERSION "1.0.18 "2 #define CONFIG_SND_VERSION "1.0.18a" 3 3 #define CONFIG_SND_DATE "" -
GPL/branches/uniaud32-2.0/alsa-kernel/isa/ad1848/ad1848.c
r399 r402 71 71 72 72 if (port[n] == SNDRV_AUTO_PORT) { 73 snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id);73 dev_err(dev, "please specify port\n"); 74 74 return 0; 75 75 } 76 76 if (irq[n] == SNDRV_AUTO_IRQ) { 77 snd_printk(KERN_ERR "%s: please specify irq\n", dev->bus_id);77 dev_err(dev, "please specify irq\n"); 78 78 return 0; 79 79 } 80 80 if (dma1[n] == SNDRV_AUTO_DMA) { 81 snd_printk(KERN_ERR "%s: please specify dma1\n", dev->bus_id);81 dev_err(dev, "please specify dma1\n"); 82 82 return 0; 83 83 } -
GPL/branches/uniaud32-2.0/alsa-kernel/isa/cs423x/cs4231.c
r399 r402 75 75 76 76 if (port[n] == SNDRV_AUTO_PORT) { 77 snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id);77 dev_err(dev, "please specify port\n"); 78 78 return 0; 79 79 } 80 80 if (irq[n] == SNDRV_AUTO_IRQ) { 81 snd_printk(KERN_ERR "%s: please specify irq\n", dev->bus_id);81 dev_err(dev, "please specify irq\n"); 82 82 return 0; 83 83 } 84 84 if (dma1[n] == SNDRV_AUTO_DMA) { 85 snd_printk(KERN_ERR "%s: please specify dma1\n", dev->bus_id);85 dev_err(dev, "please specify dma1\n"); 86 86 return 0; 87 87 } … … 134 134 mpu_irq[n] >= 0 ? IRQF_DISABLED : 0, 135 135 NULL) < 0) 136 printk(KERN_WARNING "%s: MPU401 not detected\n", dev->bus_id);136 dev_warn(dev, "MPU401 not detected\n"); 137 137 } 138 138 -
GPL/branches/uniaud32-2.0/alsa-kernel/isa/cs423x/cs4236.c
r399 r402 489 489 490 490 if (port[dev] == SNDRV_AUTO_PORT) { 491 snd_printk(KERN_ERR "%s: please specify port\n", pdev->bus_id);491 dev_err(pdev, "please specify port\n"); 492 492 return 0; 493 493 } 494 494 if (cport[dev] == SNDRV_AUTO_PORT) { 495 snd_printk(KERN_ERR "%s: please specify cport\n", pdev->bus_id);495 dev_err(pdev, "please specify cport\n"); 496 496 return 0; 497 497 } 498 498 if (irq[dev] == SNDRV_AUTO_IRQ) { 499 snd_printk(KERN_ERR "%s: please specify irq\n", pdev->bus_id);499 dev_err(pdev, "please specify irq\n"); 500 500 return 0; 501 501 } 502 502 if (dma1[dev] == SNDRV_AUTO_DMA) { 503 snd_printk(KERN_ERR "%s: please specify dma1\n", pdev->bus_id);503 dev_err(pdev, "please specify dma1\n"); 504 504 return 0; 505 505 } -
GPL/branches/uniaud32-2.0/alsa-kernel/isa/es1688/es1688.c
r305 r402 89 89 irq[n] = snd_legacy_find_free_irq(possible_irqs); 90 90 if (irq[n] < 0) { 91 snd_printk(KERN_ERR "%s: unable to find a free IRQ\n", 92 dev->bus_id); 91 dev_err(dev, "unable to find a free IRQ\n"); 93 92 return -EBUSY; 94 93 } … … 97 96 dma8[n] = snd_legacy_find_free_dma(possible_dmas); 98 97 if (dma8[n] < 0) { 99 snd_printk(KERN_ERR "%s: unable to find a free DMA\n", 100 dev->bus_id); 98 dev_err(dev, "unable to find a free DMA\n"); 101 99 return -EBUSY; 102 100 } … … 148 146 if (snd_opl3_create(card, chip->port, chip->port + 2, 149 147 OPL3_HW_OPL3, 0, &opl3) < 0) 150 printk(KERN_WARNING "%s: opl3 not detected at 0x%lx\n", 151 dev->bus_id, chip->port); 148 dev_warn(dev, "opl3 not detected at 0x%lx\n", chip->port); 152 149 else { 153 150 error = snd_opl3_hwdep_new(opl3, 0, 1, NULL); -
GPL/branches/uniaud32-2.0/alsa-kernel/isa/gus/gusclassic.c
r305 r402 91 91 irq[n] = snd_legacy_find_free_irq(possible_irqs); 92 92 if (irq[n] < 0) { 93 snd_printk(KERN_ERR "%s: unable to find a free IRQ\n", 94 dev->bus_id); 93 dev_err(dev, "unable to find a free IRQ\n"); 95 94 return -EBUSY; 96 95 } … … 99 98 dma1[n] = snd_legacy_find_free_dma(possible_dmas); 100 99 if (dma1[n] < 0) { 101 snd_printk(KERN_ERR "%s: unable to find a free DMA1\n", 102 dev->bus_id); 100 dev_err(dev, "unable to find a free DMA1\n"); 103 101 return -EBUSY; 104 102 } … … 107 105 dma2[n] = snd_legacy_find_free_dma(possible_dmas); 108 106 if (dma2[n] < 0) { 109 snd_printk(KERN_ERR "%s: unable to find a free DMA2\n", 110 dev->bus_id); 107 dev_err(dev, "unable to find a free DMA2\n"); 111 108 return -EBUSY; 112 109 } … … 175 172 error = -ENODEV; 176 173 if (gus->max_flag || gus->ess_flag) { 177 snd_printk(KERN_ERR "%s:GUS Classic or ACE soundcard was "178 "not detected at 0x%lx\n", dev->bus_id,gus->gf1.port);174 dev_err(dev, "GUS Classic or ACE soundcard was " 175 "not detected at 0x%lx\n", gus->gf1.port); 179 176 goto out; 180 177 } -
GPL/branches/uniaud32-2.0/alsa-kernel/isa/gus/gusextreme.c
r305 r402 107 107 irq[n] = snd_legacy_find_free_irq(possible_irqs); 108 108 if (irq[n] < 0) { 109 snd_printk(KERN_ERR "%s: unable to find a free IRQ " 110 "for ES1688\n", dev->bus_id); 109 dev_err(dev, "unable to find a free IRQ for ES1688\n"); 111 110 return -EBUSY; 112 111 } … … 115 114 dma8[n] = snd_legacy_find_free_dma(possible_dmas); 116 115 if (dma8[n] < 0) { 117 snd_printk(KERN_ERR "%s: unable to find a free DMA " 118 "for ES1688\n", dev->bus_id); 116 dev_err(dev, "unable to find a free DMA for ES1688\n"); 119 117 return -EBUSY; 120 118 } … … 144 142 gf1_irq[n] = snd_legacy_find_free_irq(possible_irqs); 145 143 if (gf1_irq[n] < 0) { 146 snd_printk(KERN_ERR "%s: unable to find a free IRQ " 147 "for GF1\n", dev->bus_id); 144 dev_err(dev, "unable to find a free IRQ for GF1\n"); 148 145 return -EBUSY; 149 146 } … … 152 149 dma1[n] = snd_legacy_find_free_dma(possible_dmas); 153 150 if (dma1[n] < 0) { 154 snd_printk(KERN_ERR "%s: unable to find a free DMA " 155 "for GF1\n", dev->bus_id); 151 dev_err(dev, "unable to find a free DMA for GF1\n"); 156 152 return -EBUSY; 157 153 } … … 279 275 error = -ENODEV; 280 276 if (!gus->ess_flag) { 281 snd_printk(KERN_ERR "%s:GUS Extreme soundcard was not "282 "detected at 0x%lx\n", dev->bus_id,gus->gf1.port);277 dev_err(dev, "GUS Extreme soundcard was not " 278 "detected at 0x%lx\n", gus->gf1.port); 283 279 goto out; 284 280 } … … 311 307 if (snd_opl3_create(card, es1688->port, es1688->port + 2, 312 308 OPL3_HW_OPL3, 0, &opl3) < 0) 313 printk(KERN_ERR "%s: opl3 not detected at 0x%lx\n", 314 dev->bus_id, es1688->port); 309 dev_warn(dev, "opl3 not detected at 0x%lx\n", es1688->port); 315 310 else { 316 311 error = snd_opl3_hwdep_new(opl3, 0, 2, NULL); -
GPL/branches/uniaud32-2.0/alsa-kernel/isa/sb/sb8.c
r305 r402 86 86 return 0; 87 87 if (irq[dev] == SNDRV_AUTO_IRQ) { 88 snd_printk(KERN_ERR "%s: please specify irq\n", pdev->bus_id);88 dev_err(pdev, "please specify irq\n"); 89 89 return 0; 90 90 } 91 91 if (dma8[dev] == SNDRV_AUTO_DMA) { 92 snd_printk(KERN_ERR "%s: please specify dma8\n", pdev->bus_id);92 dev_err(pdev, "please specify dma8\n"); 93 93 return 0; 94 94 } -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/ac97/ac97_codec.c
r399 r402 1967 1967 ac97->dev.parent = ac97->bus->card->dev; 1968 1968 ac97->dev.release = ac97_device_release; 1969 snprintf(ac97->dev.bus_id, BUS_ID_SIZE, "%d-%d:%s",1970 ac97->bus->card->number, ac97->num,1971 snd_ac97_get_short_name(ac97));1969 dev_set_name(&ac97->dev, "%d-%d:%s", 1970 ac97->bus->card->number, ac97->num, 1971 snd_ac97_get_short_name(ac97)); 1972 1972 if ((err = device_register(&ac97->dev)) < 0) { 1973 1973 snd_printk(KERN_ERR "Can't register ac97 bus\n"); -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/ac97/ac97_patch.c
r399 r402 2055 2055 .put = snd_ac97_ad1888_lohpsel_put 2056 2056 }, 2057 AC97_SINGLE("V_REFOUT Enable", AC97_AD_MISC, 2, 1, 1), 2058 AC97_SINGLE("High Pass Filter Enable", AC97_AD_TEST2, 12, 1, 1), 2057 AC97_SINGLE("V_REFOUT Enable", AC97_AD_MISC, AC97_AD_VREFD_SHIFT, 1, 1), 2058 AC97_SINGLE("High Pass Filter Enable", AC97_AD_TEST2, 2059 AC97_AD_HPFD_SHIFT, 1, 1), 2059 2060 AC97_SINGLE("Spread Front to Surround and Center/LFE", AC97_AD_MISC, 7, 1, 0), 2060 2061 { -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/emu10k1/emu10k1_main.c
r399 r402 1474 1474 .spk71 = 1, 1475 1475 .spdif_bug = 1, 1476 .invert_shared_spdif = 1, /* digital/analog switch swapped */ 1476 1477 .ac97_chip = 1} , 1477 1478 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20021102, … … 1483 1484 .spk71 = 1, 1484 1485 .spdif_bug = 1, 1486 .invert_shared_spdif = 1, /* digital/analog switch swapped */ 1485 1487 .ac97_chip = 1} , 1486 1488 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20011102, … … 1492 1494 .spk71 = 1, 1493 1495 .spdif_bug = 1, 1496 .invert_shared_spdif = 1, /* digital/analog switch swapped */ 1494 1497 .ac97_chip = 1} , 1495 1498 /* Audigy 2 */ -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/hda/hda_codec.c
r399 r402 65 65 { 0x17e8, "Chrontel" }, 66 66 { 0x1854, "LG" }, 67 { 0x1aec, "Wolfson Microelectronics" }, 67 68 { 0x434d, "C-Media" }, 68 69 { 0x8384, "SigmaTel" }, … … 98 99 snd_hda_preset_nvhdmi, 99 100 #endif 101 #ifdef CONFIG_SND_HDA_CODEC_INTELHDMI 102 snd_hda_preset_intelhdmi, 103 #endif 100 104 NULL 101 105 }; … … 154 158 } 155 159 160 /* 161 * Compose a 32bit command word to be sent to the HD-audio controller 162 */ 163 static inline unsigned int 164 make_codec_cmd(struct hda_codec *codec, hda_nid_t nid, int direct, 165 unsigned int verb, unsigned int parm) 166 { 167 u32 val; 168 169 val = (u32)(codec->addr & 0x0f) << 28; 170 val |= (u32)direct << 27; 171 val |= (u32)nid << 20; 172 val |= verb << 8; 173 val |= parm; 174 return val; 175 } 176 156 177 /** 157 178 * snd_hda_codec_read - send a command and get the response … … 170 191 unsigned int verb, unsigned int parm) 171 192 { 193 struct hda_bus *bus = codec->bus; 172 194 unsigned int res; 195 196 res = make_codec_cmd(codec, nid, direct, verb, parm); 173 197 snd_hda_power_up(codec); 174 mutex_lock(& codec->bus->cmd_mutex);175 if (! codec->bus->ops.command(codec, nid, direct, verb, parm))176 res = codec->bus->ops.get_response(codec);198 mutex_lock(&bus->cmd_mutex); 199 if (!bus->ops.command(bus, res)) 200 res = bus->ops.get_response(bus); 177 201 else 178 202 res = (unsigned int)-1; 179 mutex_unlock(& codec->bus->cmd_mutex);203 mutex_unlock(&bus->cmd_mutex); 180 204 snd_hda_power_down(codec); 181 205 return res; … … 197 221 unsigned int verb, unsigned int parm) 198 222 { 223 struct hda_bus *bus = codec->bus; 224 unsigned int res; 199 225 int err; 226 227 res = make_codec_cmd(codec, nid, direct, verb, parm); 200 228 snd_hda_power_up(codec); 201 mutex_lock(& codec->bus->cmd_mutex);202 err = codec->bus->ops.command(codec, nid, direct, verb, parm);203 mutex_unlock(& codec->bus->cmd_mutex);229 mutex_lock(&bus->cmd_mutex); 230 err = bus->ops.command(bus, res); 231 mutex_unlock(&bus->cmd_mutex); 204 232 snd_hda_power_down(codec); 205 233 return err; … … 866 894 u16 idx = key % (u16)ARRAY_SIZE(cache->hash); 867 895 u16 cur = cache->hash[idx]; 868 struct hda_cache_head *info_head = cache->buf.list;869 896 struct hda_cache_head *info; 870 897 871 898 while (cur != 0xffff) { 872 info = &info_head[cur];899 info = snd_array_elem(&cache->buf, cur); 873 900 if (info->key == key) 874 901 return info; … … 878 905 /* add a new hash entry */ 879 906 info = snd_array_new(&cache->buf); 907 if (!info) 908 return NULL; 909 cur = snd_array_index(&cache->buf, info); 880 910 info->key = key; 881 911 info->val = 0; … … 1703 1733 for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) { 1704 1734 kctl = snd_ctl_new1(dig_mix, codec); 1735 if (!kctl) 1736 return -ENOMEM; 1705 1737 kctl->id.index = idx; 1706 1738 kctl->private_value = nid; … … 1887 1919 int direct, unsigned int verb, unsigned int parm) 1888 1920 { 1921 struct hda_bus *bus = codec->bus; 1922 unsigned int res; 1889 1923 int err; 1924 1925 res = make_codec_cmd(codec, nid, direct, verb, parm); 1890 1926 snd_hda_power_up(codec); 1891 mutex_lock(& codec->bus->cmd_mutex);1892 err = codec->bus->ops.command(codec, nid, direct, verb, parm);1927 mutex_lock(&bus->cmd_mutex); 1928 err = bus->ops.command(bus, res); 1893 1929 if (!err) { 1894 1930 struct hda_cache_head *c; … … 1898 1934 c->val = parm; 1899 1935 } 1900 mutex_unlock(& codec->bus->cmd_mutex);1936 mutex_unlock(&bus->cmd_mutex); 1901 1937 snd_hda_power_down(codec); 1902 1938 return err; … … 2416 2452 snd_hda_attach_pcm(struct hda_codec *codec, struct hda_pcm *pcm) 2417 2453 { 2454 struct hda_bus *bus = codec->bus; 2418 2455 struct hda_pcm_stream *info; 2419 2456 int stream, err; 2420 2457 2421 if ( !pcm->name)2458 if (snd_BUG_ON(!pcm->name)) 2422 2459 return -EINVAL; 2423 2460 for (stream = 0; stream < 2; stream++) { … … 2429 2466 } 2430 2467 } 2431 return codec->bus->ops.attach_pcm(codec, pcm);2468 return bus->ops.attach_pcm(bus, codec, pcm); 2432 2469 } 2433 2470 … … 2490 2527 int type = cpcm->pcm_type; 2491 2528 int dev; 2529 2530 if (!cpcm->stream[0].substreams && 2531 !cpcm->stream[1].substreams) 2532 continue; /* no substreams assigned */ 2533 2492 2534 switch (type) { 2493 2535 case HDA_PCM_TYPE_AUDIO: … … 2625 2667 struct hda_codec *codec = 2626 2668 container_of(work, struct hda_codec, power_work.work); 2669 struct hda_bus *bus = codec->bus; 2627 2670 2628 2671 if (!codec->power_on || codec->power_count) { … … 2632 2675 2633 2676 hda_call_codec_suspend(codec); 2634 if ( codec->bus->ops.pm_notify)2635 codec->bus->ops.pm_notify(codec);2677 if (bus->ops.pm_notify) 2678 bus->ops.pm_notify(bus); 2636 2679 } 2637 2680 … … 2644 2687 void snd_hda_power_up(struct hda_codec *codec) 2645 2688 { 2689 struct hda_bus *bus = codec->bus; 2690 2646 2691 codec->power_count++; 2647 2692 if (codec->power_on || codec->power_transition) … … 2649 2694 2650 2695 codec->power_on = 1; 2651 if ( codec->bus->ops.pm_notify)2652 codec->bus->ops.pm_notify(codec);2696 if (bus->ops.pm_notify) 2697 bus->ops.pm_notify(bus); 2653 2698 hda_call_codec_resume(codec); 2654 2699 cancel_delayed_work(&codec->power_work); … … 3362 3407 if (array->used >= array->alloced) { 3363 3408 int num = array->alloced + array->alloc_align; 3364 void *nlist = kcalloc(num + 1, array->elem_size, GFP_KERNEL); 3409 void *nlist; 3410 if (snd_BUG_ON(num >= 4096)) 3411 return NULL; 3412 nlist = kcalloc(num + 1, array->elem_size, GFP_KERNEL); 3365 3413 if (!nlist) 3366 3414 return NULL; … … 3373 3421 array->alloced = num; 3374 3422 } 3375 return array->list + (array->used++ * array->elem_size);3423 return snd_array_elem(array, array->used++); 3376 3424 } 3377 3425 -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/hda/hda_codec.h
r399 r402 540 540 } 541 541 542 static inline void *snd_array_elem(struct snd_array *array, unsigned int idx) 543 { 544 return array->list + idx * array->elem_size; 545 } 546 547 static inline unsigned int snd_array_index(struct snd_array *array, void *ptr) 548 { 549 return (unsigned long)(ptr - array->list) / array->elem_size; 550 } 551 542 552 /* 543 553 * Structures … … 557 567 struct hda_bus_ops { 558 568 /* send a single command */ 559 int (*command)(struct hda_codec *codec, hda_nid_t nid, int direct, 560 unsigned int verb, unsigned int parm); 569 int (*command)(struct hda_bus *bus, unsigned int cmd); 561 570 /* get a response from the last command */ 562 unsigned int (*get_response)(struct hda_ codec *codec);571 unsigned int (*get_response)(struct hda_bus *bus); 563 572 /* free the private data */ 564 573 void (*private_free)(struct hda_bus *); 565 574 /* attach a PCM stream */ 566 int (*attach_pcm)(struct hda_codec *codec, struct hda_pcm *pcm); 575 int (*attach_pcm)(struct hda_bus *bus, struct hda_codec *codec, 576 struct hda_pcm *pcm); 567 577 #ifdef CONFIG_SND_HDA_POWER_SAVE 568 578 /* notify power-up/down from codec to controller */ 569 void (*pm_notify)(struct hda_ codec *codec);579 void (*pm_notify)(struct hda_bus *bus); 570 580 #endif 571 581 }; -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/hda/hda_intel.c
r399 r402 46 46 #include <linux/pci.h> 47 47 #include <linux/mutex.h> 48 #include <linux/reboot.h> 48 49 #include <sound/core.h> 49 50 #include <sound/initval.h> … … 411 412 unsigned int irq_pending_warned :1; 412 413 unsigned int via_dmapos_patch :1; /* enable DMA-position fix for VIA */ 414 unsigned int probing :1; /* codec probing phase */ 413 415 414 416 /* for debugging */ … … 417 419 /* for pending irqs */ 418 420 struct work_struct irq_pending_work; 421 422 /* reboot notifier (for mysterious hangup problem at power-down) */ 423 struct notifier_block reboot_notifier; 419 424 }; 420 425 … … 543 548 544 549 /* send a command */ 545 static int azx_corb_send_cmd(struct hda_ codec *codec, u32 val)546 { 547 struct azx *chip = codec->bus->private_data;550 static int azx_corb_send_cmd(struct hda_bus *bus, u32 val) 551 { 552 struct azx *chip = bus->private_data; 548 553 unsigned int wp; 549 554 … … 593 598 594 599 /* receive a response */ 595 static unsigned int azx_rirb_get_response(struct hda_ codec *codec)596 { 597 struct azx *chip = codec->bus->private_data;600 static unsigned int azx_rirb_get_response(struct hda_bus *bus) 601 { 602 struct azx *chip = bus->private_data; 598 603 unsigned long timeout; 599 604 … … 612 617 if (time_after(jiffies, timeout)) 613 618 break; 614 if ( codec->bus->needs_damn_long_delay)619 if (bus->needs_damn_long_delay) 615 620 msleep(2); /* temporary workaround */ 616 621 else { … … 640 645 } 641 646 647 if (chip->probing) { 648 /* If this critical timeout happens during the codec probing 649 * phase, this is likely an access to a non-existing codec 650 * slot. Better to return an error and reset the system. 651 */ 652 return -1; 653 } 654 642 655 snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, " 643 656 "switching to single_cmd mode: last cmd=0x%08x\n", … … 662 675 663 676 /* send a command */ 664 static int azx_single_send_cmd(struct hda_ codec *codec, u32 val)665 { 666 struct azx *chip = codec->bus->private_data;677 static int azx_single_send_cmd(struct hda_bus *bus, u32 val) 678 { 679 struct azx *chip = bus->private_data; 667 680 int timeout = 50; 668 681 … … 687 700 688 701 /* receive a response */ 689 static unsigned int azx_single_get_response(struct hda_ codec *codec)690 { 691 struct azx *chip = codec->bus->private_data;702 static unsigned int azx_single_get_response(struct hda_bus *bus) 703 { 704 struct azx *chip = bus->private_data; 692 705 int timeout = 50; 693 706 … … 712 725 713 726 /* send a command */ 714 static int azx_send_cmd(struct hda_codec *codec, hda_nid_t nid, 715 int direct, unsigned int verb, 716 unsigned int para) 717 { 718 struct azx *chip = codec->bus->private_data; 719 u32 val; 720 721 val = (u32)(codec->addr & 0x0f) << 28; 722 val |= (u32)direct << 27; 723 val |= (u32)nid << 20; 724 val |= verb << 8; 725 val |= para; 727 static int azx_send_cmd(struct hda_bus *bus, unsigned int val) 728 { 729 struct azx *chip = bus->private_data; 730 726 731 chip->last_cmd = val; 727 728 732 if (chip->single_cmd) 729 return azx_single_send_cmd( codec, val);733 return azx_single_send_cmd(bus, val); 730 734 else 731 return azx_corb_send_cmd( codec, val);735 return azx_corb_send_cmd(bus, val); 732 736 } 733 737 734 738 /* get a response */ 735 static unsigned int azx_get_response(struct hda_ codec *codec)736 { 737 struct azx *chip = codec->bus->private_data;739 static unsigned int azx_get_response(struct hda_bus *bus) 740 { 741 struct azx *chip = bus->private_data; 738 742 if (chip->single_cmd) 739 return azx_single_get_response( codec);743 return azx_single_get_response(bus); 740 744 else 741 return azx_rirb_get_response( codec);745 return azx_rirb_get_response(bus); 742 746 } 743 747 744 748 #ifdef CONFIG_SND_HDA_POWER_SAVE 745 static void azx_power_notify(struct hda_ codec *codec);749 static void azx_power_notify(struct hda_bus *bus); 746 750 #endif 747 751 … … 1218 1222 } 1219 1223 1220 static int azx_attach_pcm_stream(struct hda_codec *codec, struct hda_pcm *cpcm); 1224 /* 1225 * Probe the given codec address 1226 */ 1227 static int probe_codec(struct azx *chip, int addr) 1228 { 1229 unsigned int cmd = (addr << 28) | (AC_NODE_ROOT << 20) | 1230 (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; 1231 unsigned int res; 1232 1233 chip->probing = 1; 1234 azx_send_cmd(chip->bus, cmd); 1235 res = azx_get_response(chip->bus); 1236 chip->probing = 0; 1237 if (res == -1) 1238 return -EIO; 1239 snd_printdd("hda_intel: codec #%d probed OK\n", addr); 1240 return 0; 1241 } 1242 1243 static int azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec, 1244 struct hda_pcm *cpcm); 1245 static void azx_stop_chip(struct azx *chip); 1221 1246 1222 1247 /* … … 1229 1254 }; 1230 1255 1231 /* number of slots to probe as default1232 * this can be different from azx_max_codecs[] -- e.g. some boards1233 * report wrongly the non-existing 4th slot availability1234 */1235 static unsigned int azx_default_codecs[AZX_NUM_DRIVERS] __devinitdata = {1236 [AZX_DRIVER_ICH] = 3,1237 [AZX_DRIVER_ATI] = 3,1238 };1239 1240 1256 static int __devinit azx_codec_create(struct azx *chip, const char *model, 1241 1257 unsigned int codec_probe_mask) 1242 1258 { 1243 1259 struct hda_bus_template bus_temp; 1244 int c, codecs, audio_codecs,err;1245 int def_slots,max_slots;1260 int c, codecs, err; 1261 int max_slots; 1246 1262 1247 1263 memset(&bus_temp, 0, sizeof(bus_temp)); … … 1263 1279 chip->bus->needs_damn_long_delay = 1; 1264 1280 1265 codecs = audio_codecs =0;1281 codecs = 0; 1266 1282 max_slots = azx_max_codecs[chip->driver_type]; 1267 1283 if (!max_slots) 1268 1284 max_slots = AZX_MAX_CODECS; 1269 def_slots = azx_default_codecs[chip->driver_type]; 1270 if (!def_slots) 1271 def_slots = max_slots; 1272 for (c = 0; c < def_slots; c++) { 1285 1286 /* First try to probe all given codec slots */ 1287 for (c = 0; c < max_slots; c++) { 1288 if ((chip->codec_mask & (1 << c)) & codec_probe_mask) { 1289 if (probe_codec(chip, c) < 0) { 1290 /* Some BIOSen give you wrong codec addresses 1291 * that don't exist 1292 */ 1293 snd_printk(KERN_WARNING 1294 "hda_intel: Codec #%d probe error; " 1295 "disabling it...\n", c); 1296 chip->codec_mask &= ~(1 << c); 1297 /* More badly, accessing to a non-existing 1298 * codec often screws up the controller chip, 1299 * and distrubs the further communications. 1300 * Thus if an error occurs during probing, 1301 * better to reset the controller chip to 1302 * get back to the sanity state. 1303 */ 1304 azx_stop_chip(chip); 1305 azx_init_chip(chip); 1306 } 1307 } 1308 } 1309 1310 /* Then create codec instances */ 1311 for (c = 0; c < max_slots; c++) { 1273 1312 if ((chip->codec_mask & (1 << c)) & codec_probe_mask) { 1274 1313 struct hda_codec *codec; … … 1277 1316 continue; 1278 1317 codecs++; 1279 if (codec->afg)1280 audio_codecs++;1281 }1282 }1283 if (!audio_codecs) {1284 /* probe additional slots if no codec is found */1285 for (; c < max_slots; c++) {1286 if ((chip->codec_mask & (1 << c)) & codec_probe_mask) {1287 err = snd_hda_codec_new(chip->bus, c, NULL);1288 if (err < 0)1289 continue;1290 codecs++;1291 }1292 1318 } 1293 1319 } … … 1766 1792 1767 1793 static int 1768 azx_attach_pcm_stream(struct hda_codec *codec, struct hda_pcm *cpcm) 1769 { 1770 struct azx *chip = codec->bus->private_data; 1794 azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec, 1795 struct hda_pcm *cpcm) 1796 { 1797 struct azx *chip = bus->private_data; 1771 1798 struct snd_pcm *pcm; 1772 1799 struct azx_pcm *apcm; … … 1888 1915 #ifdef CONFIG_SND_HDA_POWER_SAVE 1889 1916 /* power-up/down the controller */ 1890 static void azx_power_notify(struct hda_ codec *codec)1891 { 1892 struct azx *chip = codec->bus->private_data;1917 static void azx_power_notify(struct hda_bus *bus) 1918 { 1919 struct azx *chip = bus->private_data; 1893 1920 struct hda_codec *c; 1894 1921 int power_on = 0; 1895 1922 1896 list_for_each_entry(c, &codec->bus->codec_list, list, struct hda_codec) {1923 list_for_each_entry(c, &bus->codec_list, list, struct hda_codec) { 1897 1924 if (c->power_on) { 1898 1925 power_on = 1; … … 1968 1995 1969 1996 /* 1997 * reboot notifier for hang-up problem at power-down 1998 */ 1999 static int azx_halt(struct notifier_block *nb, unsigned long event, void *buf) 2000 { 2001 struct azx *chip = container_of(nb, struct azx, reboot_notifier); 2002 azx_stop_chip(chip); 2003 return NOTIFY_OK; 2004 } 2005 2006 static void azx_notifier_register(struct azx *chip) 2007 { 2008 chip->reboot_notifier.notifier_call = azx_halt; 2009 register_reboot_notifier(&chip->reboot_notifier); 2010 } 2011 2012 static void azx_notifier_unregister(struct azx *chip) 2013 { 2014 if (chip->reboot_notifier.notifier_call) 2015 unregister_reboot_notifier(&chip->reboot_notifier); 2016 } 2017 2018 /* 1970 2019 * destructor 1971 2020 */ … … 1973 2022 { 1974 2023 int i; 2024 2025 azx_notifier_unregister(chip); 1975 2026 1976 2027 if (chip->initialized) { … … 2059 2110 SND_PCI_QUIRK(0x17aa, 0x2010, "Thinkpad X/T/R60", 0x01), 2060 2111 SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X/T/R61", 0x01), 2112 /* broken BIOS */ 2113 SND_PCI_QUIRK(0x1028, 0x20ac, "Dell Studio Desktop", 0x01), 2061 2114 {0} 2062 2115 }; … … 2340 2393 chip->running = 1; 2341 2394 power_down_all_codecs(chip); 2395 azx_notifier_register(chip); 2342 2396 2343 2397 dev++; -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/hda/hda_local.h
r399 r402 371 371 #define AMP_IN_MUTE(idx) (0x7080 | ((idx)<<8)) 372 372 #define AMP_IN_UNMUTE(idx) (0x7000 | ((idx)<<8)) 373 #define AMP_OUT_MUTE 0xb080374 #define AMP_OUT_UNMUTE 0xb000375 #define AMP_OUT_ZERO 0xb000373 #define AMP_OUT_MUTE 0xb080 374 #define AMP_OUT_UNMUTE 0xb000 375 #define AMP_OUT_ZERO 0xb000 376 376 /* pinctl values */ 377 377 #define PIN_IN (AC_PINCTL_IN_EN) 378 #define PIN_VREFHIZ (AC_PINCTL_IN_EN | AC_PINCTL_VREF_HIZ)378 #define PIN_VREFHIZ (AC_PINCTL_IN_EN | AC_PINCTL_VREF_HIZ) 379 379 #define PIN_VREF50 (AC_PINCTL_IN_EN | AC_PINCTL_VREF_50) 380 #define PIN_VREFGRD (AC_PINCTL_IN_EN | AC_PINCTL_VREF_GRD)380 #define PIN_VREFGRD (AC_PINCTL_IN_EN | AC_PINCTL_VREF_GRD) 381 381 #define PIN_VREF80 (AC_PINCTL_IN_EN | AC_PINCTL_VREF_80) 382 #define PIN_VREF100 (AC_PINCTL_IN_EN | AC_PINCTL_VREF_100)383 #define PIN_OUT (AC_PINCTL_OUT_EN)382 #define PIN_VREF100 (AC_PINCTL_IN_EN | AC_PINCTL_VREF_100) 383 #define PIN_OUT (AC_PINCTL_OUT_EN) 384 384 #define PIN_HP (AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN) 385 385 #define PIN_HP_AMP (AC_PINCTL_HP_EN) -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/hda/hda_patch.h
r399 r402 21 21 /* NVIDIA HDMI codecs */ 22 22 extern struct hda_codec_preset snd_hda_preset_nvhdmi[]; 23 /* INTEL HDMI codecs */ 24 extern struct hda_codec_preset snd_hda_preset_intelhdmi[]; -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/hda/hda_proc.c
r399 r402 451 451 (gpio & AC_GPIO_WAKE) ? 1 : 0); 452 452 max = gpio & AC_GPIO_IO_COUNT; 453 if (!max || max > 8) 454 return; 453 455 enable = snd_hda_codec_read(codec, nid, 0, 454 456 AC_VERB_GET_GPIO_MASK, 0); -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/hda/patch_analog.c
r399 r402 3859 3859 static struct snd_pci_quirk ad1884a_cfg_tbl[] = { 3860 3860 SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE), 3861 SND_PCI_QUIRK(0x103c, 0x3056, "HP", AD1884A_MOBILE), 3862 SND_PCI_QUIRK(0x103c, 0x30e7, "HP EliteBook 8530p", AD1884A_LAPTOP), 3863 SND_PCI_QUIRK(0x103c, 0x3614, "HP 6730s", AD1884A_LAPTOP), 3861 3864 SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X300", AD1884A_THINKPAD), 3862 3865 {0} -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/hda/patch_realtek.c
r399 r402 115 115 ALC268_TOSHIBA, 116 116 ALC268_ACER, 117 ALC268_ACER_DMIC, 117 118 ALC268_ACER_ASPIRE_ONE, 118 119 ALC268_DELL, … … 131 132 ALC269_ASUS_EEEPC_P703, 132 133 ALC269_ASUS_EEEPC_P901, 134 ALC269_FUJITSU, 135 ALC269_LIFEBOOK, 133 136 ALC269_AUTO, 134 137 ALC269_MODEL_LAST /* last tag */ … … 153 156 ALC660VD_3ST, 154 157 ALC660VD_3ST_DIG, 158 ALC660VD_ASUS_V1S, 155 159 ALC861VD_3ST, 156 160 ALC861VD_3ST_DIG, … … 240 244 struct snd_kcontrol_new *mixers[5]; /* mixer arrays */ 241 245 unsigned int num_mixers; 246 struct snd_kcontrol_new *cap_mixer; /* capture mixer */ 242 247 243 248 const struct hda_verb *init_verbs[5]; /* initialization verbs … … 269 274 hda_nid_t *capsrc_nids; 270 275 hda_nid_t dig_in_nid; /* digital-in NID; optional */ 276 unsigned char is_mix_capture; /* matrix-style capture (non-mux) */ 271 277 272 278 /* capture source */ … … 307 313 hda_nid_t pll_nid; 308 314 unsigned int pll_coef_idx, pll_coef_bit; 315 316 #ifdef SND_HDA_NEEDS_RESUME 317 #define ALC_MAX_PINS 16 318 unsigned int num_pins; 319 hda_nid_t pin_nids[ALC_MAX_PINS]; 320 unsigned int pin_cfgs[ALC_MAX_PINS]; 321 #endif 309 322 }; 310 323 … … 316 329 * with spec 317 330 */ 331 struct snd_kcontrol_new *cap_mixer; /* capture mixer */ 318 332 const struct hda_verb *init_verbs[5]; 319 333 unsigned int num_dacs; … … 368 382 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 369 383 struct alc_spec *spec = codec->spec; 384 const struct hda_input_mux *imux = spec->input_mux; 370 385 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 371 unsigned int mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx;372 386 hda_nid_t nid = spec->capsrc_nids ? 373 387 spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx]; 374 return snd_hda_input_mux_put(codec, &spec->input_mux[mux_idx], ucontrol, 375 nid, &spec->cur_mux[adc_idx]); 376 } 377 388 389 if (spec->is_mix_capture) { 390 /* Matrix-mixer style (e.g. ALC882) */ 391 unsigned int *cur_val = &spec->cur_mux[adc_idx]; 392 unsigned int i, idx; 393 394 idx = ucontrol->value.enumerated.item[0]; 395 if (idx >= imux->num_items) 396 idx = imux->num_items - 1; 397 if (*cur_val == idx) 398 return 0; 399 for (i = 0; i < imux->num_items; i++) { 400 unsigned int v = (i == idx) ? 0 : HDA_AMP_MUTE; 401 snd_hda_codec_amp_stereo(codec, nid, HDA_INPUT, 402 imux->items[i].index, 403 HDA_AMP_MUTE, v); 404 } 405 *cur_val = idx; 406 return 1; 407 } else { 408 /* MUX style (e.g. ALC880) */ 409 unsigned int mux_idx; 410 mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx; 411 return snd_hda_input_mux_put(codec, &spec->input_mux[mux_idx], 412 ucontrol, nid, 413 &spec->cur_mux[adc_idx]); 414 } 415 } 378 416 379 417 /* … … 710 748 711 749 /* 750 */ 751 static void add_mixer(struct alc_spec *spec, struct snd_kcontrol_new *mix) 752 { 753 if (snd_BUG_ON(spec->num_mixers >= ARRAY_SIZE(spec->mixers))) 754 return; 755 spec->mixers[spec->num_mixers++] = mix; 756 } 757 758 static void add_verb(struct alc_spec *spec, const struct hda_verb *verb) 759 { 760 if (snd_BUG_ON(spec->num_init_verbs >= ARRAY_SIZE(spec->init_verbs))) 761 return; 762 spec->init_verbs[spec->num_init_verbs++] = verb; 763 } 764 765 /* 712 766 * set up from the preset table 713 767 */ … … 718 772 719 773 for (i = 0; i < ARRAY_SIZE(preset->mixers) && preset->mixers[i]; i++) 720 spec->mixers[spec->num_mixers++] = preset->mixers[i]; 774 add_mixer(spec, preset->mixers[i]); 775 spec->cap_mixer = preset->cap_mixer; 721 776 for (i = 0; i < ARRAY_SIZE(preset->init_verbs) && preset->init_verbs[i]; 722 777 i++) 723 spec->init_verbs[spec->num_init_verbs++] = 724 preset->init_verbs[i]; 778 add_verb(spec, preset->init_verbs[i]); 725 779 726 780 spec->channel_mode = preset->channel_mode; … … 822 876 } 823 877 878 #if 0 /* it's broken in some acses -- temporarily disabled */ 824 879 static void alc_mic_automute(struct hda_codec *codec) 825 880 { … … 842 897 HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); 843 898 } 899 #else 900 #define alc_mic_automute(codec) /* NOP */ 901 #endif /* disabled */ 844 902 845 903 /* unsolicited event for HP jack sensing */ … … 1051 1109 AC_USRSP_EN | ALC880_HP_EVENT); 1052 1110 1111 #if 0 /* it's broken in some acses -- temporarily disabled */ 1053 1112 if (spec->autocfg.input_pins[AUTO_PIN_MIC] && 1054 1113 spec->autocfg.input_pins[AUTO_PIN_FRONT_MIC]) … … 1057 1116 AC_VERB_SET_UNSOLICITED_ENABLE, 1058 1117 AC_USRSP_EN | ALC880_MIC_EVENT); 1118 #endif /* disabled */ 1059 1119 1060 1120 spec->unsol_event = alc_sku_unsol_event; … … 1191 1251 }; 1192 1252 1253 static int alc_cap_vol_info(struct snd_kcontrol *kcontrol, 1254 struct snd_ctl_elem_info *uinfo) 1255 { 1256 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 1257 struct alc_spec *spec = codec->spec; 1258 int err; 1259 1260 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1261 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0, 1262 HDA_INPUT); 1263 err = snd_hda_mixer_amp_volume_info(kcontrol, uinfo); 1264 mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1265 return err; 1266 } 1267 1268 static int alc_cap_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag, 1269 unsigned int size, unsigned int __user *tlv) 1270 { 1271 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 1272 struct alc_spec *spec = codec->spec; 1273 int err; 1274 1275 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1276 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0, 1277 HDA_INPUT); 1278 err = snd_hda_mixer_amp_tlv(kcontrol, op_flag, size, tlv); 1279 mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1280 return err; 1281 } 1282 1283 typedef int (*getput_call_t)(struct snd_kcontrol *kcontrol, 1284 struct snd_ctl_elem_value *ucontrol); 1285 1286 static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol, 1287 struct snd_ctl_elem_value *ucontrol, 1288 getput_call_t func) 1289 { 1290 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 1291 struct alc_spec *spec = codec->spec; 1292 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 1293 int err; 1294 1295 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1296 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx], 1297 3, 0, HDA_INPUT); 1298 err = func(kcontrol, ucontrol); 1299 mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1300 return err; 1301 } 1302 1303 static int alc_cap_vol_get(struct snd_kcontrol *kcontrol, 1304 struct snd_ctl_elem_value *ucontrol) 1305 { 1306 return alc_cap_getput_caller(kcontrol, ucontrol, 1307 snd_hda_mixer_amp_volume_get); 1308 } 1309 1310 static int alc_cap_vol_put(struct snd_kcontrol *kcontrol, 1311 struct snd_ctl_elem_value *ucontrol) 1312 { 1313 return alc_cap_getput_caller(kcontrol, ucontrol, 1314 snd_hda_mixer_amp_volume_put); 1315 } 1316 1193 1317 /* capture mixer elements */ 1194 static struct snd_kcontrol_new alc880_capture_mixer[] = { 1195 HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT), 1196 HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT), 1197 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x08, 0x0, HDA_INPUT), 1198 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x08, 0x0, HDA_INPUT), 1199 HDA_CODEC_VOLUME_IDX("Capture Volume", 2, 0x09, 0x0, HDA_INPUT), 1200 HDA_CODEC_MUTE_IDX("Capture Switch", 2, 0x09, 0x0, HDA_INPUT), 1201 { 1202 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1203 /* The multiple "Capture Source" controls confuse alsamixer 1204 * So call somewhat different.. 1205 */ 1206 /* .name = "Capture Source", */ 1207 .name = "Input Source", 1208 .count = 3, 1209 .info = alc_mux_enum_info, 1210 .get = alc_mux_enum_get, 1211 .put = alc_mux_enum_put, 1212 }, 1213 {0} /* end */ 1214 }; 1215 1216 /* capture mixer elements (in case NID 0x07 not available) */ 1217 static struct snd_kcontrol_new alc880_capture_alt_mixer[] = { 1218 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 1219 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 1220 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT), 1221 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT), 1222 { 1223 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1224 /* The multiple "Capture Source" controls confuse alsamixer 1225 * So call somewhat different.. 1226 */ 1227 /* .name = "Capture Source", */ 1228 .name = "Input Source", 1229 .count = 2, 1230 .info = alc_mux_enum_info, 1231 .get = alc_mux_enum_get, 1232 .put = alc_mux_enum_put, 1233 }, 1234 {0} /* end */ 1235 }; 1318 #define alc_cap_sw_info snd_ctl_boolean_stereo_info 1319 1320 static int alc_cap_sw_get(struct snd_kcontrol *kcontrol, 1321 struct snd_ctl_elem_value *ucontrol) 1322 { 1323 return alc_cap_getput_caller(kcontrol, ucontrol, 1324 snd_hda_mixer_amp_switch_get); 1325 } 1326 1327 static int alc_cap_sw_put(struct snd_kcontrol *kcontrol, 1328 struct snd_ctl_elem_value *ucontrol) 1329 { 1330 return alc_cap_getput_caller(kcontrol, ucontrol, 1331 snd_hda_mixer_amp_switch_put); 1332 } 1333 1334 #define DEFINE_CAPMIX(num) \ 1335 static struct snd_kcontrol_new alc_capture_mixer ## num[] = { \ 1336 { \ 1337 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ 1338 .name = "Capture Switch", \ 1339 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \ 1340 .count = num, \ 1341 .info = alc_cap_sw_info, \ 1342 .get = alc_cap_sw_get, \ 1343 .put = alc_cap_sw_put, \ 1344 }, \ 1345 { \ 1346 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ 1347 .name = "Capture Volume", \ 1348 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | \ 1349 SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 1350 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK), \ 1351 .count = num, \ 1352 .info = alc_cap_vol_info, \ 1353 .get = alc_cap_vol_get, \ 1354 .put = alc_cap_vol_put, \ 1355 .tlv = { .c = alc_cap_vol_tlv }, \ 1356 }, \ 1357 { \ 1358 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ 1359 /* .name = "Capture Source", */ \ 1360 .name = "Input Source", \ 1361 .count = num, \ 1362 .info = alc_mux_enum_info, \ 1363 .get = alc_mux_enum_get, \ 1364 .put = alc_mux_enum_put, \ 1365 }, \ 1366 {0} /* end */ \ 1367 } 1368 1369 /* up to three ADCs */ 1370 DEFINE_CAPMIX(1); 1371 DEFINE_CAPMIX(2); 1372 DEFINE_CAPMIX(3); 1236 1373 1237 1374 … … 1520 1657 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 1521 1658 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 1522 {1523 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,1524 /* The multiple "Capture Source" controls confuse alsamixer1525 * So call somewhat different..1526 */1527 /* .name = "Capture Source", */1528 .name = "Input Source",1529 .count = 1,1530 .info = alc_mux_enum_info,1531 .get = alc_mux_enum_get,1532 .put = alc_mux_enum_put,1533 },1534 1659 {0} /* end */ 1535 1660 }; … … 1606 1731 "Mono Playback Volume", 1607 1732 "Line-Out Playback Volume", 1733 "PCM Playback Volume", 1608 1734 NULL, 1609 1735 }; … … 1639 1765 return err; 1640 1766 } 1641 1767 if (spec->cap_mixer) { 1768 err = snd_hda_add_new_ctls(codec, spec->cap_mixer); 1769 if (err < 0) 1770 return err; 1771 } 1642 1772 if (spec->multiout.dig_out_nid) { 1643 1773 err = snd_hda_create_spdif_out_ctls(codec, … … 2790 2920 } 2791 2921 2922 #ifdef SND_HDA_NEEDS_RESUME 2923 static void store_pin_configs(struct hda_codec *codec) 2924 { 2925 struct alc_spec *spec = codec->spec; 2926 hda_nid_t nid, end_nid; 2927 2928 end_nid = codec->start_nid + codec->num_nodes; 2929 for (nid = codec->start_nid; nid < end_nid; nid++) { 2930 unsigned int wid_caps = get_wcaps(codec, nid); 2931 unsigned int wid_type = 2932 (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; 2933 if (wid_type != AC_WID_PIN) 2934 continue; 2935 if (spec->num_pins >= ARRAY_SIZE(spec->pin_nids)) 2936 break; 2937 spec->pin_nids[spec->num_pins] = nid; 2938 spec->pin_cfgs[spec->num_pins] = 2939 snd_hda_codec_read(codec, nid, 0, 2940 AC_VERB_GET_CONFIG_DEFAULT, 0); 2941 spec->num_pins++; 2942 } 2943 } 2944 2945 static void resume_pin_configs(struct hda_codec *codec) 2946 { 2947 struct alc_spec *spec = codec->spec; 2948 int i; 2949 2950 for (i = 0; i < spec->num_pins; i++) { 2951 hda_nid_t pin_nid = spec->pin_nids[i]; 2952 unsigned int pin_config = spec->pin_cfgs[i]; 2953 snd_hda_codec_write(codec, pin_nid, 0, 2954 AC_VERB_SET_CONFIG_DEFAULT_BYTES_0, 2955 pin_config & 0x000000ff); 2956 snd_hda_codec_write(codec, pin_nid, 0, 2957 AC_VERB_SET_CONFIG_DEFAULT_BYTES_1, 2958 (pin_config & 0x0000ff00) >> 8); 2959 snd_hda_codec_write(codec, pin_nid, 0, 2960 AC_VERB_SET_CONFIG_DEFAULT_BYTES_2, 2961 (pin_config & 0x00ff0000) >> 16); 2962 snd_hda_codec_write(codec, pin_nid, 0, 2963 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 2964 pin_config >> 24); 2965 } 2966 } 2967 2968 static int alc_resume(struct hda_codec *codec) 2969 { 2970 resume_pin_configs(codec); 2971 codec->patch_ops.init(codec); 2972 snd_hda_codec_resume_amp(codec); 2973 snd_hda_codec_resume_cache(codec); 2974 return 0; 2975 } 2976 #else 2977 #define store_pin_configs(codec) 2978 #endif 2979 2792 2980 /* 2793 2981 */ … … 2798 2986 .free = alc_free, 2799 2987 .unsol_event = alc_unsol_event, 2988 #ifdef SND_HDA_NEEDS_RESUME 2989 .resume = alc_resume, 2990 #endif 2800 2991 #ifdef CONFIG_SND_HDA_POWER_SAVE 2801 2992 .check_power_status = alc_check_power_status, … … 3206 3397 .num_dacs = ARRAY_SIZE(alc880_dac_nids), 3207 3398 .dac_nids = alc880_dac_nids, 3399 .adc_nids = alc880_adc_nids_alt, /* FIXME: correct? */ 3400 .num_adc_nids = 1, /* single ADC */ 3208 3401 .hp_nid = 0x03, 3209 3402 .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes), … … 3820 4013 3821 4014 if (spec->kctls.list) 3822 spec->mixers[spec->num_mixers++] = spec->kctls.list;3823 3824 spec->init_verbs[spec->num_init_verbs++] = alc880_volume_init_verbs;4015 add_mixer(spec, spec->kctls.list); 4016 4017 add_verb(spec, alc880_volume_init_verbs); 3825 4018 3826 4019 spec->num_mux_defs = 1; 3827 4020 spec->input_mux = &spec->private_imux; 3828 4021 4022 store_pin_configs(codec); 3829 4023 return 1; 3830 4024 } … … 3844 4038 * OK, here we have finally the patch for ALC880 3845 4039 */ 4040 4041 static void set_capture_mixer(struct alc_spec *spec) 4042 { 4043 static struct snd_kcontrol_new *caps[3] = { 4044 alc_capture_mixer1, 4045 alc_capture_mixer2, 4046 alc_capture_mixer3, 4047 }; 4048 if (spec->num_adc_nids > 0 && spec->num_adc_nids < 3) 4049 spec->cap_mixer = caps[spec->num_adc_nids - 1]; 4050 } 3846 4051 3847 4052 static int patch_alc880(struct hda_codec *codec) … … 3900 4105 spec->adc_nids = alc880_adc_nids_alt; 3901 4106 spec->num_adc_nids = ARRAY_SIZE(alc880_adc_nids_alt); 3902 spec->mixers[spec->num_mixers] =3903 alc880_capture_alt_mixer;3904 spec->num_mixers++;3905 4107 } else { 3906 4108 spec->adc_nids = alc880_adc_nids; 3907 4109 spec->num_adc_nids = ARRAY_SIZE(alc880_adc_nids); 3908 spec->mixers[spec->num_mixers] = alc880_capture_mixer;3909 spec->num_mixers++;3910 4110 } 3911 4111 } 4112 set_capture_mixer(spec); 3912 4113 3913 4114 spec->vmaster_nid = 0x0c; … … 3942 4143 /* ADC1 */ 3943 4144 0x05, 3944 };3945 3946 static hda_nid_t alc260_hp_adc_nids[2] = {3947 /* ADC1, 0 */3948 0x05, 0x043949 4145 }; 3950 4146 … … 4077 4273 unsigned int val = spec->master_sw ? PIN_HP : 0; 4078 4274 /* change HP and line-out pins */ 4079 snd_hda_codec_write(codec, 0x0f, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,4275 snd_hda_codec_write(codec, hp, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 4080 4276 val); 4081 snd_hda_codec_write(codec, 0x10, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,4277 snd_hda_codec_write(codec, line, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 4082 4278 val); 4083 4279 /* mono (speaker) depending on the HP jack sense */ 4084 4280 val = (val && !spec->jack_present) ? PIN_OUT : 0; 4085 snd_hda_codec_write(codec, 0x11, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,4281 snd_hda_codec_write(codec, mono, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 4086 4282 val); 4087 4283 } … … 4162 4358 .get = alc260_hp_master_sw_get, 4163 4359 .put = alc260_hp_master_sw_put, 4164 .private_value = (0x1 0 << 16) | (0x15<< 8) | 0x114360 .private_value = (0x15 << 16) | (0x10 << 8) | 0x11 4165 4361 }, 4166 4362 HDA_CODEC_VOLUME("Front Playback Volume", 0x09, 0x0, HDA_OUTPUT), … … 4215 4411 AC_VERB_GET_PIN_SENSE, 0); 4216 4412 spec->jack_present = (present & AC_PINSENSE_PRESENCE) != 0; 4217 alc260_hp_master_update(codec, 0x1 0, 0x15, 0x11);4413 alc260_hp_master_update(codec, 0x15, 0x10, 0x11); 4218 4414 } 4219 4415 … … 4344 4540 HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT), 4345 4541 ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT), 4346 {0} /* end */4347 };4348 4349 /* capture mixer elements */4350 static struct snd_kcontrol_new alc260_capture_mixer[] = {4351 HDA_CODEC_VOLUME("Capture Volume", 0x04, 0x0, HDA_INPUT),4352 HDA_CODEC_MUTE("Capture Switch", 0x04, 0x0, HDA_INPUT),4353 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x05, 0x0, HDA_INPUT),4354 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x05, 0x0, HDA_INPUT),4355 {4356 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,4357 /* The multiple "Capture Source" controls confuse alsamixer4358 * So call somewhat different..4359 */4360 /* .name = "Capture Source", */4361 .name = "Input Source",4362 .count = 2,4363 .info = alc_mux_enum_info,4364 .get = alc_mux_enum_get,4365 .put = alc_mux_enum_put,4366 },4367 {0} /* end */4368 };4369 4370 static struct snd_kcontrol_new alc260_capture_alt_mixer[] = {4371 HDA_CODEC_VOLUME("Capture Volume", 0x05, 0x0, HDA_INPUT),4372 HDA_CODEC_MUTE("Capture Switch", 0x05, 0x0, HDA_INPUT),4373 {4374 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,4375 /* The multiple "Capture Source" controls confuse alsamixer4376 * So call somewhat different..4377 */4378 /* .name = "Capture Source", */4379 .name = "Input Source",4380 .count = 1,4381 .info = alc_mux_enum_info,4382 .get = alc_mux_enum_get,4383 .put = alc_mux_enum_put,4384 },4385 4542 {0} /* end */ 4386 4543 }; … … 5202 5359 { 5203 5360 struct alc_spec *spec = codec->spec; 5204 unsigned int wcap;5205 5361 int err; 5206 5362 static hda_nid_t alc260_ignore[] = { 0x17, 0 }; … … 5224 5380 spec->multiout.dig_out_nid = ALC260_DIGOUT_NID; 5225 5381 if (spec->kctls.list) 5226 spec->mixers[spec->num_mixers++] = spec->kctls.list;5227 5228 spec->init_verbs[spec->num_init_verbs++] = alc260_volume_init_verbs;5382 add_mixer(spec, spec->kctls.list); 5383 5384 add_verb(spec, alc260_volume_init_verbs); 5229 5385 5230 5386 spec->num_mux_defs = 1; 5231 5387 spec->input_mux = &spec->private_imux; 5232 5388 5233 /* check whether NID 0x04 is valid */ 5234 wcap = get_wcaps(codec, 0x04); 5235 wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; /* get type */ 5236 if (wcap != AC_WID_AUD_IN || spec->input_mux->num_items == 1) { 5237 spec->adc_nids = alc260_adc_nids_alt; 5238 spec->num_adc_nids = ARRAY_SIZE(alc260_adc_nids_alt); 5239 spec->mixers[spec->num_mixers] = alc260_capture_alt_mixer; 5240 } else { 5241 spec->adc_nids = alc260_adc_nids; 5242 spec->num_adc_nids = ARRAY_SIZE(alc260_adc_nids); 5243 spec->mixers[spec->num_mixers] = alc260_capture_mixer; 5244 } 5245 spec->num_mixers++; 5246 5389 store_pin_configs(codec); 5247 5390 return 1; 5248 5391 } … … 5313 5456 .mixers = { alc260_base_output_mixer, 5314 5457 alc260_input_mixer, 5315 alc260_pc_beep_mixer, 5316 alc260_capture_mixer }, 5458 alc260_pc_beep_mixer }, 5317 5459 .init_verbs = { alc260_init_verbs }, 5318 5460 .num_dacs = ARRAY_SIZE(alc260_dac_nids), 5319 5461 .dac_nids = alc260_dac_nids, 5320 .num_adc_nids = ARRAY_SIZE(alc260_ adc_nids),5462 .num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids), 5321 5463 .adc_nids = alc260_adc_nids, 5322 5464 .num_channel_mode = ARRAY_SIZE(alc260_modes), … … 5326 5468 [ALC260_HP] = { 5327 5469 .mixers = { alc260_hp_output_mixer, 5328 alc260_input_mixer, 5329 alc260_capture_alt_mixer }, 5470 alc260_input_mixer }, 5330 5471 .init_verbs = { alc260_init_verbs, 5331 5472 alc260_hp_unsol_verbs }, 5332 5473 .num_dacs = ARRAY_SIZE(alc260_dac_nids), 5333 5474 .dac_nids = alc260_dac_nids, 5334 .num_adc_nids = ARRAY_SIZE(alc260_ hp_adc_nids),5335 .adc_nids = alc260_ hp_adc_nids,5475 .num_adc_nids = ARRAY_SIZE(alc260_adc_nids_alt), 5476 .adc_nids = alc260_adc_nids_alt, 5336 5477 .num_channel_mode = ARRAY_SIZE(alc260_modes), 5337 5478 .channel_mode = alc260_modes, … … 5342 5483 [ALC260_HP_DC7600] = { 5343 5484 .mixers = { alc260_hp_dc7600_mixer, 5344 alc260_input_mixer, 5345 alc260_capture_alt_mixer }, 5485 alc260_input_mixer }, 5346 5486 .init_verbs = { alc260_init_verbs, 5347 5487 alc260_hp_dc7600_verbs }, 5348 5488 .num_dacs = ARRAY_SIZE(alc260_dac_nids), 5349 5489 .dac_nids = alc260_dac_nids, 5350 .num_adc_nids = ARRAY_SIZE(alc260_ hp_adc_nids),5351 .adc_nids = alc260_ hp_adc_nids,5490 .num_adc_nids = ARRAY_SIZE(alc260_adc_nids_alt), 5491 .adc_nids = alc260_adc_nids_alt, 5352 5492 .num_channel_mode = ARRAY_SIZE(alc260_modes), 5353 5493 .channel_mode = alc260_modes, … … 5358 5498 [ALC260_HP_3013] = { 5359 5499 .mixers = { alc260_hp_3013_mixer, 5360 alc260_input_mixer, 5361 alc260_capture_alt_mixer }, 5500 alc260_input_mixer }, 5362 5501 .init_verbs = { alc260_hp_3013_init_verbs, 5363 5502 alc260_hp_3013_unsol_verbs }, 5364 5503 .num_dacs = ARRAY_SIZE(alc260_dac_nids), 5365 5504 .dac_nids = alc260_dac_nids, 5366 .num_adc_nids = ARRAY_SIZE(alc260_ hp_adc_nids),5367 .adc_nids = alc260_ hp_adc_nids,5505 .num_adc_nids = ARRAY_SIZE(alc260_adc_nids_alt), 5506 .adc_nids = alc260_adc_nids_alt, 5368 5507 .num_channel_mode = ARRAY_SIZE(alc260_modes), 5369 5508 .channel_mode = alc260_modes, … … 5373 5512 }, 5374 5513 [ALC260_FUJITSU_S702X] = { 5375 .mixers = { alc260_fujitsu_mixer, 5376 alc260_capture_mixer }, 5514 .mixers = { alc260_fujitsu_mixer }, 5377 5515 .init_verbs = { alc260_fujitsu_init_verbs }, 5378 5516 .num_dacs = ARRAY_SIZE(alc260_dac_nids), … … 5386 5524 }, 5387 5525 [ALC260_ACER] = { 5388 .mixers = { alc260_acer_mixer, 5389 alc260_capture_mixer }, 5526 .mixers = { alc260_acer_mixer }, 5390 5527 .init_verbs = { alc260_acer_init_verbs }, 5391 5528 .num_dacs = ARRAY_SIZE(alc260_dac_nids), … … 5399 5536 }, 5400 5537 [ALC260_WILL] = { 5401 .mixers = { alc260_will_mixer, 5402 alc260_capture_mixer }, 5538 .mixers = { alc260_will_mixer }, 5403 5539 .init_verbs = { alc260_init_verbs, alc260_will_verbs }, 5404 5540 .num_dacs = ARRAY_SIZE(alc260_dac_nids), … … 5412 5548 }, 5413 5549 [ALC260_REPLACER_672V] = { 5414 .mixers = { alc260_replacer_672v_mixer, 5415 alc260_capture_mixer }, 5550 .mixers = { alc260_replacer_672v_mixer }, 5416 5551 .init_verbs = { alc260_init_verbs, alc260_replacer_672v_verbs }, 5417 5552 .num_dacs = ARRAY_SIZE(alc260_dac_nids), … … 5428 5563 #ifdef CONFIG_SND_DEBUG 5429 5564 [ALC260_TEST] = { 5430 .mixers = { alc260_test_mixer, 5431 alc260_capture_mixer }, 5565 .mixers = { alc260_test_mixer }, 5432 5566 .init_verbs = { alc260_test_init_verbs }, 5433 5567 .num_dacs = ARRAY_SIZE(alc260_test_dac_nids), … … 5488 5622 spec->stream_digital_capture = &alc260_pcm_digital_capture; 5489 5623 5624 if (!spec->adc_nids && spec->input_mux) { 5625 /* check whether NID 0x04 is valid */ 5626 unsigned int wcap = get_wcaps(codec, 0x04); 5627 wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; 5628 /* get type */ 5629 if (wcap != AC_WID_AUD_IN || spec->input_mux->num_items == 1) { 5630 spec->adc_nids = alc260_adc_nids_alt; 5631 spec->num_adc_nids = ARRAY_SIZE(alc260_adc_nids_alt); 5632 } else { 5633 spec->adc_nids = alc260_adc_nids; 5634 spec->num_adc_nids = ARRAY_SIZE(alc260_adc_nids); 5635 } 5636 } 5637 set_capture_mixer(spec); 5638 5490 5639 spec->vmaster_nid = 0x08; 5491 5640 … … 5544 5693 }, 5545 5694 }; 5546 #define alc882_mux_enum_info alc_mux_enum_info5547 #define alc882_mux_enum_get alc_mux_enum_get5548 5549 static int alc882_mux_enum_put(struct snd_kcontrol *kcontrol,5550 struct snd_ctl_elem_value *ucontrol)5551 {5552 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);5553 struct alc_spec *spec = codec->spec;5554 const struct hda_input_mux *imux = spec->input_mux;5555 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);5556 hda_nid_t nid = spec->capsrc_nids ?5557 spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx];5558 unsigned int *cur_val = &spec->cur_mux[adc_idx];5559 unsigned int i, idx;5560 5561 idx = ucontrol->value.enumerated.item[0];5562 if (idx >= imux->num_items)5563 idx = imux->num_items - 1;5564 if (*cur_val == idx)5565 return 0;5566 for (i = 0; i < imux->num_items; i++) {5567 unsigned int v = (i == idx) ? 0 : HDA_AMP_MUTE;5568 snd_hda_codec_amp_stereo(codec, nid, HDA_INPUT,5569 imux->items[i].index,5570 HDA_AMP_MUTE, v);5571 }5572 *cur_val = idx;5573 return 1;5574 }5575 5576 5695 /* 5577 5696 * 2ch mode … … 6256 6375 }; 6257 6376 6258 /* capture mixer elements */6259 static struct snd_kcontrol_new alc882_capture_alt_mixer[] = {6260 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),6261 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),6262 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),6263 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),6264 {6265 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,6266 /* The multiple "Capture Source" controls confuse alsamixer6267 * So call somewhat different..6268 */6269 /* .name = "Capture Source", */6270 .name = "Input Source",6271 .count = 2,6272 .info = alc882_mux_enum_info,6273 .get = alc882_mux_enum_get,6274 .put = alc882_mux_enum_put,6275 },6276 {0} /* end */6277 };6278 6279 static struct snd_kcontrol_new alc882_capture_mixer[] = {6280 HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT),6281 HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT),6282 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x08, 0x0, HDA_INPUT),6283 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x08, 0x0, HDA_INPUT),6284 HDA_CODEC_VOLUME_IDX("Capture Volume", 2, 0x09, 0x0, HDA_INPUT),6285 HDA_CODEC_MUTE_IDX("Capture Switch", 2, 0x09, 0x0, HDA_INPUT),6286 {6287 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,6288 /* The multiple "Capture Source" controls confuse alsamixer6289 * So call somewhat different..6290 */6291 /* .name = "Capture Source", */6292 .name = "Input Source",6293 .count = 3,6294 .info = alc882_mux_enum_info,6295 .get = alc882_mux_enum_get,6296 .put = alc882_mux_enum_put,6297 },6298 {0} /* end */6299 };6300 6301 6377 #ifdef CONFIG_SND_HDA_POWER_SAVE 6302 6378 #define alc882_loopbacks alc880_loopbacks … … 6427 6503 }, 6428 6504 [ALC882_TARGA] = { 6429 .mixers = { alc882_targa_mixer, alc882_chmode_mixer, 6430 alc882_capture_mixer }, 6505 .mixers = { alc882_targa_mixer, alc882_chmode_mixer }, 6431 6506 .init_verbs = { alc882_init_verbs, alc882_targa_verbs}, 6432 6507 .num_dacs = ARRAY_SIZE(alc882_dac_nids), … … 6444 6519 }, 6445 6520 [ALC882_ASUS_A7J] = { 6446 .mixers = { alc882_asus_a7j_mixer, alc882_chmode_mixer, 6447 alc882_capture_mixer }, 6521 .mixers = { alc882_asus_a7j_mixer, alc882_chmode_mixer }, 6448 6522 .init_verbs = { alc882_init_verbs, alc882_asus_a7j_verbs}, 6449 6523 .num_dacs = ARRAY_SIZE(alc882_dac_nids), … … 6750 6824 spec->stream_digital_capture = &alc882_pcm_digital_capture; 6751 6825 6826 spec->is_mix_capture = 1; /* matrix-style capture */ 6752 6827 if (!spec->adc_nids && spec->input_mux) { 6753 6828 /* check whether NID 0x07 is valid */ … … 6759 6834 spec->num_adc_nids = ARRAY_SIZE(alc882_adc_nids_alt); 6760 6835 spec->capsrc_nids = alc882_capsrc_nids_alt; 6761 spec->mixers[spec->num_mixers] =6762 alc882_capture_alt_mixer;6763 spec->num_mixers++;6764 6836 } else { 6765 6837 spec->adc_nids = alc882_adc_nids; 6766 6838 spec->num_adc_nids = ARRAY_SIZE(alc882_adc_nids); 6767 6839 spec->capsrc_nids = alc882_capsrc_nids; 6768 spec->mixers[spec->num_mixers] = alc882_capture_mixer;6769 spec->num_mixers++;6770 6840 } 6771 6841 } 6842 set_capture_mixer(spec); 6772 6843 6773 6844 spec->vmaster_nid = 0x0c; … … 6808 6879 }; 6809 6880 6881 static hda_nid_t alc883_adc_nids_alt[1] = { 6882 /* ADC1 */ 6883 0x08, 6884 }; 6885 6810 6886 static hda_nid_t alc883_capsrc_nids[2] = { 0x23, 0x22 }; 6811 6887 … … 6875 6951 }, 6876 6952 }; 6877 6878 #define alc883_mux_enum_info alc_mux_enum_info6879 #define alc883_mux_enum_get alc_mux_enum_get6880 /* ALC883 has the ALC882-type input selection */6881 #define alc883_mux_enum_put alc882_mux_enum_put6882 6953 6883 6954 /* … … 7034 7105 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), 7035 7106 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 7036 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7037 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7038 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),7039 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),7040 {7041 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7042 /* .name = "Capture Source", */7043 .name = "Input Source",7044 .count = 2,7045 .info = alc883_mux_enum_info,7046 .get = alc883_mux_enum_get,7047 .put = alc883_mux_enum_put,7048 },7049 7107 {0} /* end */ 7050 7108 }; … … 7064 7122 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT), 7065 7123 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7066 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7067 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7068 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),7069 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),7070 {7071 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7072 /* .name = "Capture Source", */7073 .name = "Input Source",7074 .count = 2,7075 .info = alc883_mux_enum_info,7076 .get = alc883_mux_enum_get,7077 .put = alc883_mux_enum_put,7078 },7079 7124 {0} /* end */ 7080 7125 }; … … 7091 7136 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT), 7092 7137 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7093 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7094 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7095 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),7096 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),7097 {7098 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7099 /* .name = "Capture Source", */7100 .name = "Input Source",7101 .count = 2,7102 .info = alc883_mux_enum_info,7103 .get = alc883_mux_enum_get,7104 .put = alc883_mux_enum_put,7105 },7106 7138 {0} /* end */ 7107 7139 }; … … 7118 7150 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT), 7119 7151 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7120 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7121 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7122 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),7123 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),7124 {7125 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7126 /* .name = "Capture Source", */7127 .name = "Input Source",7128 .count = 2,7129 .info = alc883_mux_enum_info,7130 .get = alc883_mux_enum_get,7131 .put = alc883_mux_enum_put,7132 },7133 7152 {0} /* end */ 7134 7153 }; … … 7150 7169 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), 7151 7170 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 7152 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7153 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7154 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),7155 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),7156 {7157 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7158 /* .name = "Capture Source", */7159 .name = "Input Source",7160 .count = 2,7161 .info = alc883_mux_enum_info,7162 .get = alc883_mux_enum_get,7163 .put = alc883_mux_enum_put,7164 },7165 7171 {0} /* end */ 7166 7172 }; … … 7188 7194 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), 7189 7195 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 7190 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7191 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7192 {7193 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7194 /* .name = "Capture Source", */7195 .name = "Input Source",7196 .count = 1,7197 .info = alc883_mux_enum_info,7198 .get = alc883_mux_enum_get,7199 .put = alc883_mux_enum_put,7200 },7201 7196 {0} /* end */ 7202 7197 }; … … 7225 7220 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), 7226 7221 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 7227 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7228 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7229 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),7230 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),7231 {7232 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7233 /* .name = "Capture Source", */7234 .name = "Input Source",7235 .count = 2,7236 .info = alc883_mux_enum_info,7237 .get = alc883_mux_enum_get,7238 .put = alc883_mux_enum_put,7239 },7240 7222 {0} /* end */ 7241 7223 }; … … 7263 7245 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), 7264 7246 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 7265 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7266 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7267 7268 {7269 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7270 /* .name = "Capture Source", */7271 .name = "Input Source",7272 .count = 1,7273 .info = alc883_mux_enum_info,7274 .get = alc883_mux_enum_get,7275 .put = alc883_mux_enum_put,7276 },7277 7247 {0} /* end */ 7278 7248 }; … … 7295 7265 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 7296 7266 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 7297 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7298 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7299 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),7300 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),7301 {7302 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7303 /* .name = "Capture Source", */7304 .name = "Input Source",7305 .count = 2,7306 .info = alc883_mux_enum_info,7307 .get = alc883_mux_enum_get,7308 .put = alc883_mux_enum_put,7309 },7310 7267 {0} /* end */ 7311 7268 }; … … 7323 7280 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT), 7324 7281 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7325 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7326 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7327 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),7328 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),7329 {7330 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7331 /* .name = "Capture Source", */7332 .name = "Input Source",7333 .count = 2,7334 .info = alc883_mux_enum_info,7335 .get = alc883_mux_enum_get,7336 .put = alc883_mux_enum_put,7337 },7338 7282 {0} /* end */ 7339 7283 }; … … 7348 7292 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 7349 7293 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7350 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7351 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7352 {7353 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7354 /* .name = "Capture Source", */7355 .name = "Input Source",7356 .count = 1,7357 .info = alc883_mux_enum_info,7358 .get = alc883_mux_enum_get,7359 .put = alc883_mux_enum_put,7360 },7361 7294 {0} /* end */ 7362 7295 }; … … 7372 7305 HDA_CODEC_VOLUME("iMic Playback Volume", 0x0b, 0x1, HDA_INPUT), 7373 7306 HDA_CODEC_MUTE("iMic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7374 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7375 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7376 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),7377 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),7378 {7379 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7380 /* .name = "Capture Source", */7381 .name = "Input Source",7382 .count = 2,7383 .info = alc883_mux_enum_info,7384 .get = alc883_mux_enum_get,7385 .put = alc883_mux_enum_put,7386 },7387 7307 {0} /* end */ 7388 7308 }; … … 7398 7318 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), 7399 7319 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), 7400 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7401 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7402 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),7403 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),7404 {7405 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7406 /* .name = "Capture Source", */7407 .name = "Input Source",7408 .count = 2,7409 .info = alc883_mux_enum_info,7410 .get = alc883_mux_enum_get,7411 .put = alc883_mux_enum_put,7412 },7413 7320 {0} /* end */ 7414 7321 }; … … 7423 7330 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 7424 7331 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 7425 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7426 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7427 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),7428 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),7429 {7430 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7431 /* .name = "Capture Source", */7432 .name = "Input Source",7433 .count = 2,7434 .info = alc883_mux_enum_info,7435 .get = alc883_mux_enum_get,7436 .put = alc883_mux_enum_put,7437 },7438 7332 {0} /* end */ 7439 7333 }; … … 7463 7357 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT), 7464 7358 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 7465 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),7466 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),7467 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),7468 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),7469 {7470 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,7471 /* .name = "Capture Source", */7472 .name = "Input Source",7473 .count = 2,7474 .info = alc883_mux_enum_info,7475 .get = alc883_mux_enum_get,7476 .put = alc883_mux_enum_put,7477 },7478 7359 {0} /* end */ 7479 7360 }; … … 7506 7387 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 7507 7388 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 7389 {0} /* end */ 7390 }; 7391 7392 static struct snd_kcontrol_new alc883_asus_eee1601_cap_mixer[] = { 7508 7393 HDA_BIND_VOL("Capture Volume", &alc883_bind_cap_vol), 7509 7394 HDA_BIND_SW("Capture Switch", &alc883_bind_cap_switch), … … 7513 7398 .name = "Input Source", 7514 7399 .count = 1, 7515 .info = alc 883_mux_enum_info,7516 .get = alc 883_mux_enum_get,7517 .put = alc 883_mux_enum_put,7400 .info = alc_mux_enum_info, 7401 .get = alc_mux_enum_get, 7402 .put = alc_mux_enum_put, 7518 7403 }, 7519 7404 {0} /* end */ … … 8170 8055 }; 8171 8056 8172 /* capture mixer elements */8173 static struct snd_kcontrol_new alc883_capture_mixer[] = {8174 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),8175 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),8176 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),8177 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),8178 {8179 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,8180 /* The multiple "Capture Source" controls confuse alsamixer8181 * So call somewhat different..8182 */8183 /* .name = "Capture Source", */8184 .name = "Input Source",8185 .count = 2,8186 .info = alc882_mux_enum_info,8187 .get = alc882_mux_enum_get,8188 .put = alc882_mux_enum_put,8189 },8190 {0} /* end */8191 };8192 8193 8057 static struct hda_verb alc888_asus_m90v_verbs[] = { 8194 8058 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, … … 8333 8197 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC883_3ST_6ch_DIG), 8334 8198 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE), 8199 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_ACER_ASPIRE), 8335 8200 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE), 8336 8201 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE), … … 8387 8252 SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY), 8388 8253 SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2), 8254 SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG), 8389 8255 SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG), 8390 8256 SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), … … 8470 8336 .num_dacs = ARRAY_SIZE(alc883_dac_nids), 8471 8337 .dac_nids = alc883_dac_nids, 8338 .adc_nids = alc883_adc_nids_alt, 8339 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt), 8472 8340 .dig_out_nid = ALC883_DIGOUT_NID, 8473 8341 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), … … 8510 8378 .num_dacs = ARRAY_SIZE(alc883_dac_nids), 8511 8379 .dac_nids = alc883_dac_nids, 8380 .adc_nids = alc883_adc_nids_alt, 8381 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt), 8512 8382 .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), 8513 8383 .channel_mode = alc883_sixstack_modes, … … 8552 8422 .num_dacs = ARRAY_SIZE(alc883_dac_nids), 8553 8423 .dac_nids = alc883_dac_nids, 8424 .adc_nids = alc883_adc_nids_alt, 8425 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt), 8554 8426 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), 8555 8427 .channel_mode = alc883_3ST_2ch_modes, … … 8648 8520 .dac_nids = alc883_dac_nids, 8649 8521 .dig_out_nid = ALC883_DIGOUT_NID, 8650 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids),8651 .adc_nids = alc883_adc_nids,8652 8522 .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), 8653 8523 .channel_mode = alc883_sixstack_modes, … … 8673 8543 [ALC888_ASUS_EEE1601] = { 8674 8544 .mixers = { alc883_asus_eee1601_mixer }, 8545 .cap_mixer = alc883_asus_eee1601_cap_mixer, 8675 8546 .init_verbs = { alc883_init_verbs, alc888_asus_eee1601_verbs }, 8676 8547 .num_dacs = ARRAY_SIZE(alc883_dac_nids), … … 8779 8650 /* hack - override the init verbs */ 8780 8651 spec->init_verbs[0] = alc883_auto_init_verbs; 8781 spec->mixers[spec->num_mixers] = alc883_capture_mixer;8782 spec->num_mixers++;8783 8652 8784 8653 return 1; /* config found */ … … 8863 8732 spec->stream_digital_capture = &alc883_pcm_digital_capture; 8864 8733 8865 spec->num_adc_nids = ARRAY_SIZE(alc883_adc_nids); 8866 spec->adc_nids = alc883_adc_nids; 8867 spec->capsrc_nids = alc883_capsrc_nids; 8734 if (!spec->num_adc_nids) { 8735 spec->num_adc_nids = ARRAY_SIZE(alc883_adc_nids); 8736 spec->adc_nids = alc883_adc_nids; 8737 } 8738 if (!spec->capsrc_nids) 8739 spec->capsrc_nids = alc883_capsrc_nids; 8740 spec->is_mix_capture = 1; /* matrix-style capture */ 8741 if (!spec->cap_mixer) 8742 set_capture_mixer(spec); 8868 8743 8869 8744 spec->vmaster_nid = 0x0c; … … 9356 9231 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 9357 9232 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 9358 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),9359 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),9360 {9361 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,9362 /* The multiple "Capture Source" controls confuse alsamixer9363 * So call somewhat different..9364 */9365 /* .name = "Capture Source", */9366 .name = "Input Source",9367 .count = 1,9368 .info = alc_mux_enum_info,9369 .get = alc_mux_enum_get,9370 .put = alc_mux_enum_put,9371 },9372 9233 {0} /* end */ 9373 9234 }; … … 9886 9747 int ret; 9887 9748 9888 ret = alc 882_mux_enum_put(kcontrol, ucontrol);9749 ret = alc_mux_enum_put(kcontrol, ucontrol); 9889 9750 if (!ret) 9890 9751 return 0; … … 9903 9764 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 9904 9765 .name = "Capture Source", 9905 .info = alc 882_mux_enum_info,9906 .get = alc 882_mux_enum_get,9766 .info = alc_mux_enum_info, 9767 .get = alc_mux_enum_get, 9907 9768 .put = alc262_ultra_mux_enum_put, 9908 9769 }, … … 10298 10159 10299 10160 if (spec->kctls.list) 10300 spec->mixers[spec->num_mixers++] = spec->kctls.list;10301 10302 spec->init_verbs[spec->num_init_verbs++] = alc262_volume_init_verbs;10161 add_mixer(spec, spec->kctls.list); 10162 10163 add_verb(spec, alc262_volume_init_verbs); 10303 10164 spec->num_mux_defs = 1; 10304 10165 spec->input_mux = &spec->private_imux; … … 10308 10169 return err; 10309 10170 10171 store_pin_configs(codec); 10310 10172 return 1; 10311 10173 } … … 10540 10402 }, 10541 10403 [ALC262_ULTRA] = { 10542 .mixers = { alc262_ultra_mixer, alc262_ultra_capture_mixer }, 10404 .mixers = { alc262_ultra_mixer }, 10405 .cap_mixer = alc262_ultra_capture_mixer, 10543 10406 .init_verbs = { alc262_ultra_verbs }, 10544 10407 .num_dacs = ARRAY_SIZE(alc262_dac_nids), … … 10666 10529 spec->stream_digital_capture = &alc262_pcm_digital_capture; 10667 10530 10531 spec->is_mix_capture = 1; 10668 10532 if (!spec->adc_nids && spec->input_mux) { 10669 10533 /* check whether NID 0x07 is valid */ … … 10676 10540 spec->num_adc_nids = ARRAY_SIZE(alc262_adc_nids_alt); 10677 10541 spec->capsrc_nids = alc262_capsrc_nids_alt; 10678 spec->mixers[spec->num_mixers] =10679 alc262_capture_alt_mixer;10680 spec->num_mixers++;10681 10542 } else { 10682 10543 spec->adc_nids = alc262_adc_nids; 10683 10544 spec->num_adc_nids = ARRAY_SIZE(alc262_adc_nids); 10684 10545 spec->capsrc_nids = alc262_capsrc_nids; 10685 spec->mixers[spec->num_mixers] = alc262_capture_mixer;10686 spec->num_mixers++;10687 10546 } 10688 10547 } 10548 if (!spec->cap_mixer) 10549 set_capture_mixer(spec); 10689 10550 10690 10551 spec->vmaster_nid = 0x0c; … … 10858 10719 }; 10859 10720 10721 static struct snd_kcontrol_new alc268_acer_dmic_mixer[] = { 10722 /* output mixer control */ 10723 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol), 10724 { 10725 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 10726 .name = "Master Playback Switch", 10727 .info = snd_hda_mixer_amp_switch_info, 10728 .get = snd_hda_mixer_amp_switch_get, 10729 .put = alc268_acer_master_sw_put, 10730 .private_value = HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT), 10731 }, 10732 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 10733 HDA_CODEC_VOLUME("Line In Boost", 0x1a, 0, HDA_INPUT), 10734 {0} 10735 }; 10736 10860 10737 static struct hda_verb alc268_acer_aspire_one_verbs[] = { 10861 10738 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, … … 11134 11011 }; 11135 11012 11136 #define alc268_mux_enum_info alc_mux_enum_info11137 #define alc268_mux_enum_get alc_mux_enum_get11138 #define alc268_mux_enum_put alc_mux_enum_put11139 11140 11013 static struct snd_kcontrol_new alc268_capture_alt_mixer[] = { 11141 11014 HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT), … … 11149 11022 .name = "Input Source", 11150 11023 .count = 1, 11151 .info = alc 268_mux_enum_info,11152 .get = alc 268_mux_enum_get,11153 .put = alc 268_mux_enum_put,11024 .info = alc_mux_enum_info, 11025 .get = alc_mux_enum_get, 11026 .put = alc_mux_enum_put, 11154 11027 }, 11155 11028 {0} /* end */ … … 11169 11042 .name = "Input Source", 11170 11043 .count = 2, 11171 .info = alc 268_mux_enum_info,11172 .get = alc 268_mux_enum_get,11173 .put = alc 268_mux_enum_put,11044 .info = alc_mux_enum_info, 11045 .get = alc_mux_enum_get, 11046 .put = alc_mux_enum_put, 11174 11047 }, 11175 11048 {0} /* end */ … … 11187 11060 11188 11061 static struct hda_input_mux alc268_acer_capture_source = { 11062 .num_items = 3, 11063 .items = { 11064 { "Mic", 0x0 }, 11065 { "Internal Mic", 0x1 }, 11066 { "Line", 0x2 }, 11067 }, 11068 }; 11069 11070 static struct hda_input_mux alc268_acer_dmic_capture_source = { 11189 11071 .num_items = 3, 11190 11072 .items = { … … 11429 11311 11430 11312 if (spec->kctls.list) 11431 spec->mixers[spec->num_mixers++] = spec->kctls.list;11313 add_mixer(spec, spec->kctls.list); 11432 11314 11433 11315 if (spec->autocfg.speaker_pins[0] != 0x1d) 11434 spec->mixers[spec->num_mixers++] = alc268_beep_mixer;11435 11436 spec->init_verbs[spec->num_init_verbs++] = alc268_volume_init_verbs;11316 add_mixer(spec, alc268_beep_mixer); 11317 11318 add_verb(spec, alc268_volume_init_verbs); 11437 11319 spec->num_mux_defs = 1; 11438 11320 spec->input_mux = &spec->private_imux; … … 11442 11324 return err; 11443 11325 11326 store_pin_configs(codec); 11444 11327 return 1; 11445 11328 } … … 11469 11352 [ALC268_TOSHIBA] = "toshiba", 11470 11353 [ALC268_ACER] = "acer", 11354 [ALC268_ACER_DMIC] = "acer-dmic", 11471 11355 [ALC268_ACER_ASPIRE_ONE] = "acer-aspire", 11472 11356 [ALC268_DELL] = "dell", … … 11564 11448 .init_hook = alc268_acer_init_hook, 11565 11449 }, 11450 [ALC268_ACER_DMIC] = { 11451 .mixers = { alc268_acer_dmic_mixer, alc268_capture_alt_mixer, 11452 alc268_beep_mixer }, 11453 .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs, 11454 alc268_acer_verbs }, 11455 .num_dacs = ARRAY_SIZE(alc268_dac_nids), 11456 .dac_nids = alc268_dac_nids, 11457 .num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt), 11458 .adc_nids = alc268_adc_nids_alt, 11459 .capsrc_nids = alc268_capsrc_nids, 11460 .hp_nid = 0x02, 11461 .num_channel_mode = ARRAY_SIZE(alc268_modes), 11462 .channel_mode = alc268_modes, 11463 .input_mux = &alc268_acer_dmic_capture_source, 11464 .unsol_event = alc268_acer_unsol_event, 11465 .init_hook = alc268_acer_init_hook, 11466 }, 11566 11467 [ALC268_ACER_ASPIRE_ONE] = { 11567 11468 .mixers = { alc268_acer_aspire_one_mixer, … … 11702 11603 spec->adc_nids = alc268_adc_nids_alt; 11703 11604 spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt); 11704 spec->mixers[spec->num_mixers] = 11705 alc268_capture_alt_mixer; 11706 spec->num_mixers++; 11605 add_mixer(spec, alc268_capture_alt_mixer); 11707 11606 } else { 11708 11607 spec->adc_nids = alc268_adc_nids; 11709 11608 spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids); 11710 spec->mixers[spec->num_mixers] = 11711 alc268_capture_mixer; 11712 spec->num_mixers++; 11609 add_mixer(spec, alc268_capture_mixer); 11713 11610 } 11714 11611 spec->capsrc_nids = alc268_capsrc_nids; … … 11808 11705 }; 11809 11706 11707 static struct snd_kcontrol_new alc269_lifebook_mixer[] = { 11708 /* output mixer control */ 11709 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol), 11710 { 11711 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 11712 .name = "Master Playback Switch", 11713 .info = snd_hda_mixer_amp_switch_info, 11714 .get = snd_hda_mixer_amp_switch_get, 11715 .put = alc268_acer_master_sw_put, 11716 .private_value = HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT), 11717 }, 11718 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 11719 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 11720 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 11721 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), 11722 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), 11723 HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT), 11724 HDA_CODEC_VOLUME("Dock Mic Playback Volume", 0x0b, 0x03, HDA_INPUT), 11725 HDA_CODEC_MUTE("Dock Mic Playback Switch", 0x0b, 0x03, HDA_INPUT), 11726 HDA_CODEC_VOLUME("Dock Mic Boost", 0x1b, 0, HDA_INPUT), 11727 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x04, HDA_INPUT), 11728 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x04, HDA_INPUT), 11729 {0} 11730 }; 11731 11810 11732 /* bind volumes of both NID 0x0c and 0x0d */ 11811 11733 static struct hda_bind_ctls alc269_epc_bind_vol = { … … 11826 11748 11827 11749 /* capture mixer elements */ 11828 static struct snd_kcontrol_new alc269_capture_mixer[] = {11829 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),11830 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),11831 {11832 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,11833 /* The multiple "Capture Source" controls confuse alsamixer11834 * So call somewhat different..11835 */11836 /* .name = "Capture Source", */11837 .name = "Input Source",11838 .count = 1,11839 .info = alc_mux_enum_info,11840 .get = alc_mux_enum_get,11841 .put = alc_mux_enum_put,11842 },11843 {0} /* end */11844 };11845 11846 /* capture mixer elements */11847 11750 static struct snd_kcontrol_new alc269_epc_capture_mixer[] = { 11848 11751 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 11849 11752 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 11753 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 11754 {0} /* end */ 11755 }; 11756 11757 /* FSC amilo */ 11758 static struct snd_kcontrol_new alc269_fujitsu_mixer[] = { 11759 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT), 11760 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), 11761 HDA_BIND_VOL("PCM Playback Volume", &alc269_epc_bind_vol), 11850 11762 {0} /* end */ 11851 11763 }; … … 11868 11780 }; 11869 11781 11782 static struct hda_verb alc269_lifebook_verbs[] = { 11783 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, 11784 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, 11785 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 11786 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 11787 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 11788 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 11789 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 11790 {0x1a, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 11791 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT}, 11792 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 11793 {0} 11794 }; 11795 11870 11796 /* toggle speaker-output according to the hp-jack state */ 11871 11797 static void alc269_quanta_fl1_speaker_automute(struct hda_codec *codec) … … 11893 11819 } 11894 11820 11821 /* toggle speaker-output according to the hp-jacks state */ 11822 static void alc269_lifebook_speaker_automute(struct hda_codec *codec) 11823 { 11824 unsigned int present; 11825 unsigned char bits; 11826 11827 /* Check laptop headphone socket */ 11828 present = snd_hda_codec_read(codec, 0x15, 0, 11829 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 11830 11831 /* Check port replicator headphone socket */ 11832 present |= snd_hda_codec_read(codec, 0x1a, 0, 11833 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 11834 11835 bits = present ? AMP_IN_MUTE(0) : 0; 11836 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, 11837 AMP_IN_MUTE(0), bits); 11838 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1, 11839 AMP_IN_MUTE(0), bits); 11840 11841 snd_hda_codec_write(codec, 0x20, 0, 11842 AC_VERB_SET_COEF_INDEX, 0x0c); 11843 snd_hda_codec_write(codec, 0x20, 0, 11844 AC_VERB_SET_PROC_COEF, 0x680); 11845 11846 snd_hda_codec_write(codec, 0x20, 0, 11847 AC_VERB_SET_COEF_INDEX, 0x0c); 11848 snd_hda_codec_write(codec, 0x20, 0, 11849 AC_VERB_SET_PROC_COEF, 0x480); 11850 } 11851 11895 11852 static void alc269_quanta_fl1_mic_automute(struct hda_codec *codec) 11896 11853 { … … 11903 11860 } 11904 11861 11862 static void alc269_lifebook_mic_autoswitch(struct hda_codec *codec) 11863 { 11864 unsigned int present_laptop; 11865 unsigned int present_dock; 11866 11867 present_laptop = snd_hda_codec_read(codec, 0x18, 0, 11868 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 11869 11870 present_dock = snd_hda_codec_read(codec, 0x1b, 0, 11871 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 11872 11873 /* Laptop mic port overrides dock mic port, design decision */ 11874 if (present_dock) 11875 snd_hda_codec_write(codec, 0x23, 0, 11876 AC_VERB_SET_CONNECT_SEL, 0x3); 11877 if (present_laptop) 11878 snd_hda_codec_write(codec, 0x23, 0, 11879 AC_VERB_SET_CONNECT_SEL, 0x0); 11880 if (!present_dock && !present_laptop) 11881 snd_hda_codec_write(codec, 0x23, 0, 11882 AC_VERB_SET_CONNECT_SEL, 0x1); 11883 } 11884 11905 11885 static void alc269_quanta_fl1_unsol_event(struct hda_codec *codec, 11906 11886 unsigned int res) … … 11912 11892 } 11913 11893 11894 static void alc269_lifebook_unsol_event(struct hda_codec *codec, 11895 unsigned int res) 11896 { 11897 if ((res >> 26) == ALC880_HP_EVENT) 11898 alc269_lifebook_speaker_automute(codec); 11899 if ((res >> 26) == ALC880_MIC_EVENT) 11900 alc269_lifebook_mic_autoswitch(codec); 11901 } 11902 11914 11903 static void alc269_quanta_fl1_init_hook(struct hda_codec *codec) 11915 11904 { 11916 11905 alc269_quanta_fl1_speaker_automute(codec); 11917 11906 alc269_quanta_fl1_mic_automute(codec); 11907 } 11908 11909 static void alc269_lifebook_init_hook(struct hda_codec *codec) 11910 { 11911 alc269_lifebook_speaker_automute(codec); 11912 alc269_lifebook_mic_autoswitch(codec); 11918 11913 } 11919 11914 … … 12161 12156 } 12162 12157 12163 #define alc269_auto_create_analog_input_ctls \ 12164 alc880_auto_create_analog_input_ctls 12158 static int alc269_auto_create_analog_input_ctls(struct alc_spec *spec, 12159 const struct auto_pin_cfg *cfg) 12160 { 12161 int err; 12162 12163 err = alc880_auto_create_analog_input_ctls(spec, cfg); 12164 if (err < 0) 12165 return err; 12166 /* digital-mic input pin is excluded in alc880_auto_create..() 12167 * because it's under 0x18 12168 */ 12169 if (cfg->input_pins[AUTO_PIN_MIC] == 0x12 || 12170 cfg->input_pins[AUTO_PIN_FRONT_MIC] == 0x12) { 12171 struct hda_input_mux *imux = &spec->private_imux; 12172 imux->items[imux->num_items].label = "Int Mic"; 12173 imux->items[imux->num_items].index = 0x05; 12174 imux->num_items++; 12175 } 12176 return 0; 12177 } 12165 12178 12166 12179 #ifdef CONFIG_SND_HDA_POWER_SAVE … … 12201 12214 12202 12215 if (spec->kctls.list) 12203 spec->mixers[spec->num_mixers++] = spec->kctls.list;12216 add_mixer(spec, spec->kctls.list); 12204 12217 12205 12218 /* create a beep mixer control if the pin 0x1d isn't assigned */ … … 12208 12221 break; 12209 12222 if (i >= ARRAY_SIZE(spec->autocfg.input_pins)) 12210 spec->mixers[spec->num_mixers++] = alc269_beep_mixer;12211 12212 spec->init_verbs[spec->num_init_verbs++] = alc269_init_verbs;12223 add_mixer(spec, alc269_beep_mixer); 12224 12225 add_verb(spec, alc269_init_verbs); 12213 12226 spec->num_mux_defs = 1; 12214 12227 spec->input_mux = &spec->private_imux; … … 12222 12235 return err; 12223 12236 12224 spec->mixers[spec->num_mixers] = alc269_capture_mixer; 12225 spec->num_mixers++; 12226 12237 if (!spec->cap_mixer) 12238 set_capture_mixer(spec); 12239 12240 store_pin_configs(codec); 12227 12241 return 1; 12228 12242 } … … 12251 12265 [ALC269_QUANTA_FL1] = "quanta", 12252 12266 [ALC269_ASUS_EEEPC_P703] = "eeepc-p703", 12253 [ALC269_ASUS_EEEPC_P901] = "eeepc-p901" 12267 [ALC269_ASUS_EEEPC_P901] = "eeepc-p901", 12268 [ALC269_FUJITSU] = "fujitsu", 12269 [ALC269_LIFEBOOK] = "lifebook" 12254 12270 }; 12255 12271 … … 12262 12278 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101", 12263 12279 ALC269_ASUS_EEEPC_P901), 12280 SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU), 12281 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK), 12264 12282 {0} 12265 12283 }; … … 12267 12285 static struct alc_config_preset alc269_presets[] = { 12268 12286 [ALC269_BASIC] = { 12269 .mixers = { alc269_base_mixer , alc269_capture_mixer},12287 .mixers = { alc269_base_mixer }, 12270 12288 .init_verbs = { alc269_init_verbs }, 12271 12289 .num_dacs = ARRAY_SIZE(alc269_dac_nids), … … 12289 12307 }, 12290 12308 [ALC269_ASUS_EEEPC_P703] = { 12291 .mixers = { alc269_eeepc_mixer, alc269_epc_capture_mixer }, 12309 .mixers = { alc269_eeepc_mixer }, 12310 .cap_mixer = alc269_epc_capture_mixer, 12292 12311 .init_verbs = { alc269_init_verbs, 12293 12312 alc269_eeepc_amic_init_verbs }, … … 12302 12321 }, 12303 12322 [ALC269_ASUS_EEEPC_P901] = { 12304 .mixers = { alc269_eeepc_mixer, alc269_epc_capture_mixer}, 12323 .mixers = { alc269_eeepc_mixer }, 12324 .cap_mixer = alc269_epc_capture_mixer, 12305 12325 .init_verbs = { alc269_init_verbs, 12306 12326 alc269_eeepc_dmic_init_verbs }, … … 12313 12333 .unsol_event = alc269_eeepc_dmic_unsol_event, 12314 12334 .init_hook = alc269_eeepc_dmic_inithook, 12335 }, 12336 [ALC269_FUJITSU] = { 12337 .mixers = { alc269_fujitsu_mixer, alc269_beep_mixer }, 12338 .cap_mixer = alc269_epc_capture_mixer, 12339 .init_verbs = { alc269_init_verbs, 12340 alc269_eeepc_dmic_init_verbs }, 12341 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 12342 .dac_nids = alc269_dac_nids, 12343 .hp_nid = 0x03, 12344 .num_channel_mode = ARRAY_SIZE(alc269_modes), 12345 .channel_mode = alc269_modes, 12346 .input_mux = &alc269_eeepc_dmic_capture_source, 12347 .unsol_event = alc269_eeepc_dmic_unsol_event, 12348 .init_hook = alc269_eeepc_dmic_inithook, 12349 }, 12350 [ALC269_LIFEBOOK] = { 12351 .mixers = { alc269_lifebook_mixer }, 12352 .init_verbs = { alc269_init_verbs, alc269_lifebook_verbs }, 12353 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 12354 .dac_nids = alc269_dac_nids, 12355 .hp_nid = 0x03, 12356 .num_channel_mode = ARRAY_SIZE(alc269_modes), 12357 .channel_mode = alc269_modes, 12358 .input_mux = &alc269_capture_source, 12359 .unsol_event = alc269_lifebook_unsol_event, 12360 .init_hook = alc269_lifebook_init_hook, 12315 12361 }, 12316 12362 }; … … 12368 12414 spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); 12369 12415 spec->capsrc_nids = alc269_capsrc_nids; 12416 if (!spec->cap_mixer) 12417 set_capture_mixer(spec); 12370 12418 12371 12419 codec->patch_ops = alc_patch_ops; … … 12507 12555 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT), 12508 12556 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT), 12509 12510 /* Capture mixer control */12511 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),12512 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),12513 {12514 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,12515 .name = "Capture Source",12516 .count = 1,12517 .info = alc_mux_enum_info,12518 .get = alc_mux_enum_get,12519 .put = alc_mux_enum_put,12520 },12521 12557 {0} /* end */ 12522 12558 }; … … 12542 12578 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT), 12543 12579 12544 /* Capture mixer control */12545 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),12546 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),12547 {12548 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,12549 .name = "Capture Source",12550 .count = 1,12551 .info = alc_mux_enum_info,12552 .get = alc_mux_enum_get,12553 .put = alc_mux_enum_put,12554 },12555 12580 { 12556 12581 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, … … 12569 12594 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT), 12570 12595 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT), 12571 12572 /*Capture mixer control */12573 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),12574 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),12575 {12576 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,12577 .name = "Capture Source",12578 .count = 1,12579 .info = alc_mux_enum_info,12580 .get = alc_mux_enum_get,12581 .put = alc_mux_enum_put,12582 },12583 12596 12584 12597 {0} /* end */ … … 12605 12618 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT), 12606 12619 12607 /* Capture mixer control */12608 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),12609 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),12610 {12611 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,12612 .name = "Capture Source",12613 .count = 1,12614 .info = alc_mux_enum_info,12615 .get = alc_mux_enum_get,12616 .put = alc_mux_enum_put,12617 },12618 12620 { 12619 12621 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, … … 12647 12649 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_OUTPUT), 12648 12650 12649 /* Capture mixer control */12650 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),12651 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),12652 {12653 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,12654 .name = "Capture Source",12655 .count = 1,12656 .info = alc_mux_enum_info,12657 .get = alc_mux_enum_get,12658 .put = alc_mux_enum_put,12659 },12660 12651 { 12661 12652 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, … … 13189 13180 } 13190 13181 13191 static struct snd_kcontrol_new alc861_capture_mixer[] = {13192 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),13193 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),13194 13195 {13196 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,13197 /* The multiple "Capture Source" controls confuse alsamixer13198 * So call somewhat different..13199 */13200 /* .name = "Capture Source", */13201 .name = "Input Source",13202 .count = 1,13203 .info = alc_mux_enum_info,13204 .get = alc_mux_enum_get,13205 .put = alc_mux_enum_put,13206 },13207 {0} /* end */13208 };13209 13210 13182 static void alc861_auto_set_output_and_unmute(struct hda_codec *codec, 13211 13183 hda_nid_t nid, … … 13299 13271 13300 13272 if (spec->kctls.list) 13301 spec->mixers[spec->num_mixers++] = spec->kctls.list;13302 13303 spec->init_verbs[spec->num_init_verbs++] = alc861_auto_init_verbs;13273 add_mixer(spec, spec->kctls.list); 13274 13275 add_verb(spec, alc861_auto_init_verbs); 13304 13276 13305 13277 spec->num_mux_defs = 1; … … 13308 13280 spec->adc_nids = alc861_adc_nids; 13309 13281 spec->num_adc_nids = ARRAY_SIZE(alc861_adc_nids); 13310 s pec->mixers[spec->num_mixers] = alc861_capture_mixer;13311 spec->num_mixers++; 13312 13282 set_capture_mixer(spec); 13283 13284 store_pin_configs(codec); 13313 13285 return 1; 13314 13286 } … … 13604 13576 }; 13605 13577 13606 #define alc861vd_mux_enum_info alc_mux_enum_info13607 #define alc861vd_mux_enum_get alc_mux_enum_get13608 /* ALC861VD has the ALC882-type input selection (but has only one ADC) */13609 #define alc861vd_mux_enum_put alc882_mux_enum_put13610 13611 13578 /* 13612 13579 * 2ch mode … … 13650 13617 .get = alc_ch_mode_get, 13651 13618 .put = alc_ch_mode_put, 13652 },13653 {0} /* end */13654 };13655 13656 static struct snd_kcontrol_new alc861vd_capture_mixer[] = {13657 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),13658 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),13659 13660 {13661 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,13662 /* The multiple "Capture Source" controls confuse alsamixer13663 * So call somewhat different..13664 */13665 /* .name = "Capture Source", */13666 .name = "Input Source",13667 .count = 1,13668 .info = alc861vd_mux_enum_info,13669 .get = alc861vd_mux_enum_get,13670 .put = alc861vd_mux_enum_put,13671 13619 }, 13672 13620 {0} /* end */ … … 14064 14012 [ALC660VD_3ST] = "3stack-660", 14065 14013 [ALC660VD_3ST_DIG] = "3stack-660-digout", 14014 [ALC660VD_ASUS_V1S] = "asus-v1s", 14066 14015 [ALC861VD_3ST] = "3stack", 14067 14016 [ALC861VD_3ST_DIG] = "3stack-digout", … … 14078 14027 SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST), 14079 14028 SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST), 14080 SND_PCI_QUIRK(0x1043, 0x1633, "Asus V1Sn", ALC 861VD_LENOVO),14029 SND_PCI_QUIRK(0x1043, 0x1633, "Asus V1Sn", ALC660VD_ASUS_V1S), 14081 14030 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG), 14082 14031 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), … … 14184 14133 .unsol_event = alc861vd_dallas_unsol_event, 14185 14134 .init_hook = alc861vd_dallas_automute, 14135 }, 14136 [ALC660VD_ASUS_V1S] = { 14137 .mixers = { alc861vd_lenovo_mixer }, 14138 .init_verbs = { alc861vd_volume_init_verbs, 14139 alc861vd_3stack_init_verbs, 14140 alc861vd_eapd_verbs, 14141 alc861vd_lenovo_unsol_verbs }, 14142 .num_dacs = ARRAY_SIZE(alc660vd_dac_nids), 14143 .dac_nids = alc660vd_dac_nids, 14144 .dig_out_nid = ALC861VD_DIGOUT_NID, 14145 .num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes), 14146 .channel_mode = alc861vd_3stack_2ch_modes, 14147 .input_mux = &alc861vd_capture_source, 14148 .unsol_event = alc861vd_lenovo_unsol_event, 14149 .init_hook = alc861vd_lenovo_automute, 14186 14150 }, 14187 14151 }; … … 14410 14374 14411 14375 if (spec->kctls.list) 14412 spec->mixers[spec->num_mixers++] = spec->kctls.list; 14413 14414 spec->init_verbs[spec->num_init_verbs++] 14415 = alc861vd_volume_init_verbs; 14376 add_mixer(spec, spec->kctls.list); 14377 14378 add_verb(spec, alc861vd_volume_init_verbs); 14416 14379 14417 14380 spec->num_mux_defs = 1; … … 14422 14385 return err; 14423 14386 14387 store_pin_configs(codec); 14424 14388 return 1; 14425 14389 } … … 14479 14443 spec->stream_name_digital = "ALC660-VD Digital"; 14480 14444 /* always turn on EAPD */ 14481 spec->init_verbs[spec->num_init_verbs++] = alc660vd_eapd_verbs;14445 add_verb(spec, alc660vd_eapd_verbs); 14482 14446 } else { 14483 14447 spec->stream_name_analog = "ALC861VD Analog"; … … 14494 14458 spec->num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids); 14495 14459 spec->capsrc_nids = alc861vd_capsrc_nids; 14496 14497 spec->mixers[spec->num_mixers] = alc861vd_capture_mixer; 14498 s pec->num_mixers++;14460 spec->is_mix_capture = 1; 14461 14462 set_capture_mixer(spec); 14499 14463 14500 14464 spec->vmaster_nid = 0x02; … … 14582 14546 }, 14583 14547 }; 14584 14585 #define alc662_mux_enum_info alc_mux_enum_info14586 #define alc662_mux_enum_get alc_mux_enum_get14587 #define alc662_mux_enum_put alc882_mux_enum_put14588 14548 14589 14549 /* … … 15170 15130 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 15171 15131 {0} 15172 };15173 15174 /* capture mixer elements */15175 static struct snd_kcontrol_new alc662_capture_mixer[] = {15176 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),15177 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),15178 {15179 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,15180 /* The multiple "Capture Source" controls confuse alsamixer15181 * So call somewhat different..15182 */15183 /* .name = "Capture Source", */15184 .name = "Input Source",15185 .count = 1,15186 .info = alc662_mux_enum_info,15187 .get = alc662_mux_enum_get,15188 .put = alc662_mux_enum_put,15189 },15190 {0} /* end */15191 15132 }; 15192 15133 … … 15762 15703 static struct alc_config_preset alc662_presets[] = { 15763 15704 [ALC662_3ST_2ch_DIG] = { 15764 .mixers = { alc662_3ST_2ch_mixer , alc662_capture_mixer},15705 .mixers = { alc662_3ST_2ch_mixer }, 15765 15706 .init_verbs = { alc662_init_verbs }, 15766 15707 .num_dacs = ARRAY_SIZE(alc662_dac_nids), … … 15773 15714 }, 15774 15715 [ALC662_3ST_6ch_DIG] = { 15775 .mixers = { alc662_3ST_6ch_mixer, alc662_chmode_mixer, 15776 alc662_capture_mixer }, 15716 .mixers = { alc662_3ST_6ch_mixer, alc662_chmode_mixer }, 15777 15717 .init_verbs = { alc662_init_verbs }, 15778 15718 .num_dacs = ARRAY_SIZE(alc662_dac_nids), … … 15786 15726 }, 15787 15727 [ALC662_3ST_6ch] = { 15788 .mixers = { alc662_3ST_6ch_mixer, alc662_chmode_mixer, 15789 alc662_capture_mixer }, 15728 .mixers = { alc662_3ST_6ch_mixer, alc662_chmode_mixer }, 15790 15729 .init_verbs = { alc662_init_verbs }, 15791 15730 .num_dacs = ARRAY_SIZE(alc662_dac_nids), … … 15797 15736 }, 15798 15737 [ALC662_5ST_DIG] = { 15799 .mixers = { alc662_base_mixer, alc662_chmode_mixer, 15800 alc662_capture_mixer }, 15738 .mixers = { alc662_base_mixer, alc662_chmode_mixer }, 15801 15739 .init_verbs = { alc662_init_verbs }, 15802 15740 .num_dacs = ARRAY_SIZE(alc662_dac_nids), … … 15809 15747 }, 15810 15748 [ALC662_LENOVO_101E] = { 15811 .mixers = { alc662_lenovo_101e_mixer , alc662_capture_mixer},15749 .mixers = { alc662_lenovo_101e_mixer }, 15812 15750 .init_verbs = { alc662_init_verbs, alc662_sue_init_verbs }, 15813 15751 .num_dacs = ARRAY_SIZE(alc662_dac_nids), … … 15820 15758 }, 15821 15759 [ALC662_ASUS_EEEPC_P701] = { 15822 .mixers = { alc662_eeepc_p701_mixer , alc662_capture_mixer},15760 .mixers = { alc662_eeepc_p701_mixer }, 15823 15761 .init_verbs = { alc662_init_verbs, 15824 15762 alc662_eeepc_sue_init_verbs }, … … 15832 15770 }, 15833 15771 [ALC662_ASUS_EEEPC_EP20] = { 15834 .mixers = { alc662_eeepc_ep20_mixer, alc662_capture_mixer,15772 .mixers = { alc662_eeepc_ep20_mixer, 15835 15773 alc662_chmode_mixer }, 15836 15774 .init_verbs = { alc662_init_verbs, … … 15845 15783 }, 15846 15784 [ALC662_ECS] = { 15847 .mixers = { alc662_ecs_mixer , alc662_capture_mixer},15785 .mixers = { alc662_ecs_mixer }, 15848 15786 .init_verbs = { alc662_init_verbs, 15849 15787 alc662_ecs_init_verbs }, … … 15857 15795 }, 15858 15796 [ALC663_ASUS_M51VA] = { 15859 .mixers = { alc663_m51va_mixer , alc662_capture_mixer},15797 .mixers = { alc663_m51va_mixer }, 15860 15798 .init_verbs = { alc662_init_verbs, alc663_m51va_init_verbs }, 15861 15799 .num_dacs = ARRAY_SIZE(alc662_dac_nids), … … 15869 15807 }, 15870 15808 [ALC663_ASUS_G71V] = { 15871 .mixers = { alc663_g71v_mixer , alc662_capture_mixer},15809 .mixers = { alc663_g71v_mixer }, 15872 15810 .init_verbs = { alc662_init_verbs, alc663_g71v_init_verbs }, 15873 15811 .num_dacs = ARRAY_SIZE(alc662_dac_nids), … … 15881 15819 }, 15882 15820 [ALC663_ASUS_H13] = { 15883 .mixers = { alc663_m51va_mixer , alc662_capture_mixer},15821 .mixers = { alc663_m51va_mixer }, 15884 15822 .init_verbs = { alc662_init_verbs, alc663_m51va_init_verbs }, 15885 15823 .num_dacs = ARRAY_SIZE(alc662_dac_nids), … … 15892 15830 }, 15893 15831 [ALC663_ASUS_G50V] = { 15894 .mixers = { alc663_g50v_mixer , alc662_capture_mixer},15832 .mixers = { alc663_g50v_mixer }, 15895 15833 .init_verbs = { alc662_init_verbs, alc663_g50v_init_verbs }, 15896 15834 .num_dacs = ARRAY_SIZE(alc662_dac_nids), … … 15904 15842 }, 15905 15843 [ALC663_ASUS_MODE1] = { 15906 .mixers = { alc663_m51va_mixer, alc662_auto_capture_mixer }, 15844 .mixers = { alc663_m51va_mixer }, 15845 .cap_mixer = alc662_auto_capture_mixer, 15907 15846 .init_verbs = { alc662_init_verbs, 15908 15847 alc663_21jd_amic_init_verbs }, … … 15918 15857 }, 15919 15858 [ALC662_ASUS_MODE2] = { 15920 .mixers = { alc662_1bjd_mixer, alc662_auto_capture_mixer }, 15859 .mixers = { alc662_1bjd_mixer }, 15860 .cap_mixer = alc662_auto_capture_mixer, 15921 15861 .init_verbs = { alc662_init_verbs, 15922 15862 alc662_1bjd_amic_init_verbs }, … … 15931 15871 }, 15932 15872 [ALC663_ASUS_MODE3] = { 15933 .mixers = { alc663_two_hp_m1_mixer, alc662_auto_capture_mixer }, 15873 .mixers = { alc663_two_hp_m1_mixer }, 15874 .cap_mixer = alc662_auto_capture_mixer, 15934 15875 .init_verbs = { alc662_init_verbs, 15935 15876 alc663_two_hp_amic_m1_init_verbs }, … … 15945 15886 }, 15946 15887 [ALC663_ASUS_MODE4] = { 15947 .mixers = { alc663_asus_21jd_clfe_mixer ,15948 alc662_auto_capture_mixer},15888 .mixers = { alc663_asus_21jd_clfe_mixer }, 15889 .cap_mixer = alc662_auto_capture_mixer, 15949 15890 .init_verbs = { alc662_init_verbs, 15950 15891 alc663_21jd_amic_init_verbs}, … … 15960 15901 }, 15961 15902 [ALC663_ASUS_MODE5] = { 15962 .mixers = { alc663_asus_15jd_clfe_mixer ,15963 alc662_auto_capture_mixer },15903 .mixers = { alc663_asus_15jd_clfe_mixer }, 15904 .cap_mixer = alc662_auto_capture_mixer, 15964 15905 .init_verbs = { alc662_init_verbs, 15965 15906 alc663_15jd_amic_init_verbs }, … … 15975 15916 }, 15976 15917 [ALC663_ASUS_MODE6] = { 15977 .mixers = { alc663_two_hp_m2_mixer, alc662_auto_capture_mixer }, 15918 .mixers = { alc663_two_hp_m2_mixer }, 15919 .cap_mixer = alc662_auto_capture_mixer, 15978 15920 .init_verbs = { alc662_init_verbs, 15979 15921 alc663_two_hp_amic_m2_init_verbs }, … … 16237 16179 16238 16180 if (spec->kctls.list) 16239 spec->mixers[spec->num_mixers++] = spec->kctls.list;16181 add_mixer(spec, spec->kctls.list); 16240 16182 16241 16183 spec->num_mux_defs = 1; 16242 16184 spec->input_mux = &spec->private_imux; 16243 16185 16244 spec->init_verbs[spec->num_init_verbs++] = alc662_auto_init_verbs;16186 add_verb(spec, alc662_auto_init_verbs); 16245 16187 if (codec->vendor_id == 0x10ec0663) 16246 spec->init_verbs[spec->num_init_verbs++] = 16247 alc663_auto_init_verbs; 16188 add_verb(spec, alc663_auto_init_verbs); 16248 16189 16249 16190 err = alc_auto_add_mic_boost(codec); … … 16251 16192 return err; 16252 16193 16253 spec->mixers[spec->num_mixers] = alc662_capture_mixer; 16254 spec->num_mixers++; 16194 store_pin_configs(codec); 16255 16195 return 1; 16256 16196 } … … 16327 16267 spec->num_adc_nids = ARRAY_SIZE(alc662_adc_nids); 16328 16268 spec->capsrc_nids = alc662_capsrc_nids; 16269 spec->is_mix_capture = 1; 16270 16271 if (!spec->cap_mixer) 16272 set_capture_mixer(spec); 16329 16273 16330 16274 spec->vmaster_nid = 0x02; -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/hda/patch_sigmatel.c
r399 r402 71 71 STAC_92HD73XX_REF, 72 72 STAC_DELL_M6, 73 STAC_DELL_EQ, 73 74 STAC_92HD73XX_MODELS 74 75 }; … … 584 585 if (spec->cur_smux[smux_idx] == smux->num_items - 1) 585 586 val = AMP_OUT_MUTE; 586 if (smux_idx == 0)587 nid = spec->multiout.dig_out_nid;588 587 else 589 nid = codec->slave_dig_outs[smux_idx - 1];588 val = AMP_OUT_UNMUTE; 590 589 /* un/mute SPDIF out */ 591 590 snd_hda_codec_write_cache(codec, nid, 0, … … 793 792 794 793 static struct hda_verb dell_m6_core_init[] = { 795 /* set master volume to max value without distortion 796 * and direct control */ 797 { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xec}, 794 { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, 798 795 /* setup audio connections */ 799 796 { 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00}, … … 1623 1620 [STAC_92HD73XX_REF] = ref92hd73xx_pin_configs, 1624 1621 [STAC_DELL_M6] = dell_m6_pin_configs, 1622 [STAC_DELL_EQ] = dell_m6_pin_configs, 1625 1623 }; 1626 1624 … … 1628 1626 [STAC_92HD73XX_REF] = "ref", 1629 1627 [STAC_DELL_M6] = "dell-m6", 1628 [STAC_DELL_EQ] = "dell-eq", 1630 1629 }; 1631 1630 … … 4275 4274 4276 4275 switch (spec->board_config) { 4276 case STAC_DELL_EQ: 4277 spec->init = dell_eq_core_init; 4278 /* fallthru */ 4277 4279 case STAC_DELL_M6: 4278 spec->init = dell_eq_core_init;4279 4280 spec->num_smuxes = 0; 4280 4281 spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER]; 4281 4282 spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP]; 4282 4283 spec->num_amps = 1; 4284 4285 if (!spec->init) 4286 spec->init = dell_m6_core_init; 4283 4287 switch (codec->subsystem_id) { 4284 4288 case 0x1028025e: /* Analog Mics */ … … 4290 4294 case 0x10280271: /* Digital Mics */ 4291 4295 case 0x10280272: 4292 spec->init = dell_m6_core_init;4293 /* fall-through */4294 4296 case 0x10280254: 4295 4297 case 0x10280255: -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/intel8x0.c
r399 r402 2707 2707 SND_PCI_QUIRK(0x1028, 0x00be, "AD1885", 44100), 2708 2708 SND_PCI_QUIRK(0x1028, 0x0177, "AD1980", 48000), 2709 SND_PCI_QUIRK(0x1028, 0x01ad, "AD1981B", 48000), 2709 2710 SND_PCI_QUIRK(0x1043, 0x80f3, "AD1985", 48000), 2710 2711 {0} /* terminator */ -
GPL/branches/uniaud32-2.0/alsa-kernel/pci/rme9652/hdsp.c
r399 r402 4549 4549 struct hdsp *hdsp = (struct hdsp *)hw->private_data; 4550 4550 void __user *argp = (void __user *)arg; 4551 int err; 4551 4552 4552 4553 switch (cmd) { 4553 4554 case SNDRV_HDSP_IOCTL_GET_PEAK_RMS: { 4554 4555 struct hdsp_peak_rms __user *peak_rms = (struct hdsp_peak_rms __user *)arg; 4556 4557 err = hdsp_check_for_iobox(hdsp); 4558 if (err < 0) 4559 return err; 4560 4561 err = hdsp_check_for_firmware(hdsp, 1); 4562 if (err < 0) 4563 return err; 4555 4564 4556 4565 if (!(hdsp->state & HDSP_FirmwareLoaded)) { … … 4573 4582 int i; 4574 4583 4575 if (!(hdsp->state & HDSP_FirmwareLoaded)) { 4576 snd_printk(KERN_ERR "Hammerfall-DSP: Firmware needs to be uploaded to the card.\n"); 4577 return -EINVAL; 4578 } 4584 err = hdsp_check_for_iobox(hdsp); 4585 if (err < 0) 4586 return err; 4587 4588 err = hdsp_check_for_firmware(hdsp, 1); 4589 if (err < 0) 4590 return err; 4591 4579 4592 spin_lock_irqsave(&hdsp->lock, flags); 4580 4593 info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp); … … 5046 5059 ssleep(2); 5047 5060 5061 err = hdsp_check_for_iobox(hdsp); 5062 if (err < 0) 5063 return err; 5064 5048 5065 if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) { 5049 5066 #ifdef HDSP_FW_LOADER … … 5058 5075 return 0; 5059 5076 #endif 5060 /* no iobox connected,we defer initialization */5077 /* we defer initialization */ 5061 5078 snd_printk(KERN_INFO "Hammerfall-DSP: card initialization pending : waiting for firmware\n"); 5062 5079 if ((err = snd_hdsp_create_hwdep(card, hdsp)) < 0) -
GPL/branches/uniaud32-2.0/uniaud.inc
r400 r402 7 7 # BUILDVERSION must be 3 parts, and only numbers like 5.44.108 8 8 # It is best that 2'nd number is always 2 digits, eg at least 10 9 BUILDVERSION = 1.9.1 09 BUILDVERSION = 1.9.11 10 10 11 11 # Fixpack version … … 13 13 # ex RC3 GA FIXPACK2 beta_47 14 14 # Comment out to avoid a fixpack line in bldlevel 15 FIXPACK = SVN r40 015 FIXPACK = SVN r402 16 16 17 17 # ALSA BUILD VERSION … … 20 20 # Leave empty or use MIXED 21 21 # STRING must be max X chars 22 ALSAVERSION = 1.0.18 22 ALSAVERSION = 1.0.18a 23 23
Note:
See TracChangeset
for help on using the changeset viewer.