Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157700
b: refs/heads/master
c: a0a499c
h: refs/heads/master
v: v3
  • Loading branch information
Eduardo Valentin authored and Mark Brown committed Aug 20, 2009
1 parent bc6970d commit fb8c0c3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: caebc0cb3ba1e88f5311fbe7aa58b8dff18dd763
refs/heads/master: a0a499c5792b8656cd51e11d5e0db9fb21640f58
18 changes: 15 additions & 3 deletions trunk/sound/soc/omap/omap-mcbsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,14 @@ static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream)
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);
int samples = snd_pcm_lib_period_bytes(substream) >> 1;
int dma_op_mode = omap_mcbsp_get_dma_op_mode(mcbsp_data->bus_id);
int samples;

/* TODO: Currently, MODE_ELEMENT == MODE_FRAME */
if (dma_op_mode == MCBSP_DMA_MODE_THRESHOLD)
samples = snd_pcm_lib_period_bytes(substream) >> 1;
else
samples = 1;

/* Configure McBSP internal buffer usage */
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
Expand All @@ -166,6 +173,7 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream,
err = omap_mcbsp_request(bus_id);

if (cpu_is_omap343x()) {
int dma_op_mode = omap_mcbsp_get_dma_op_mode(bus_id);
int max_period;

/*
Expand All @@ -187,7 +195,8 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream,
max_period++;
max_period <<= 1;

snd_pcm_hw_constraint_minmax(substream->runtime,
if (dma_op_mode == MCBSP_DMA_MODE_THRESHOLD)
snd_pcm_hw_constraint_minmax(substream->runtime,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
32, max_period);
}
Expand Down Expand Up @@ -269,7 +278,10 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
port = omap34xx_mcbsp_port[bus_id][substream->stream];
omap_mcbsp_dai_dma_params[id][substream->stream].set_threshold =
omap_mcbsp_set_threshold;
sync_mode = OMAP_DMA_SYNC_FRAME;
/* TODO: Currently, MODE_ELEMENT == MODE_FRAME */
if (omap_mcbsp_get_dma_op_mode(bus_id) ==
MCBSP_DMA_MODE_THRESHOLD)
sync_mode = OMAP_DMA_SYNC_FRAME;
} else {
return -ENODEV;
}
Expand Down

0 comments on commit fb8c0c3

Please sign in to comment.