Lines Matching refs:ac97

159 static int set_spdif_rate(struct snd_ac97 *ac97, unsigned short rate)  in set_spdif_rate()  argument
164 if (! (ac97->ext_id & AC97_EI_SPDIF)) in set_spdif_rate()
168 if (ac97->flags & AC97_CS_SPDIF) { in set_spdif_rate()
173 snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0); in set_spdif_rate()
179 if (ac97->id == AC97_ID_CM9739 && rate != 48000) { in set_spdif_rate()
180 snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0); in set_spdif_rate()
188 snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0); in set_spdif_rate()
195 mutex_lock(&ac97->reg_mutex); in set_spdif_rate()
196 old = snd_ac97_read(ac97, reg) & mask; in set_spdif_rate()
198 snd_ac97_update_bits_nolock(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0); in set_spdif_rate()
199 snd_ac97_update_bits_nolock(ac97, reg, mask, bits); in set_spdif_rate()
201 sbits = ac97->spdif_status; in set_spdif_rate()
217 ac97->spdif_status = sbits; in set_spdif_rate()
219 snd_ac97_update_bits_nolock(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, AC97_EA_SPDIF); in set_spdif_rate()
220 mutex_unlock(&ac97->reg_mutex); in set_spdif_rate()
243 int snd_ac97_set_rate(struct snd_ac97 *ac97, int reg, unsigned int rate) in snd_ac97_set_rate() argument
250 if (!(ac97->flags & AC97_DOUBLE_RATE)) in snd_ac97_set_rate()
256 snd_ac97_update_power(ac97, reg, 1); in snd_ac97_set_rate()
259 if ((ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_VRM) == 0) /* MIC VRA */ in snd_ac97_set_rate()
265 if ((ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_VRA) == 0) /* VRA */ in snd_ac97_set_rate()
270 if (! (ac97->scaps & AC97_SCAP_SURROUND_DAC)) in snd_ac97_set_rate()
274 if (! (ac97->scaps & AC97_SCAP_CENTER_LFE_DAC)) in snd_ac97_set_rate()
279 return set_spdif_rate(ac97, rate); in snd_ac97_set_rate()
285 tmp = (rate * ac97->bus->clock) / 48000; in snd_ac97_set_rate()
288 if ((ac97->ext_id & AC97_EI_DRA) && reg == AC97_PCM_FRONT_DAC_RATE) in snd_ac97_set_rate()
289 snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, in snd_ac97_set_rate()
291 snd_ac97_update(ac97, reg, tmp & 0xffff); in snd_ac97_set_rate()
292 snd_ac97_read(ac97, reg); in snd_ac97_set_rate()
293 if ((ac97->ext_id & AC97_EI_DRA) && reg == AC97_PCM_FRONT_DAC_RATE) { in snd_ac97_set_rate()
297 snd_ac97_update_bits(ac97, AC97_GENERAL_PURPOSE, in snd_ac97_set_rate()
300 snd_ac97_read(ac97, AC97_GENERAL_PURPOSE); in snd_ac97_set_rate()
307 static unsigned short get_pslots(struct snd_ac97 *ac97, unsigned char *rate_table, unsigned short *… in get_pslots() argument
309 if (!ac97_is_audio(ac97)) in get_pslots()
311 if (ac97_is_rev22(ac97) || ac97_can_amap(ac97)) { in get_pslots()
313 if (ac97_is_rev22(ac97)) { in get_pslots()
316 es = ac97->regs[AC97_EXTENDED_ID] &= ~AC97_EI_DACS_SLOT_MASK; in get_pslots()
317 switch (ac97->addr) { in get_pslots()
322 snd_ac97_write_cache(ac97, AC97_EXTENDED_ID, es); in get_pslots()
324 switch (ac97->addr) { in get_pslots()
327 if (ac97->scaps & AC97_SCAP_SURROUND_DAC) in get_pslots()
329 if (ac97->scaps & AC97_SCAP_CENTER_LFE_DAC) in get_pslots()
331 if (ac97->ext_id & AC97_EI_SPDIF) { in get_pslots()
332 if (!(ac97->scaps & AC97_SCAP_SURROUND_DAC)) in get_pslots()
334 else if (!(ac97->scaps & AC97_SCAP_CENTER_LFE_DAC)) in get_pslots()
344 if (ac97->scaps & AC97_SCAP_SURROUND_DAC) in get_pslots()
346 if (ac97->ext_id & AC97_EI_SPDIF) { in get_pslots()
347 if (!(ac97->scaps & AC97_SCAP_SURROUND_DAC)) in get_pslots()
356 if (ac97->ext_id & AC97_EI_SPDIF) in get_pslots()
365 if (ac97->scaps & AC97_SCAP_SURROUND_DAC) in get_pslots()
367 if (ac97->scaps & AC97_SCAP_CENTER_LFE_DAC) in get_pslots()
369 if (ac97->ext_id & AC97_EI_SPDIF) { in get_pslots()
370 if (!(ac97->scaps & AC97_SCAP_SURROUND_DAC)) in get_pslots()
372 else if (!(ac97->scaps & AC97_SCAP_CENTER_LFE_DAC)) in get_pslots()
382 static unsigned short get_cslots(struct snd_ac97 *ac97) in get_cslots() argument
386 if (!ac97_is_audio(ac97)) in get_cslots()