Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293472
b: refs/heads/master
c: cb40b63
h: refs/heads/master
v: v3
  • Loading branch information
Peter Ujfalusi authored and Liam Girdwood committed Mar 12, 2012
1 parent ac85b54 commit 6804367
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 49 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: 81da6a9e49b9561f325d201c54eca274f066e13b
refs/heads/master: cb40b63a224b41325a8ecdbeed5290866864b9ae
36 changes: 0 additions & 36 deletions trunk/sound/soc/omap/mcbsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,29 +441,6 @@ void omap_mcbsp_set_rx_threshold(struct omap_mcbsp *mcbsp, u16 threshold)
MCBSP_WRITE(mcbsp, THRSH1, threshold - 1);
}

/*
* omap_mcbsp_get_max_tx_thres just return the current configured
* maximum threshold for transmission
*/
u16 omap_mcbsp_get_max_tx_threshold(struct omap_mcbsp *mcbsp)
{
return mcbsp->max_tx_thres;
}

/*
* omap_mcbsp_get_max_rx_thres just return the current configured
* maximum threshold for reception
*/
u16 omap_mcbsp_get_max_rx_threshold(struct omap_mcbsp *mcbsp)
{
return mcbsp->max_rx_thres;
}

u16 omap_mcbsp_get_fifo_size(struct omap_mcbsp *mcbsp)
{
return mcbsp->pdata->buffer_size;
}

/*
* omap_mcbsp_get_tx_delay returns the number of used slots in the McBSP FIFO
*/
Expand Down Expand Up @@ -504,19 +481,6 @@ u16 omap_mcbsp_get_rx_delay(struct omap_mcbsp *mcbsp)
return threshold - buffstat;
}

/*
* omap_mcbsp_get_dma_op_mode just return the current configured
* operating mode for the mcbsp channel
*/
int omap_mcbsp_get_dma_op_mode(struct omap_mcbsp *mcbsp)
{
int dma_op_mode;

dma_op_mode = mcbsp->dma_op_mode;

return dma_op_mode;
}

int omap_mcbsp_request(struct omap_mcbsp *mcbsp)
{
void *reg_cache;
Expand Down
3 changes: 0 additions & 3 deletions trunk/sound/soc/omap/mcbsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,6 @@ void omap_mcbsp_config(struct omap_mcbsp *mcbsp,
const struct omap_mcbsp_reg_cfg *config);
void omap_mcbsp_set_tx_threshold(struct omap_mcbsp *mcbsp, u16 threshold);
void omap_mcbsp_set_rx_threshold(struct omap_mcbsp *mcbsp, u16 threshold);
u16 omap_mcbsp_get_max_tx_threshold(struct omap_mcbsp *mcbsp);
u16 omap_mcbsp_get_max_rx_threshold(struct omap_mcbsp *mcbsp);
u16 omap_mcbsp_get_fifo_size(struct omap_mcbsp *mcbsp);
u16 omap_mcbsp_get_tx_delay(struct omap_mcbsp *mcbsp);
u16 omap_mcbsp_get_rx_delay(struct omap_mcbsp *mcbsp);
int omap_mcbsp_get_dma_op_mode(struct omap_mcbsp *mcbsp);
Expand Down
14 changes: 5 additions & 9 deletions trunk/sound/soc/omap/omap-mcbsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,12 @@ static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream)
struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai);
struct omap_mcbsp_data *mcbsp_data = &mcbsp->mcbsp_data;
struct omap_pcm_dma_data *dma_data;
int dma_op_mode = omap_mcbsp_get_dma_op_mode(mcbsp);
int words;

dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);

/* TODO: Currently, MODE_ELEMENT == MODE_FRAME */
if (dma_op_mode == MCBSP_DMA_MODE_THRESHOLD)
if (mcbsp->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD)
/*
* Configure McBSP threshold based on either:
* packet_size, when the sDMA is in packet mode, or
Expand Down Expand Up @@ -106,7 +105,7 @@ static int omap_mcbsp_hwrule_min_buffersize(struct snd_pcm_hw_params *params,
int size;

snd_interval_any(&frames);
size = omap_mcbsp_get_fifo_size(mcbsp);
size = mcbsp->pdata->buffer_size;

frames.min = size / channels->min;
frames.integer = 1;
Expand Down Expand Up @@ -255,17 +254,14 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
if (mcbsp->pdata->buffer_size) {
dma_data->set_threshold = omap_mcbsp_set_threshold;
/* TODO: Currently, MODE_ELEMENT == MODE_FRAME */
if (omap_mcbsp_get_dma_op_mode(mcbsp) ==
MCBSP_DMA_MODE_THRESHOLD) {
if (mcbsp->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD) {
int period_words, max_thrsh;

period_words = params_period_bytes(params) / (wlen / 8);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
max_thrsh = omap_mcbsp_get_max_tx_threshold(
mcbsp);
max_thrsh = mcbsp->max_tx_thres;
else
max_thrsh = omap_mcbsp_get_max_rx_threshold(
mcbsp);
max_thrsh = mcbsp->max_rx_thres;
/*
* If the period contains less or equal number of words,
* we are using the original threshold mode setup:
Expand Down

0 comments on commit 6804367

Please sign in to comment.