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 if ( (cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel (chip, sample_rate, cpcm,
1062 cpcm->hw_buf.addr,
1063 cpcm->pcm_channel_id)) == NULL) {
1069 if (!unlinked) cs46xx_dsp_pcm_link (chip,cpcm->pcm_channel);
1070 cpcm->pcm_channel->sample_rate = sample_rate;
1082 struct snd_cs46xx_pcm *cpcm;
1089 cpcm = runtime->private_data;
1097 if (_cs46xx_adjust_sample_rate (chip,cpcm,sample_rate)) {
1102 snd_BUG_ON(!cpcm->pcm_channel);
1103 if (!cpcm->pcm_channel) {
1109 if (cs46xx_dsp_pcm_channel_set_period (chip,cpcm->pcm_channel,period_size)) {
1121 if (runtime->dma_area != cpcm->hw_buf.area)
1123 runtime->dma_area = cpcm->hw_buf.area;
1124 runtime->dma_addr = cpcm->hw_buf.addr;
1125 runtime->dma_bytes = cpcm->hw_buf.bytes;
1129 if (cpcm->pcm_channel_id == DSP_PCM_MAIN_CHANNEL) {
1131 } else if (cpcm->pcm_channel_id == DSP_PCM_REAR_CHANNEL) {
1133 } else if (cpcm->pcm_channel_id == DSP_PCM_CENTER_LFE_CHANNEL) {
1135 } else if (cpcm->pcm_channel_id == DSP_IEC958_CHANNEL) {
1145 if (runtime->dma_area == cpcm->hw_buf.area) {
1158 if (cpcm->pcm_channel_id == DSP_PCM_MAIN_CHANNEL) {
1160 } else if (cpcm->pcm_channel_id == DSP_PCM_REAR_CHANNEL) {
1162 } else if (cpcm->pcm_channel_id == DSP_PCM_CENTER_LFE_CHANNEL) {
1164 } else if (cpcm->pcm_channel_id == DSP_IEC958_CHANNEL) {
1186 struct snd_cs46xx_pcm *cpcm;
1188 cpcm = runtime->private_data;
1191 is called and cpcm can actually be NULL here */
1192 if (!cpcm) return -ENXIO;
1194 if (runtime->dma_area != cpcm->hw_buf.area)
1210 struct snd_cs46xx_pcm *cpcm;
1212 cpcm = runtime->private_data;
1215 if (snd_BUG_ON(!cpcm->pcm_channel))
1218 pfie = snd_cs46xx_peek(chip, (cpcm->pcm_channel->pcm_reader_scb->address + 1) << 2 );
1226 cpcm->shift = 2;
1229 cpcm->shift--;
1234 cpcm->shift--;
1248 memset(&cpcm->pcm_rec, 0, sizeof(cpcm->pcm_rec));
1249 cpcm->pcm_rec.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream);
1250 cpcm->pcm_rec.hw_buffer_size = runtime->period_size * CS46XX_FRAGS << cpcm->shift;
1254 tmp = snd_cs46xx_peek(chip, (cpcm->pcm_channel->pcm_reader_scb->address) << 2);
1256 tmp |= (4 << cpcm->shift) - 1;
1258 snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address) << 2, tmp);
1261 snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address + 1) << 2, pfie | cpcm->pcm_channel->pcm_slot);
1263 snd_cs46xx_poke(chip, BA1_PBA, cpcm->hw_buf.addr);
1266 tmp |= (4 << cpcm->shift) - 1;
1343 struct snd_cs46xx_pcm *cpcm = NULL;
1368 cpcm = ins->pcm_channels[i].private_data;
1369 snd_pcm_period_elapsed(cpcm->substream);
1378 cpcm = ins->pcm_channels[i].private_data;
1379 snd_pcm_period_elapsed(cpcm->substream);
1491 struct snd_cs46xx_pcm * cpcm;
1494 cpcm = kzalloc(sizeof(*cpcm), GFP_KERNEL);
1495 if (cpcm == NULL)
1498 PAGE_SIZE, &cpcm->hw_buf) < 0) {
1499 kfree(cpcm);
1504 runtime->private_data = cpcm;
1507 cpcm->substream = substream;
1510 cpcm->pcm_channel = NULL;
1511 cpcm->pcm_channel_id = pcm_channel_id;
1520 chip->playback_pcm = cpcm; /* HACK */
1608 struct snd_cs46xx_pcm * cpcm;
1610 cpcm = runtime->private_data;
1612 /* when playback_open fails, then cpcm can be NULL */
1613 if (!cpcm) return -ENXIO;
1617 if (cpcm->pcm_channel) {
1618 cs46xx_dsp_destroy_pcm_channel(chip,cpcm->pcm_channel);
1619 cpcm->pcm_channel = NULL;
1626 cpcm->substream = NULL;
1627 snd_dma_free_pages(&cpcm->hw_buf);