Lines Matching defs:cpcm

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