Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f1bc26e authored by Graeme Gregory's avatar Graeme Gregory Committed by Jaroslav Kysela
Browse files

[ALSA] ASoC Samsung S3c24xx updates - audio DMA cleanup



This patch cleans up the audio DMA for the Samsung S3C24xx platform.

Signed-off-by: default avatarGraeme Gregory <gg@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent c45e20eb
Loading
Loading
Loading
Loading
+24 −18
Original line number Diff line number Diff line
@@ -100,7 +100,8 @@ static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream)
			       __FUNCTION__, len);
		}

		ret = s3c2410_dma_enqueue(prtd->params->channel, substream, pos, len);
		ret = s3c2410_dma_enqueue(prtd->params->channel, 
			substream, pos, len);

		if (ret == 0) {
			prtd->dma_loaded++;
@@ -119,13 +120,15 @@ static void s3c24xx_audio_buffdone(struct s3c2410_dma_chan *channel,
				enum s3c2410_dma_buffresult result)
{
	struct snd_pcm_substream *substream = dev_id;
	struct s3c24xx_runtime_data *prtd = substream->runtime->private_data;
	struct s3c24xx_runtime_data *prtd;

	DBG("Entered %s\n", __FUNCTION__);

	if (result == S3C2410_RES_ABORT || result == S3C2410_RES_ERR)
		return;

	prtd = substream->runtime->private_data;
	
	if (substream)
		snd_pcm_period_elapsed(substream);

@@ -177,10 +180,14 @@ static int s3c24xx_pcm_hw_params(struct snd_pcm_substream *substream,
				S3C2410_DISRCC_APB, prtd->params->dma_addr);

		s3c2410_dma_config(prtd->params->channel,
						2, S3C2410_DCON_SYNC_PCLK | S3C2410_DCON_HANDSHAKE);
				prtd->params->dma_size,
				S3C2410_DCON_SYNC_PCLK | 
				S3C2410_DCON_HANDSHAKE);
	} else {
		s3c2410_dma_config(prtd->params->channel,
						2, S3C2410_DCON_HANDSHAKE | S3C2410_DCON_SYNC_PCLK);
				prtd->params->dma_size,
				S3C2410_DCON_HANDSHAKE | 
				S3C2410_DCON_SYNC_PCLK);

		s3c2410_dma_devconfig(prtd->params->channel,
					S3C2410_DMASRC_HW, 0x3,
@@ -281,7 +288,8 @@ static int s3c24xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
	return ret;
}

static snd_pcm_uframes_t s3c24xx_pcm_pointer(struct snd_pcm_substream *substream)
static snd_pcm_uframes_t 
	s3c24xx_pcm_pointer(struct snd_pcm_substream *substream)
{
	struct snd_pcm_runtime *runtime = substream->runtime;
	struct s3c24xx_runtime_data *prtd = runtime->private_data;
@@ -321,8 +329,6 @@ static int s3c24xx_pcm_open(struct snd_pcm_substream *substream)
	struct snd_pcm_runtime *runtime = substream->runtime;
	struct s3c24xx_runtime_data *prtd;

	int ret;

	DBG("Entered %s\n", __FUNCTION__);

	snd_soc_set_runtime_hwparams(substream, &s3c24xx_pcm_hardware);
@@ -419,8 +425,8 @@ static void s3c24xx_pcm_free_dma_buffers(struct snd_pcm *pcm)

static u64 s3c24xx_pcm_dmamask = DMA_32BIT_MASK;

static int s3c24xx_pcm_new(struct snd_card *card, struct snd_soc_codec_dai *dai,
	struct snd_pcm *pcm)
static int s3c24xx_pcm_new(struct snd_card *card, 
	struct snd_soc_codec_dai *dai, struct snd_pcm *pcm)
{
	int ret = 0;

+3 −4
Original line number Diff line number Diff line
@@ -19,12 +19,11 @@ struct s3c24xx_pcm_dma_params {
	struct s3c2410_dma_client *client;	/* stream identifier */
	int channel;				/* Channel ID */
	dma_addr_t dma_addr;
	int dma_size;			/* Size of the DMA transfer */
};

#define S3C24XX_DAI_I2S			0

extern struct snd_soc_cpu_dai s3c24xx_i2s_dai;

/* platform data */
extern struct snd_soc_platform s3c24xx_soc_platform;
extern struct snd_ac97_bus_ops s3c24xx_ac97_ops;