Lines Matching refs:cpcm

868 	struct snd_cs46xx_pcm * cpcm = runtime->private_data;  in snd_cs46xx_pb_trans_copy()  local
869 memcpy(cpcm->hw_buf.area + rec->hw_data, runtime->dma_area + rec->sw_data, bytes); in snd_cs46xx_pb_trans_copy()
875 struct snd_cs46xx_pcm * cpcm = runtime->private_data; in snd_cs46xx_playback_transfer() local
876 return snd_pcm_indirect_playback_transfer(substream, &cpcm->pcm_rec, in snd_cs46xx_playback_transfer()
900 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; in snd_cs46xx_playback_direct_pointer() local
902 if (snd_BUG_ON(!cpcm->pcm_channel)) in snd_cs46xx_playback_direct_pointer()
906 ptr = snd_cs46xx_peek(chip, (cpcm->pcm_channel->pcm_reader_scb->address + 2) << 2); in snd_cs46xx_playback_direct_pointer()
910 ptr -= cpcm->hw_buf.addr; in snd_cs46xx_playback_direct_pointer()
911 return ptr >> cpcm->shift; in snd_cs46xx_playback_direct_pointer()
918 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; in snd_cs46xx_playback_indirect_pointer() local
921 if (snd_BUG_ON(!cpcm->pcm_channel)) in snd_cs46xx_playback_indirect_pointer()
923 ptr = snd_cs46xx_peek(chip, (cpcm->pcm_channel->pcm_reader_scb->address + 2) << 2); in snd_cs46xx_playback_indirect_pointer()
927 ptr -= cpcm->hw_buf.addr; in snd_cs46xx_playback_indirect_pointer()
928 return snd_pcm_indirect_playback_pointer(substream, &cpcm->pcm_rec, ptr); in snd_cs46xx_playback_indirect_pointer()
953 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; in snd_cs46xx_playback_trigger() local
954 if (! cpcm->pcm_channel) { in snd_cs46xx_playback_trigger()
963 snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address + in snd_cs46xx_playback_trigger()
966 if (cpcm->pcm_channel->unlinked) in snd_cs46xx_playback_trigger()
967 cs46xx_dsp_pcm_link(chip,cpcm->pcm_channel); in snd_cs46xx_playback_trigger()
987 snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address + in snd_cs46xx_playback_trigger()
990 if (!cpcm->pcm_channel->unlinked) in snd_cs46xx_playback_trigger()
991 cs46xx_dsp_pcm_unlink(chip,cpcm->pcm_channel); in snd_cs46xx_playback_trigger()
1041 static int _cs46xx_adjust_sample_rate (struct snd_cs46xx *chip, struct snd_cs46xx_pcm *cpcm, in _cs46xx_adjust_sample_rate() argument
1046 if ( cpcm->pcm_channel == NULL) { in _cs46xx_adjust_sample_rate()
1047 cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel (chip, sample_rate, in _cs46xx_adjust_sample_rate()
1048 cpcm, cpcm->hw_buf.addr,cpcm->pcm_channel_id); in _cs46xx_adjust_sample_rate()
1049 if (cpcm->pcm_channel == NULL) { in _cs46xx_adjust_sample_rate()
1054 cpcm->pcm_channel->sample_rate = sample_rate; in _cs46xx_adjust_sample_rate()
1057 if ((int)cpcm->pcm_channel->sample_rate != sample_rate) { in _cs46xx_adjust_sample_rate()
1058 int unlinked = cpcm->pcm_channel->unlinked; in _cs46xx_adjust_sample_rate()
1059 cs46xx_dsp_destroy_pcm_channel (chip,cpcm->pcm_channel); in _cs46xx_adjust_sample_rate()
1061 cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel(chip, sample_rate, cpcm, in _cs46xx_adjust_sample_rate()
1062 cpcm->hw_buf.addr, in _cs46xx_adjust_sample_rate()
1063 cpcm->pcm_channel_id); in _cs46xx_adjust_sample_rate()
1064 if (!cpcm->pcm_channel) { in _cs46xx_adjust_sample_rate()
1070 if (!unlinked) cs46xx_dsp_pcm_link (chip,cpcm->pcm_channel); in _cs46xx_adjust_sample_rate()
1071 cpcm->pcm_channel->sample_rate = sample_rate; in _cs46xx_adjust_sample_rate()
1083 struct snd_cs46xx_pcm *cpcm; in snd_cs46xx_playback_hw_params() local
1090 cpcm = runtime->private_data; in snd_cs46xx_playback_hw_params()
1098 if (_cs46xx_adjust_sample_rate (chip,cpcm,sample_rate)) { in snd_cs46xx_playback_hw_params()
1103 snd_BUG_ON(!cpcm->pcm_channel); in snd_cs46xx_playback_hw_params()
1104 if (!cpcm->pcm_channel) { in snd_cs46xx_playback_hw_params()
1110 if (cs46xx_dsp_pcm_channel_set_period (chip,cpcm->pcm_channel,period_size)) { in snd_cs46xx_playback_hw_params()
1122 if (runtime->dma_area != cpcm->hw_buf.area) in snd_cs46xx_playback_hw_params()
1124 snd_pcm_set_runtime_buffer(substream, &cpcm->hw_buf); in snd_cs46xx_playback_hw_params()
1128 if (cpcm->pcm_channel_id == DSP_PCM_MAIN_CHANNEL) { in snd_cs46xx_playback_hw_params()
1130 } else if (cpcm->pcm_channel_id == DSP_PCM_REAR_CHANNEL) { in snd_cs46xx_playback_hw_params()
1132 } else if (cpcm->pcm_channel_id == DSP_PCM_CENTER_LFE_CHANNEL) { in snd_cs46xx_playback_hw_params()
1134 } else if (cpcm->pcm_channel_id == DSP_IEC958_CHANNEL) { in snd_cs46xx_playback_hw_params()
1144 if (runtime->dma_area == cpcm->hw_buf.area) in snd_cs46xx_playback_hw_params()
1155 if (cpcm->pcm_channel_id == DSP_PCM_MAIN_CHANNEL) { in snd_cs46xx_playback_hw_params()
1157 } else if (cpcm->pcm_channel_id == DSP_PCM_REAR_CHANNEL) { in snd_cs46xx_playback_hw_params()
1159 } else if (cpcm->pcm_channel_id == DSP_PCM_CENTER_LFE_CHANNEL) { in snd_cs46xx_playback_hw_params()
1161 } else if (cpcm->pcm_channel_id == DSP_IEC958_CHANNEL) { in snd_cs46xx_playback_hw_params()
1183 struct snd_cs46xx_pcm *cpcm; in snd_cs46xx_playback_hw_free() local
1185 cpcm = runtime->private_data; in snd_cs46xx_playback_hw_free()
1189 if (!cpcm) return -ENXIO; in snd_cs46xx_playback_hw_free()
1191 if (runtime->dma_area != cpcm->hw_buf.area) in snd_cs46xx_playback_hw_free()
1205 struct snd_cs46xx_pcm *cpcm; in snd_cs46xx_playback_prepare() local
1207 cpcm = runtime->private_data; in snd_cs46xx_playback_prepare()
1210 if (snd_BUG_ON(!cpcm->pcm_channel)) in snd_cs46xx_playback_prepare()
1213 pfie = snd_cs46xx_peek(chip, (cpcm->pcm_channel->pcm_reader_scb->address + 1) << 2 ); in snd_cs46xx_playback_prepare()
1221 cpcm->shift = 2; in snd_cs46xx_playback_prepare()
1224 cpcm->shift--; in snd_cs46xx_playback_prepare()
1229 cpcm->shift--; in snd_cs46xx_playback_prepare()
1243 memset(&cpcm->pcm_rec, 0, sizeof(cpcm->pcm_rec)); in snd_cs46xx_playback_prepare()
1244 cpcm->pcm_rec.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream); in snd_cs46xx_playback_prepare()
1245 cpcm->pcm_rec.hw_buffer_size = runtime->period_size * CS46XX_FRAGS << cpcm->shift; in snd_cs46xx_playback_prepare()
1249 tmp = snd_cs46xx_peek(chip, (cpcm->pcm_channel->pcm_reader_scb->address) << 2); in snd_cs46xx_playback_prepare()
1251 tmp |= (4 << cpcm->shift) - 1; in snd_cs46xx_playback_prepare()
1253 snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address) << 2, tmp); in snd_cs46xx_playback_prepare()
1256 …snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address + 1) << 2, pfie | cpcm->pcm_chan… in snd_cs46xx_playback_prepare()
1258 snd_cs46xx_poke(chip, BA1_PBA, cpcm->hw_buf.addr); in snd_cs46xx_playback_prepare()
1261 tmp |= (4 << cpcm->shift) - 1; in snd_cs46xx_playback_prepare()
1332 struct snd_cs46xx_pcm *cpcm = NULL; in snd_cs46xx_interrupt() local
1357 cpcm = ins->pcm_channels[i].private_data; in snd_cs46xx_interrupt()
1358 snd_pcm_period_elapsed(cpcm->substream); in snd_cs46xx_interrupt()
1367 cpcm = ins->pcm_channels[i].private_data; in snd_cs46xx_interrupt()
1368 snd_pcm_period_elapsed(cpcm->substream); in snd_cs46xx_interrupt()
1480 struct snd_cs46xx_pcm * cpcm; in _cs46xx_playback_open_channel() local
1483 cpcm = kzalloc(sizeof(*cpcm), GFP_KERNEL); in _cs46xx_playback_open_channel()
1484 if (cpcm == NULL) in _cs46xx_playback_open_channel()
1487 PAGE_SIZE, &cpcm->hw_buf) < 0) { in _cs46xx_playback_open_channel()
1488 kfree(cpcm); in _cs46xx_playback_open_channel()
1493 runtime->private_data = cpcm; in _cs46xx_playback_open_channel()
1496 cpcm->substream = substream; in _cs46xx_playback_open_channel()
1499 cpcm->pcm_channel = NULL; in _cs46xx_playback_open_channel()
1500 cpcm->pcm_channel_id = pcm_channel_id; in _cs46xx_playback_open_channel()
1509 chip->playback_pcm = cpcm; /* HACK */ in _cs46xx_playback_open_channel()
1597 struct snd_cs46xx_pcm * cpcm; in snd_cs46xx_playback_close() local
1599 cpcm = runtime->private_data; in snd_cs46xx_playback_close()
1602 if (!cpcm) return -ENXIO; in snd_cs46xx_playback_close()
1606 if (cpcm->pcm_channel) { in snd_cs46xx_playback_close()
1607 cs46xx_dsp_destroy_pcm_channel(chip,cpcm->pcm_channel); in snd_cs46xx_playback_close()
1608 cpcm->pcm_channel = NULL; in snd_cs46xx_playback_close()
1615 cpcm->substream = NULL; in snd_cs46xx_playback_close()
1616 snd_dma_free_pages(&cpcm->hw_buf); in snd_cs46xx_playback_close()