From bebea77d2ccb1a0b55041c5047b4c92967bdb692 Mon Sep 17 00:00:00 2001 From: Alison Wang Date: Wed, 29 Apr 2015 16:25:58 +0800 Subject: Revert "ls102xa: audio: Workaround for SAI data transfer endian issue" This reverts commit (ls102xa: audio: Workaround for SAI data transfer endian issue). The patch "ls102xa: audio: Workaround for SAI data transfer endian issue" isn't needed for LS1021A Rev2.0 silicon. Signed-off-by: Alison Wang Change-Id: I850e4207e7beb7eedda260df001d9189ac666f28 Reviewed-on: http://git.am.freescale.net:8181/36159 Tested-by: Review Code-CDREVIEW Reviewed-by: Zhengxiong Jin Tested-by: Zhengxiong Jin diff --git a/include/sound/pcm.h b/include/sound/pcm.h index a07b670..84b10f9 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -418,8 +418,6 @@ struct snd_pcm_substream { #endif /* misc flags */ unsigned int hw_opened: 1; - /* data swapped flags */ - unsigned int data_swapped; }; #define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0) diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 6dd3089..e1ef106 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -1964,9 +1964,6 @@ static int snd_pcm_lib_write_transfer(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime = substream->runtime; int err; char __user *buf = (char __user *) data + frames_to_bytes(runtime, off); - int i; - char tmp; - if (substream->ops->copy) { if ((err = substream->ops->copy(substream, -1, hwoff, buf, frames)) < 0) return err; @@ -1974,22 +1971,6 @@ static int snd_pcm_lib_write_transfer(struct snd_pcm_substream *substream, char *hwbuf = runtime->dma_area + frames_to_bytes(runtime, hwoff); if (copy_from_user(hwbuf, buf, frames_to_bytes(runtime, frames))) return -EFAULT; - - if (substream->data_swapped) { - switch (runtime->format) { - case SNDRV_PCM_FORMAT_S16_LE: - for (i = 0; - i < frames_to_bytes(runtime, frames); - i = i + 2) { - tmp = *(hwbuf + i); - *(hwbuf + i) = *(hwbuf + i + 1); - *(hwbuf + i + 1) = tmp; - } - break; - default: - return -EINVAL; - } - } } return 0; } @@ -2205,30 +2186,11 @@ static int snd_pcm_lib_read_transfer(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime = substream->runtime; int err; char __user *buf = (char __user *) data + frames_to_bytes(runtime, off); - int i; - char tmp; - if (substream->ops->copy) { if ((err = substream->ops->copy(substream, -1, hwoff, buf, frames)) < 0) return err; } else { char *hwbuf = runtime->dma_area + frames_to_bytes(runtime, hwoff); - if (substream->data_swapped) { - switch (runtime->format) { - case SNDRV_PCM_FORMAT_S16_LE: - for (i = 0; - i < frames_to_bytes(runtime, frames); - i = i + 2) { - tmp = *(hwbuf + i); - *(hwbuf + i) = *(hwbuf + i + 1); - *(hwbuf + i + 1) = tmp; - } - break; - default: - return -EINVAL; - } - } - if (copy_to_user(buf, hwbuf, frames_to_bytes(runtime, frames))) return -EFAULT; } diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 3653b25..896f011 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -334,9 +334,6 @@ static int fsl_sai_startup(struct snd_pcm_substream *substream, struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); u32 reg; - if (sai->big_endian_regs) - substream->data_swapped = 1; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) reg = FSL_SAI_TCR3; else @@ -555,14 +552,8 @@ static int fsl_sai_probe(struct platform_device *pdev) return PTR_ERR(sai->regmap); } - if (sai->big_endian_regs) { - sai->dma_params_rx.addr = res->start + FSL_SAI_RDR + 2; - sai->dma_params_tx.addr = res->start + FSL_SAI_TDR + 2; - } else { - sai->dma_params_rx.addr = res->start + FSL_SAI_RDR; - sai->dma_params_tx.addr = res->start + FSL_SAI_TDR; - } - + sai->dma_params_rx.addr = res->start + FSL_SAI_RDR; + sai->dma_params_tx.addr = res->start + FSL_SAI_TDR; sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX; sai->dma_params_tx.maxburst = FSL_SAI_MAXBURST_TX; -- cgit v0.10.2