Lines Matching refs:ac97
37 static void snd_ac97_proc_read_functions(struct snd_ac97 *ac97, struct snd_info_buffer *buffer) in snd_ac97_proc_read_functions() argument
52 snd_ac97_write(ac97, AC97_FUNC_SELECT, function << 1); in snd_ac97_proc_read_functions()
53 info = snd_ac97_read(ac97, AC97_FUNC_INFO); in snd_ac97_proc_read_functions()
60 sense_info = snd_ac97_read(ac97, AC97_SENSE_INFO); in snd_ac97_proc_read_functions()
107 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
116 snd_ac97_get_name(NULL, ac97->id, name, 0); in snd_ac97_proc_read_main()
117 snd_iprintf(buffer, "%d-%d/%d: %s\n\n", ac97->addr, ac97->num, subidx, name); in snd_ac97_proc_read_main()
119 if ((ac97->scaps & AC97_SCAP_AUDIO) == 0) in snd_ac97_proc_read_main()
123 ac97->subsystem_vendor); in snd_ac97_proc_read_main()
125 ac97->subsystem_device); in snd_ac97_proc_read_main()
127 snd_iprintf(buffer, "Flags: %x\n", ac97->flags); in snd_ac97_proc_read_main()
129 if ((ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_23) { in snd_ac97_proc_read_main()
130 val = snd_ac97_read(ac97, AC97_INT_PAGING); in snd_ac97_proc_read_main()
131 snd_ac97_update_bits(ac97, AC97_INT_PAGING, in snd_ac97_proc_read_main()
133 tmp = snd_ac97_read(ac97, AC97_CODEC_CLASS_REV); in snd_ac97_proc_read_main()
137 snd_ac97_read(ac97, AC97_PCI_SVID)); in snd_ac97_proc_read_main()
139 snd_ac97_read(ac97, AC97_PCI_SID)); in snd_ac97_proc_read_main()
140 snd_ac97_update_bits(ac97, AC97_INT_PAGING, in snd_ac97_proc_read_main()
145 val = ac97->caps; in snd_ac97_proc_read_main()
153 tmp = ac97->caps & AC97_BC_DAC_MASK; in snd_ac97_proc_read_main()
159 tmp = ac97->caps & AC97_BC_ADC_MASK; in snd_ac97_proc_read_main()
168 val = snd_ac97_read(ac97, AC97_MIC); in snd_ac97_proc_read_main()
169 …snd_iprintf(buffer, "Mic gain : %s [%s]\n", val & 0x0040 ? "+20dB" : "+0dB", ac97->regs[AC… in snd_ac97_proc_read_main()
170 val = snd_ac97_read(ac97, AC97_GENERAL_PURPOSE); in snd_ac97_proc_read_main()
185 if (ac97->ext_id & AC97_EI_DRA) in snd_ac97_proc_read_main()
189 ext = snd_ac97_read(ac97, AC97_EXTENDED_ID); in snd_ac97_proc_read_main()
205 val = snd_ac97_read(ac97, AC97_EXTENDED_STATUS); in snd_ac97_proc_read_main()
222 val = snd_ac97_read(ac97, AC97_PCM_FRONT_DAC_RATE); in snd_ac97_proc_read_main()
225 val = snd_ac97_read(ac97, AC97_PCM_SURR_DAC_RATE); in snd_ac97_proc_read_main()
229 val = snd_ac97_read(ac97, AC97_PCM_LFE_DAC_RATE); in snd_ac97_proc_read_main()
232 val = snd_ac97_read(ac97, AC97_PCM_LR_ADC_RATE); in snd_ac97_proc_read_main()
236 val = snd_ac97_read(ac97, AC97_PCM_MIC_ADC_RATE); in snd_ac97_proc_read_main()
239 if ((ext & AC97_EI_SPDIF) || (ac97->flags & AC97_CS_SPDIF) || in snd_ac97_proc_read_main()
240 (ac97->id == AC97_ID_YMF743)) { in snd_ac97_proc_read_main()
241 if (ac97->flags & AC97_CS_SPDIF) in snd_ac97_proc_read_main()
242 val = snd_ac97_read(ac97, AC97_CSR_SPDIF); in snd_ac97_proc_read_main()
243 else if (ac97->id == AC97_ID_YMF743) { in snd_ac97_proc_read_main()
244 val = snd_ac97_read(ac97, AC97_YMF7X3_DIT_CTRL); in snd_ac97_proc_read_main()
247 val = snd_ac97_read(ac97, AC97_SPDIF); in snd_ac97_proc_read_main()
256 (ac97->flags & AC97_CS_SPDIF) ? in snd_ac97_proc_read_main()
259 (ac97->flags & AC97_CS_SPDIF) ? in snd_ac97_proc_read_main()
262 (ac97->flags & AC97_CS_SPDIF) ? in snd_ac97_proc_read_main()
266 if ((ac97->id & 0xfffffff0) == 0x414c4720 && in snd_ac97_proc_read_main()
267 (snd_ac97_read(ac97, AC97_ALC650_CLOCK) & 0x01)) { in snd_ac97_proc_read_main()
268 val = snd_ac97_read(ac97, AC97_ALC650_SPDIF_INPUT_STATUS2); in snd_ac97_proc_read_main()
270 val = snd_ac97_read(ac97, AC97_ALC650_SPDIF_INPUT_STATUS1); in snd_ac97_proc_read_main()
278 val = snd_ac97_read(ac97, AC97_ALC650_SPDIF_INPUT_STATUS2); in snd_ac97_proc_read_main()
289 if ((ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_23) { in snd_ac97_proc_read_main()
290 val = snd_ac97_read(ac97, AC97_INT_PAGING); in snd_ac97_proc_read_main()
291 snd_ac97_update_bits(ac97, AC97_INT_PAGING, in snd_ac97_proc_read_main()
293 snd_ac97_proc_read_functions(ac97, buffer); in snd_ac97_proc_read_main()
294 snd_ac97_update_bits(ac97, AC97_INT_PAGING, in snd_ac97_proc_read_main()
300 mext = snd_ac97_read(ac97, AC97_EXTENDED_MID); in snd_ac97_proc_read_main()
311 val = snd_ac97_read(ac97, AC97_EXTENDED_MSTATUS); in snd_ac97_proc_read_main()
330 val = snd_ac97_read(ac97, AC97_LINE1_RATE); in snd_ac97_proc_read_main()
334 val = snd_ac97_read(ac97, AC97_LINE2_RATE); in snd_ac97_proc_read_main()
338 val = snd_ac97_read(ac97, AC97_HANDSET_RATE); in snd_ac97_proc_read_main()
345 struct snd_ac97 *ac97 = entry->private_data; in snd_ac97_proc_read() local
347 mutex_lock(&ac97->page_mutex); in snd_ac97_proc_read()
348 if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { // Analog Devices AD1881/85/86 in snd_ac97_proc_read()
351 if (ac97->spec.ad18xx.id[idx]) { in snd_ac97_proc_read()
353 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, in snd_ac97_proc_read()
354 ac97->spec.ad18xx.unchained[idx] | ac97->spec.ad18xx.chained[idx]); in snd_ac97_proc_read()
355 snd_ac97_proc_read_main(ac97, buffer, idx); in snd_ac97_proc_read()
359 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); in snd_ac97_proc_read()
363 ac97->spec.ad18xx.unchained[0], in snd_ac97_proc_read()
364 ac97->spec.ad18xx.unchained[1], in snd_ac97_proc_read()
365 ac97->spec.ad18xx.unchained[2]); in snd_ac97_proc_read()
367 ac97->spec.ad18xx.chained[0], in snd_ac97_proc_read()
368 ac97->spec.ad18xx.chained[1], in snd_ac97_proc_read()
369 ac97->spec.ad18xx.chained[2]); in snd_ac97_proc_read()
371 snd_ac97_proc_read_main(ac97, buffer, 0); in snd_ac97_proc_read()
373 mutex_unlock(&ac97->page_mutex); in snd_ac97_proc_read()
380 struct snd_ac97 *ac97 = entry->private_data; in snd_ac97_proc_regs_write() local
383 mutex_lock(&ac97->page_mutex); in snd_ac97_proc_regs_write()
389 snd_ac97_write_cache(ac97, reg, val); in snd_ac97_proc_regs_write()
391 mutex_unlock(&ac97->page_mutex); in snd_ac97_proc_regs_write()
395 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
400 val = snd_ac97_read(ac97, reg); in snd_ac97_proc_regs_read_main()
408 struct snd_ac97 *ac97 = entry->private_data; in snd_ac97_proc_regs_read() local
410 mutex_lock(&ac97->page_mutex); in snd_ac97_proc_regs_read()
411 if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { // Analog Devices AD1881/85/86 in snd_ac97_proc_regs_read()
415 if (ac97->spec.ad18xx.id[idx]) { in snd_ac97_proc_regs_read()
417 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, in snd_ac97_proc_regs_read()
418 ac97->spec.ad18xx.unchained[idx] | ac97->spec.ad18xx.chained[idx]); in snd_ac97_proc_regs_read()
419 snd_ac97_proc_regs_read_main(ac97, buffer, idx); in snd_ac97_proc_regs_read()
422 snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); in snd_ac97_proc_regs_read()
424 snd_ac97_proc_regs_read_main(ac97, buffer, 0); in snd_ac97_proc_regs_read()
426 mutex_unlock(&ac97->page_mutex); in snd_ac97_proc_regs_read()
429 void snd_ac97_proc_init(struct snd_ac97 * ac97) in snd_ac97_proc_init() argument
435 if (ac97->bus->proc == NULL) in snd_ac97_proc_init()
437 prefix = ac97_is_audio(ac97) ? "ac97" : "mc97"; in snd_ac97_proc_init()
438 sprintf(name, "%s#%d-%d", prefix, ac97->addr, ac97->num); in snd_ac97_proc_init()
439 if ((entry = snd_info_create_card_entry(ac97->bus->card, name, ac97->bus->proc)) != NULL) { in snd_ac97_proc_init()
440 snd_info_set_text_ops(entry, ac97, snd_ac97_proc_read); in snd_ac97_proc_init()
446 ac97->proc = entry; in snd_ac97_proc_init()
447 sprintf(name, "%s#%d-%d+regs", prefix, ac97->addr, ac97->num); in snd_ac97_proc_init()
448 if ((entry = snd_info_create_card_entry(ac97->bus->card, name, ac97->bus->proc)) != NULL) { in snd_ac97_proc_init()
449 snd_info_set_text_ops(entry, ac97, snd_ac97_proc_regs_read); in snd_ac97_proc_init()
459 ac97->proc_regs = entry; in snd_ac97_proc_init()
462 void snd_ac97_proc_done(struct snd_ac97 * ac97) in snd_ac97_proc_done() argument
464 snd_info_free_entry(ac97->proc_regs); in snd_ac97_proc_done()
465 ac97->proc_regs = NULL; in snd_ac97_proc_done()
466 snd_info_free_entry(ac97->proc); in snd_ac97_proc_done()
467 ac97->proc = NULL; in snd_ac97_proc_done()