• Home
  • Raw
  • Download

Lines Matching refs:pcm

144 static unsigned char get_slot_reg(struct ac97_pcm *pcm, unsigned short cidx,  in get_slot_reg()  argument
151 if (pcm->spdif) in get_slot_reg()
153 if (pcm->stream == SNDRV_PCM_STREAM_PLAYBACK) in get_slot_reg()
154 return rate_reg_tables[dbl][pcm->r[dbl].rate_table[cidx]][slot - 3]; in get_slot_reg()
393 static unsigned int get_rates(struct ac97_pcm *pcm, unsigned int cidx, unsigned short slots, int db… in get_rates() argument
402 reg = get_slot_reg(pcm, cidx, i, dbl); in get_rates()
411 rates &= pcm->r[dbl].codec[cidx]->rates[idx]; in get_rates()
436 const struct ac97_pcm *pcm; in snd_ac97_pcm_assign() local
466 pcm = &pcms[i]; in snd_ac97_pcm_assign()
469 if (pcm->copy_flag) { in snd_ac97_pcm_assign()
470 *rpcm = *pcm; in snd_ac97_pcm_assign()
473 rpcm->stream = pcm->stream; in snd_ac97_pcm_assign()
474 rpcm->exclusive = pcm->exclusive; in snd_ac97_pcm_assign()
475 rpcm->spdif = pcm->spdif; in snd_ac97_pcm_assign()
476 rpcm->private_value = pcm->private_value; in snd_ac97_pcm_assign()
479 slots = pcm->r[0].slots; in snd_ac97_pcm_assign()
484 if (pcm->spdif && pcm->stream == 0) in snd_ac97_pcm_assign()
487 tmp = avail_slots[pcm->stream][j]; in snd_ac97_pcm_assign()
488 if (pcm->exclusive) { in snd_ac97_pcm_assign()
497 tmp &= pcm->r[0].slots; in snd_ac97_pcm_assign()
502 rpcm->r[0].rate_table[j] = rate_table[pcm->stream][j]; in snd_ac97_pcm_assign()
507 if (pcm->exclusive) in snd_ac97_pcm_assign()
508 avail_slots[pcm->stream][j] &= ~tmp; in snd_ac97_pcm_assign()
515 if (pcm->stream == SNDRV_PCM_STREAM_PLAYBACK && in snd_ac97_pcm_assign()
517 rate_table[pcm->stream][0] == 0) { in snd_ac97_pcm_assign()
520 if ((tmp & pcm->r[1].slots) == tmp) { in snd_ac97_pcm_assign()
525 if (pcm->exclusive) in snd_ac97_pcm_assign()
526 avail_slots[pcm->stream][0] &= ~tmp; in snd_ac97_pcm_assign()
555 int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate, in snd_ac97_pcm_open() argument
565 bus = pcm->bus; in snd_ac97_pcm_open()
574 spin_lock_irq(&pcm->bus->bus_lock); in snd_ac97_pcm_open()
580 if (bus->used_slots[pcm->stream][cidx] & (1 << i)) { in snd_ac97_pcm_open()
581 spin_unlock_irq(&pcm->bus->bus_lock); in snd_ac97_pcm_open()
585 if (pcm->r[r].rslots[cidx] & (1 << i)) { in snd_ac97_pcm_open()
586 bus->used_slots[pcm->stream][cidx] |= (1 << i); in snd_ac97_pcm_open()
591 spin_unlock_irq(&pcm->bus->bus_lock); in snd_ac97_pcm_open()
599 pcm->cur_dbl = r; in snd_ac97_pcm_open()
600 spin_unlock_irq(&pcm->bus->bus_lock); in snd_ac97_pcm_open()
605 if (pcm->r[r].rslots[cidx] & (1 << i)) { in snd_ac97_pcm_open()
606 reg = get_slot_reg(pcm, cidx, i, r); in snd_ac97_pcm_open()
617 err = snd_ac97_set_rate(pcm->r[r].codec[cidx], reg, rate); in snd_ac97_pcm_open()
627 pcm->aslots = slots; in snd_ac97_pcm_open()
631 pcm->aslots = slots; in snd_ac97_pcm_open()
632 snd_ac97_pcm_close(pcm); in snd_ac97_pcm_open()
646 int snd_ac97_pcm_close(struct ac97_pcm *pcm) in snd_ac97_pcm_close() argument
649 unsigned short slots = pcm->aslots; in snd_ac97_pcm_close()
653 int r = pcm->cur_dbl; in snd_ac97_pcm_close()
658 if (pcm->r[r].rslots[cidx] & (1 << i)) { in snd_ac97_pcm_close()
659 int reg = get_slot_reg(pcm, cidx, i, r); in snd_ac97_pcm_close()
660 snd_ac97_update_power(pcm->r[r].codec[cidx], in snd_ac97_pcm_close()
667 bus = pcm->bus; in snd_ac97_pcm_close()
668 spin_lock_irq(&pcm->bus->bus_lock); in snd_ac97_pcm_close()
673 bus->used_slots[pcm->stream][cidx] &= ~(1 << i); in snd_ac97_pcm_close()
675 pcm->aslots = 0; in snd_ac97_pcm_close()
676 pcm->cur_dbl = 0; in snd_ac97_pcm_close()
677 spin_unlock_irq(&pcm->bus->bus_lock); in snd_ac97_pcm_close()