Skip to content

Commit

Permalink
ASoC: Fix review issues in i.MX2x PCM driver
Browse files Browse the repository at this point in the history
Signed-off-by: javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
javier Martin authored and Mark Brown committed Aug 5, 2009
1 parent 2ccafed commit fbb474d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 30 deletions.
13 changes: 7 additions & 6 deletions sound/soc/imx/mx1_mx2-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static int dma_new_period(struct snd_pcm_substream *substream)
dma_size, dev_addr,
prtd->dma_params->transfer_type);
if (ret < 0) {
printk(KERN_ERR "Error configuring DMA\n");
printk(KERN_ERR "Error %d configuring DMA\n", ret);
return ret;
}
imx_dma_enable(prtd->dma_ch);
Expand Down Expand Up @@ -216,7 +216,8 @@ static int mx1_mx2_pcm_hw_params(struct snd_pcm_substream *substream,
ret = snd_pcm_lib_malloc_pages(substream,
params_buffer_bytes(hw_params));
if (ret < 0) {
printk(KERN_ERR "%s: failed to malloc pcm pages\n", __func__);
printk(KERN_ERR "%s: Error %d failed to malloc pcm pages \n",
__func__, ret);
return ret;
}

Expand Down Expand Up @@ -324,7 +325,7 @@ static int mx1_mx2_pcm_open(struct snd_pcm_substream *substream)
prtd->dma_ch = imx_dma_request_by_prio(prtd->dma_params->name,
DMA_PRIO_HIGH);
if (prtd->dma_ch < 0) {
printk(KERN_ERR "Error requesting dma channel\n");
printk(KERN_ERR "Error %d requesting dma channel\n", ret);
return ret;
}
imx_dma_config_burstlen(prtd->dma_ch,
Expand All @@ -336,8 +337,8 @@ static int mx1_mx2_pcm_open(struct snd_pcm_substream *substream)
prtd->dma_params->event_id, 0);

if (ret) {
pr_debug(KERN_ERR "Error configuring dma channel %d\n",
prtd->dma_ch);
pr_debug(KERN_ERR "Error %d configuring dma channel %d\n",
ret, prtd->dma_ch);
return ret;
}

Expand All @@ -346,7 +347,7 @@ static int mx1_mx2_pcm_open(struct snd_pcm_substream *substream)
audio_dma_irq, NULL,
(void *)substream);
if (ret < 0) {
printk(KERN_ERR "Error setting dma callback function\n");
printk(KERN_ERR "Error %d setting dma callback function\n", ret);
return ret;
}
return 0;
Expand Down
26 changes: 2 additions & 24 deletions sound/soc/imx/mx1_mx2-pcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,8 @@
* published by the Free Software Foundation.
*/

#ifndef _MXC_PCM_H
#define _MXC_PCM_H

/* AUDMUX register definitions */
#define AUDMUX_IO_BASE_ADDR IO_ADDRESS(AUDMUX_BASE_ADDR)

#define DAM_HPCR1 (*((volatile u32 *)(AUDMUX_IO_BASE_ADDR + 0x00)))
#define DAM_HPCR2 (*((volatile u32 *)(AUDMUX_IO_BASE_ADDR + 0x04)))
#define DAM_HPCR3 (*((volatile u32 *)(AUDMUX_IO_BASE_ADDR + 0x08)))
#define DAM_PPCR1 (*((volatile u32 *)(AUDMUX_IO_BASE_ADDR + 0x10)))
#define DAM_PPCR2 (*((volatile u32 *)(AUDMUX_IO_BASE_ADDR + 0x14)))
#define DAM_PPCR3 (*((volatile u32 *)(AUDMUX_IO_BASE_ADDR + 0x1C)))

#define AUDMUX_HPCR_TFSDIR (1 << 31)
#define AUDMUX_HPCR_TCLKDIR (1 << 30)
#define AUDMUX_HPCR_TFCSEL(x) (((x) & 0xff) << 26)
#define AUDMUX_HPCR_RXDSEL(x) (((x) & 0x7) << 13)
#define AUDMUX_HPCR_SYN (1 << 12)

#define AUDMUX_PPCR_TFSDIR (1 << 31)
#define AUDMUX_PPCR_TCLKDIR (1 << 30)
#define AUDMUX_PPCR_TFCSEL(x) (((x) & 0xff) << 26)
#define AUDMUX_PPCR_RXDSEL(x) (((x) & 0x7) << 13)
#define AUDMUX_PPCR_SYN (1 << 12)
#ifndef _MX1_MX2_PCM_H
#define _MX1_MX2_PCM_H

/* DMA information for mx1_mx2 platforms */
struct mx1_mx2_pcm_dma_params {
Expand Down

0 comments on commit fbb474d

Please sign in to comment.