コード例 #1
0
static void jz_pcm_start_substream(struct snd_pcm_substream *substream,
		struct snd_soc_dai *dai)
{
	struct device *dev = dai->dev;
	PCM_DEBUG_MSG("enter %s, substream = %s\n",
			__func__,
			(substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? "playback" : "capture");

	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
		__pcm_enable_transmit_dma(dev);
		__pcm_enable_replay(dev);
	} else {
		__pcm_enable_record(dev);
		__pcm_enable_receive_dma(dev);
	}
	return;
}
コード例 #2
0
static int pcm_dma_enable(int mode)
{
	int val;
	if (!pcm_priv)
			return -ENODEV;
	if (mode & CODEC_WMODE) {
		__pcm_enable_underrun_intr();
		__pcm_clear_tur();
		__pcm_enable_transmit_dma();
		__pcm_enable_replay();
	}
	if (mode & CODEC_RMODE) {
		__pcm_flush_fifo();
		__pcm_enable_record();
		/* read the first sample and ignore it */
		val = __pcm_read_fifo();
		__pcm_enable_receive_dma();
	}

//	dump_pcm_reg();
	return 0;
}