Lines Matching refs:pcm
159 static unsigned char get_slot_reg(struct ac97_pcm *pcm, unsigned short cidx, in get_slot_reg() argument
166 if (pcm->spdif) in get_slot_reg()
168 if (pcm->stream == SNDRV_PCM_STREAM_PLAYBACK) in get_slot_reg()
169 return rate_reg_tables[dbl][pcm->r[dbl].rate_table[cidx]][slot - 3]; in get_slot_reg()
408 static unsigned int get_rates(struct ac97_pcm *pcm, unsigned int cidx, unsigned short slots, int db… in get_rates() argument
417 reg = get_slot_reg(pcm, cidx, i, dbl); in get_rates()
426 rates &= pcm->r[dbl].codec[cidx]->rates[idx]; in get_rates()
451 const struct ac97_pcm *pcm; in snd_ac97_pcm_assign() local
481 pcm = &pcms[i]; in snd_ac97_pcm_assign()
484 if (pcm->copy_flag) { in snd_ac97_pcm_assign()
485 *rpcm = *pcm; in snd_ac97_pcm_assign()
488 rpcm->stream = pcm->stream; in snd_ac97_pcm_assign()
489 rpcm->exclusive = pcm->exclusive; in snd_ac97_pcm_assign()
490 rpcm->spdif = pcm->spdif; in snd_ac97_pcm_assign()
491 rpcm->private_value = pcm->private_value; in snd_ac97_pcm_assign()
494 slots = pcm->r[0].slots; in snd_ac97_pcm_assign()
499 if (pcm->spdif && pcm->stream == 0) in snd_ac97_pcm_assign()
502 tmp = avail_slots[pcm->stream][j]; in snd_ac97_pcm_assign()
503 if (pcm->exclusive) { in snd_ac97_pcm_assign()
512 tmp &= pcm->r[0].slots; in snd_ac97_pcm_assign()
517 rpcm->r[0].rate_table[j] = rate_table[pcm->stream][j]; in snd_ac97_pcm_assign()
522 if (pcm->exclusive) in snd_ac97_pcm_assign()
523 avail_slots[pcm->stream][j] &= ~tmp; in snd_ac97_pcm_assign()
530 if (pcm->stream == SNDRV_PCM_STREAM_PLAYBACK && in snd_ac97_pcm_assign()
532 rate_table[pcm->stream][0] == 0) { in snd_ac97_pcm_assign()
535 if ((tmp & pcm->r[1].slots) == tmp) { in snd_ac97_pcm_assign()
540 if (pcm->exclusive) in snd_ac97_pcm_assign()
541 avail_slots[pcm->stream][0] &= ~tmp; in snd_ac97_pcm_assign()
570 int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate, in snd_ac97_pcm_open() argument
580 bus = pcm->bus; in snd_ac97_pcm_open()
589 spin_lock_irq(&pcm->bus->bus_lock); in snd_ac97_pcm_open()
595 if (bus->used_slots[pcm->stream][cidx] & (1 << i)) { in snd_ac97_pcm_open()
596 spin_unlock_irq(&pcm->bus->bus_lock); in snd_ac97_pcm_open()
600 if (pcm->r[r].rslots[cidx] & (1 << i)) { in snd_ac97_pcm_open()
601 bus->used_slots[pcm->stream][cidx] |= (1 << i); in snd_ac97_pcm_open()
606 spin_unlock_irq(&pcm->bus->bus_lock); in snd_ac97_pcm_open()
614 pcm->cur_dbl = r; in snd_ac97_pcm_open()
615 spin_unlock_irq(&pcm->bus->bus_lock); in snd_ac97_pcm_open()
620 if (pcm->r[r].rslots[cidx] & (1 << i)) { in snd_ac97_pcm_open()
621 reg = get_slot_reg(pcm, cidx, i, r); in snd_ac97_pcm_open()
632 err = snd_ac97_set_rate(pcm->r[r].codec[cidx], reg, rate); in snd_ac97_pcm_open()
642 pcm->aslots = slots; in snd_ac97_pcm_open()
646 pcm->aslots = slots; in snd_ac97_pcm_open()
647 snd_ac97_pcm_close(pcm); in snd_ac97_pcm_open()
661 int snd_ac97_pcm_close(struct ac97_pcm *pcm) in snd_ac97_pcm_close() argument
664 unsigned short slots = pcm->aslots; in snd_ac97_pcm_close()
668 int r = pcm->cur_dbl; in snd_ac97_pcm_close()
673 if (pcm->r[r].rslots[cidx] & (1 << i)) { in snd_ac97_pcm_close()
674 int reg = get_slot_reg(pcm, cidx, i, r); in snd_ac97_pcm_close()
675 snd_ac97_update_power(pcm->r[r].codec[cidx], in snd_ac97_pcm_close()
682 bus = pcm->bus; in snd_ac97_pcm_close()
683 spin_lock_irq(&pcm->bus->bus_lock); in snd_ac97_pcm_close()
688 bus->used_slots[pcm->stream][cidx] &= ~(1 << i); in snd_ac97_pcm_close()
690 pcm->aslots = 0; in snd_ac97_pcm_close()
691 pcm->cur_dbl = 0; in snd_ac97_pcm_close()
692 spin_unlock_irq(&pcm->bus->bus_lock); in snd_ac97_pcm_close()