diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-09-10 09:32:40 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-09-10 09:32:40 -0400 |
commit | e0b3032bcdf1419d97de636d5fb1c9469da75776 (patch) | |
tree | 30252bef7afdad1f789b215c99909104a1d5cfa1 /sound/soc/davinci/davinci-pcm.c | |
parent | 45fae5c78d873b10c66dfc04db6701e05c493791 (diff) | |
parent | cdc65fbe18aef15e92d2ebb410a189fbf956fb06 (diff) |
Merge branch 'topic/asoc' into for-linus
* topic/asoc: (226 commits)
ASoC: au1x: PSC-AC97 bugfixes
ASoC: Fix WM835x Out4 capture enumeration
ASoC: Remove unuused hw_read_t
ASoC: fix pxa2xx-ac97.c breakage
ASoC: Fully specify DC servo bits to update in wm_hubs
ASoC: Debugged improper setting of PLL fields in WM8580 driver
ASoC: new board driver to connect bfin-5xx with ad1836 codec
ASoC: OMAP: Add functionality to set CLKR and FSR sources in McBSP DAI
ASoC: davinci: i2c device creation moved into board files
ASoC: Don't reconfigure WM8350 FLL if not needed
ASoC: Fix s3c-i2s-v2 build
ASoC: Make platform data optional for TLV320AIC3x
ASoC: Add S3C24xx dependencies for Simtec machines
ASoC: SDP3430: Fix TWL GPIO6 pin mux request
ASoC: S3C platform: Fix s3c2410_dma_started() called at improper time
ARM: OMAP: McBSP: Merge two functions into omap_mcbsp_start/_stop
ASoC: OMAP: Fix setup of XCCR and RCCR registers in McBSP DAI
OMAP: McBSP: Use textual values in DMA operating mode sysfs files
ARM: OMAP: DMA: Add support for DMA channel self linking on OMAP1510
ASoC: Select core DMA when building for S3C64xx
...
Diffstat (limited to 'sound/soc/davinci/davinci-pcm.c')
-rw-r--r-- | sound/soc/davinci/davinci-pcm.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c index a05996588489..091dacb78b4d 100644 --- a/sound/soc/davinci/davinci-pcm.c +++ b/sound/soc/davinci/davinci-pcm.c | |||
@@ -67,6 +67,7 @@ static void davinci_pcm_enqueue_dma(struct snd_pcm_substream *substream) | |||
67 | dma_addr_t src, dst; | 67 | dma_addr_t src, dst; |
68 | unsigned short src_bidx, dst_bidx; | 68 | unsigned short src_bidx, dst_bidx; |
69 | unsigned int data_type; | 69 | unsigned int data_type; |
70 | unsigned short acnt; | ||
70 | unsigned int count; | 71 | unsigned int count; |
71 | 72 | ||
72 | period_size = snd_pcm_lib_period_bytes(substream); | 73 | period_size = snd_pcm_lib_period_bytes(substream); |
@@ -91,11 +92,12 @@ static void davinci_pcm_enqueue_dma(struct snd_pcm_substream *substream) | |||
91 | dst_bidx = data_type; | 92 | dst_bidx = data_type; |
92 | } | 93 | } |
93 | 94 | ||
95 | acnt = prtd->params->acnt; | ||
94 | edma_set_src(lch, src, INCR, W8BIT); | 96 | edma_set_src(lch, src, INCR, W8BIT); |
95 | edma_set_dest(lch, dst, INCR, W8BIT); | 97 | edma_set_dest(lch, dst, INCR, W8BIT); |
96 | edma_set_src_index(lch, src_bidx, 0); | 98 | edma_set_src_index(lch, src_bidx, 0); |
97 | edma_set_dest_index(lch, dst_bidx, 0); | 99 | edma_set_dest_index(lch, dst_bidx, 0); |
98 | edma_set_transfer_params(lch, data_type, count, 1, 0, ASYNC); | 100 | edma_set_transfer_params(lch, acnt, count, 1, 0, ASYNC); |
99 | 101 | ||
100 | prtd->period++; | 102 | prtd->period++; |
101 | if (unlikely(prtd->period >= runtime->periods)) | 103 | if (unlikely(prtd->period >= runtime->periods)) |
@@ -206,6 +208,7 @@ static int davinci_pcm_prepare(struct snd_pcm_substream *substream) | |||
206 | /* Copy self-linked parameter RAM entry into master channel */ | 208 | /* Copy self-linked parameter RAM entry into master channel */ |
207 | edma_read_slot(prtd->slave_lch, &temp); | 209 | edma_read_slot(prtd->slave_lch, &temp); |
208 | edma_write_slot(prtd->master_lch, &temp); | 210 | edma_write_slot(prtd->master_lch, &temp); |
211 | davinci_pcm_enqueue_dma(substream); | ||
209 | 212 | ||
210 | return 0; | 213 | return 0; |
211 | } | 214 | } |
@@ -243,6 +246,11 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream) | |||
243 | int ret = 0; | 246 | int ret = 0; |
244 | 247 | ||
245 | snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware); | 248 | snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware); |
249 | /* ensure that buffer size is a multiple of period size */ | ||
250 | ret = snd_pcm_hw_constraint_integer(runtime, | ||
251 | SNDRV_PCM_HW_PARAM_PERIODS); | ||
252 | if (ret < 0) | ||
253 | return ret; | ||
246 | 254 | ||
247 | prtd = kzalloc(sizeof(struct davinci_runtime_data), GFP_KERNEL); | 255 | prtd = kzalloc(sizeof(struct davinci_runtime_data), GFP_KERNEL); |
248 | if (prtd == NULL) | 256 | if (prtd == NULL) |