Lines Matching refs:ac97
22 static void snd_ac97_proc_read_functions(struct snd_ac97 *ac97, struct snd_info_buffer *buffer) in snd_ac97_proc_read_functions() argument
37 snd_ac97_write(ac97, AC97_FUNC_SELECT, function << 1); in snd_ac97_proc_read_functions()
38 info = snd_ac97_read(ac97, AC97_FUNC_INFO); in snd_ac97_proc_read_functions()
45 sense_info = snd_ac97_read(ac97, AC97_SENSE_INFO); in snd_ac97_proc_read_functions()
92 static void snd_ac97_proc_read_main(struct snd_ac97 *ac97, struct snd_info_buffer *buffer, int subi… in snd_ac97_proc_read_main() argument
101 snd_ac97_get_name(NULL, ac97->id, name, 0); in snd_ac97_proc_read_main()
102 snd_iprintf(buffer, "%d-%d/%d: %s\n\n", ac97->addr, ac97->num, subidx, name); in snd_ac97_proc_read_main()
104 if ((ac97->scaps & AC97_SCAP_AUDIO) == 0) in snd_ac97_proc_read_main()
108 ac97->subsystem_vendor); in snd_ac97_proc_read_main()
110 ac97->subsystem_device); in snd_ac97_proc_read_main()
112 snd_iprintf(buffer, "Flags: %x\n", ac97->flags); in snd_ac97_proc_read_main()
114 if ((ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_23) { in snd_ac97_proc_read_main()
115 val = snd_ac97_read(ac97, AC97_INT_PAGING); in snd_ac97_proc_read_main()
116 snd_ac97_update_bits(ac97, AC97_INT_PAGING, in snd_ac97_proc_read_main()
118 tmp = snd_ac97_read(ac97, AC97_CODEC_CLASS_REV); in snd_ac97_proc_read_main()
122 snd_ac97_read(ac97, AC97_PCI_SVID)); in snd_ac97_proc_read_main()
124 snd_ac97_read(ac97, AC97_PCI_SID)); in snd_ac97_proc_read_main()
125 snd_ac97_update_bits(ac97, AC97_INT_PAGING, in snd_ac97_proc_read_main()
130 val = ac97->caps; in snd_ac97_proc_read_main()
138 tmp = ac97->caps & AC97_BC_DAC_MASK; in snd_ac97_proc_read_main()
144 tmp = ac97->caps & AC97_BC_ADC_MASK; in snd_ac97_proc_read_main()
153 val = snd_ac97_read(ac97, AC97_MIC); in snd_ac97_proc_read_main()
154 …snd_iprintf(buffer, "Mic gain : %s [%s]\n", val & 0x0040 ? "+20dB" : "+0dB", ac97->regs[AC… in snd_ac97_proc_read_main()
155 val = snd_ac97_read(ac97, AC97_GENERAL_PURPOSE); in snd_ac97_proc_read_main()
170 if (ac97->ext_id & AC97_EI_DRA) in snd_ac97_proc_read_main()
174 ext = snd_ac97_read(ac97, AC97_EXTENDED_ID); in snd_ac97_proc_read_main()
190 val = snd_ac97_read(ac97, AC97_EXTENDED_STATUS); in snd_ac97_proc_read_main()
207 val = snd_ac97_read(ac97, AC97_PCM_FRONT_DAC_RATE); in snd_ac97_proc_read_main()
210 val = snd_ac97_read(ac97, AC97_PCM_SURR_DAC_RATE); in snd_ac97_proc_read_main()
214 val = snd_ac97_read(ac97, AC97_PCM_LFE_DAC_RATE); in snd_ac97_proc_read_main()
217 val = snd_ac97_read(ac97, AC97_PCM_LR_ADC_RATE); in snd_ac97_proc_read_main()
221 val = snd_ac97_read(ac97, AC97_PCM_MIC_ADC_RATE); in snd_ac97_proc_read_main()
224 if ((ext & AC97_EI_SPDIF) || (ac97->flags & AC97_CS_SPDIF) || in snd_ac97_proc_read_main()
225 (ac97->id == AC97_ID_YMF743)) { in snd_ac97_proc_read_main()
226 if (ac97->flags & AC97_CS_SPDIF) in snd_ac97_proc_read_main()
227 val = snd_ac97_read(ac97, AC97_CSR_SPDIF); in snd_ac97_proc_read_main()
228 else if (ac97->id == AC97_ID_YMF743) { in snd_ac97_proc_read_main()
229 val = snd_ac97_read(ac97, AC97_YMF7X3_DIT_CTRL); in snd_ac97_proc_read_main()
232 val = snd_ac97_read(ac97, AC97_SPDIF); in snd_ac97_proc_read_main()
241 (ac97->flags & AC97_CS_SPDIF) ? in snd_ac97_proc_read_main()
244 (ac97->flags & AC97_CS_SPDIF) ? in snd_ac97_proc_read_main()
247 (ac97->flags & AC97_CS_SPDIF) ? in snd_ac97_proc_read_main()
251 if ((ac97->id & 0xfffffff0) == 0x414c4720 && in snd_ac97_proc_read_main()
252 (snd_ac97_read(ac97, AC97_ALC650_CLOCK) & 0x01)) { in snd_ac97_proc_read_main()
253 val = snd_ac97_read(ac97, AC97_ALC650_SPDIF_INPUT_STATUS2); in snd_ac97_proc_read_main()
255 val = snd_ac97_read(ac97, AC97_ALC650_SPDIF_INPUT_STATUS1); in snd_ac97_proc_read_main()
263 val = snd_ac97_read(ac97, AC97_ALC650_SPDIF_INPUT_STATUS2); in snd_ac97_proc_read_main()
274 if ((ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_23) { in snd_ac97_proc_read_main()
275 val = snd_ac97_read(ac97, AC97_INT_PAGING); in snd_ac97_proc_read_main()
276 snd_ac97_update_bits(ac97, AC97_INT_PAGING, in snd_ac97_proc_read_main()
278 snd_ac97_proc_read_functions(ac97, buffer); in snd_ac97_proc_read_main()
279 snd_ac97_update_bits(ac97, AC97_INT_PAGING, in snd_ac97_proc_read_main()
285 mext = snd_ac97_read(ac97, AC97_EXTENDED_MID); in snd_ac97_proc_read_main()
296 val = snd_ac97_read(ac97, AC97_EXTENDED_MSTATUS); in snd_ac97_proc_read_main()
315 val = snd_ac97_read(ac97, AC97_LINE1_RATE); in snd_ac97_proc_read_main()
319 val = snd_ac97_read(ac97, AC97_LINE2_RATE); in snd_ac97_proc_read_main()
323 val = snd_ac97_read(ac97, AC97_HANDSET_RATE); in snd_ac97_proc_read_main()
330 struct snd_ac97 *ac97 = entry->private_data; in snd_ac97_proc_read() local
332 mutex_lock(&ac97->page_mutex); in snd_ac97_proc_read()
333 if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { // Analog Devices AD1881/85/86 in snd_ac97_proc_read()
336 if (ac97->spec.ad18xx.id[idx]) { in snd_ac97_proc_read()
338 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, in snd_ac97_proc_read()
339 ac97->spec.ad18xx.unchained[idx] | ac97->spec.ad18xx.chained[idx]); in snd_ac97_proc_read()
340 snd_ac97_proc_read_main(ac97, buffer, idx); in snd_ac97_proc_read()
344 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); in snd_ac97_proc_read()
348 ac97->spec.ad18xx.unchained[0], in snd_ac97_proc_read()
349 ac97->spec.ad18xx.unchained[1], in snd_ac97_proc_read()
350 ac97->spec.ad18xx.unchained[2]); in snd_ac97_proc_read()
352 ac97->spec.ad18xx.chained[0], in snd_ac97_proc_read()
353 ac97->spec.ad18xx.chained[1], in snd_ac97_proc_read()
354 ac97->spec.ad18xx.chained[2]); in snd_ac97_proc_read()
356 snd_ac97_proc_read_main(ac97, buffer, 0); in snd_ac97_proc_read()
358 mutex_unlock(&ac97->page_mutex); in snd_ac97_proc_read()
365 struct snd_ac97 *ac97 = entry->private_data; in snd_ac97_proc_regs_write() local
368 mutex_lock(&ac97->page_mutex); in snd_ac97_proc_regs_write()
374 snd_ac97_write_cache(ac97, reg, val); in snd_ac97_proc_regs_write()
376 mutex_unlock(&ac97->page_mutex); in snd_ac97_proc_regs_write()
380 static void snd_ac97_proc_regs_read_main(struct snd_ac97 *ac97, struct snd_info_buffer *buffer, int… in snd_ac97_proc_regs_read_main() argument
385 val = snd_ac97_read(ac97, reg); in snd_ac97_proc_regs_read_main()
393 struct snd_ac97 *ac97 = entry->private_data; in snd_ac97_proc_regs_read() local
395 mutex_lock(&ac97->page_mutex); in snd_ac97_proc_regs_read()
396 if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { // Analog Devices AD1881/85/86 in snd_ac97_proc_regs_read()
400 if (ac97->spec.ad18xx.id[idx]) { in snd_ac97_proc_regs_read()
402 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, in snd_ac97_proc_regs_read()
403 ac97->spec.ad18xx.unchained[idx] | ac97->spec.ad18xx.chained[idx]); in snd_ac97_proc_regs_read()
404 snd_ac97_proc_regs_read_main(ac97, buffer, idx); in snd_ac97_proc_regs_read()
407 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); in snd_ac97_proc_regs_read()
409 snd_ac97_proc_regs_read_main(ac97, buffer, 0); in snd_ac97_proc_regs_read()
411 mutex_unlock(&ac97->page_mutex); in snd_ac97_proc_regs_read()
414 void snd_ac97_proc_init(struct snd_ac97 * ac97) in snd_ac97_proc_init() argument
420 if (ac97->bus->proc == NULL) in snd_ac97_proc_init()
422 prefix = ac97_is_audio(ac97) ? "ac97" : "mc97"; in snd_ac97_proc_init()
423 sprintf(name, "%s#%d-%d", prefix, ac97->addr, ac97->num); in snd_ac97_proc_init()
424 entry = snd_info_create_card_entry(ac97->bus->card, name, in snd_ac97_proc_init()
425 ac97->bus->proc); in snd_ac97_proc_init()
427 snd_info_set_text_ops(entry, ac97, snd_ac97_proc_read); in snd_ac97_proc_init()
428 ac97->proc = entry; in snd_ac97_proc_init()
429 sprintf(name, "%s#%d-%d+regs", prefix, ac97->addr, ac97->num); in snd_ac97_proc_init()
430 entry = snd_info_create_card_entry(ac97->bus->card, name, in snd_ac97_proc_init()
431 ac97->bus->proc); in snd_ac97_proc_init()
433 snd_info_set_text_ops(entry, ac97, snd_ac97_proc_regs_read); in snd_ac97_proc_init()
439 ac97->proc_regs = entry; in snd_ac97_proc_init()
442 void snd_ac97_proc_done(struct snd_ac97 * ac97) in snd_ac97_proc_done() argument
444 snd_info_free_entry(ac97->proc_regs); in snd_ac97_proc_done()
445 ac97->proc_regs = NULL; in snd_ac97_proc_done()
446 snd_info_free_entry(ac97->proc); in snd_ac97_proc_done()
447 ac97->proc = NULL; in snd_ac97_proc_done()