diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-02-13 09:26:54 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@ti.com> | 2012-03-12 09:34:21 -0400 |
commit | cb40b63a224b41325a8ecdbeed5290866864b9ae (patch) | |
tree | 3da24dc61c9af27fbf3b04aa7a067a4ac9c31b83 /sound | |
parent | 81da6a9e49b9561f325d201c54eca274f066e13b (diff) |
ASoC: OMAP McBSP: Remove redundant accessors
We no longer need accessor functions for max_tx/rx_threshold, dma_op_mode
or for the FIFO size.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Grazvydas Ignotas <notasas@gmail.com>
Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/omap/mcbsp.c | 36 | ||||
-rw-r--r-- | sound/soc/omap/mcbsp.h | 3 | ||||
-rw-r--r-- | sound/soc/omap/omap-mcbsp.c | 14 |
3 files changed, 5 insertions, 48 deletions
diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c index be92a28e19ed..95ba7e0d207d 100644 --- a/sound/soc/omap/mcbsp.c +++ b/sound/soc/omap/mcbsp.c | |||
@@ -442,29 +442,6 @@ void omap_mcbsp_set_rx_threshold(struct omap_mcbsp *mcbsp, u16 threshold) | |||
442 | } | 442 | } |
443 | 443 | ||
444 | /* | 444 | /* |
445 | * omap_mcbsp_get_max_tx_thres just return the current configured | ||
446 | * maximum threshold for transmission | ||
447 | */ | ||
448 | u16 omap_mcbsp_get_max_tx_threshold(struct omap_mcbsp *mcbsp) | ||
449 | { | ||
450 | return mcbsp->max_tx_thres; | ||
451 | } | ||
452 | |||
453 | /* | ||
454 | * omap_mcbsp_get_max_rx_thres just return the current configured | ||
455 | * maximum threshold for reception | ||
456 | */ | ||
457 | u16 omap_mcbsp_get_max_rx_threshold(struct omap_mcbsp *mcbsp) | ||
458 | { | ||
459 | return mcbsp->max_rx_thres; | ||
460 | } | ||
461 | |||
462 | u16 omap_mcbsp_get_fifo_size(struct omap_mcbsp *mcbsp) | ||
463 | { | ||
464 | return mcbsp->pdata->buffer_size; | ||
465 | } | ||
466 | |||
467 | /* | ||
468 | * omap_mcbsp_get_tx_delay returns the number of used slots in the McBSP FIFO | 445 | * omap_mcbsp_get_tx_delay returns the number of used slots in the McBSP FIFO |
469 | */ | 446 | */ |
470 | u16 omap_mcbsp_get_tx_delay(struct omap_mcbsp *mcbsp) | 447 | u16 omap_mcbsp_get_tx_delay(struct omap_mcbsp *mcbsp) |
@@ -504,19 +481,6 @@ u16 omap_mcbsp_get_rx_delay(struct omap_mcbsp *mcbsp) | |||
504 | return threshold - buffstat; | 481 | return threshold - buffstat; |
505 | } | 482 | } |
506 | 483 | ||
507 | /* | ||
508 | * omap_mcbsp_get_dma_op_mode just return the current configured | ||
509 | * operating mode for the mcbsp channel | ||
510 | */ | ||
511 | int omap_mcbsp_get_dma_op_mode(struct omap_mcbsp *mcbsp) | ||
512 | { | ||
513 | int dma_op_mode; | ||
514 | |||
515 | dma_op_mode = mcbsp->dma_op_mode; | ||
516 | |||
517 | return dma_op_mode; | ||
518 | } | ||
519 | |||
520 | int omap_mcbsp_request(struct omap_mcbsp *mcbsp) | 484 | int omap_mcbsp_request(struct omap_mcbsp *mcbsp) |
521 | { | 485 | { |
522 | void *reg_cache; | 486 | void *reg_cache; |
diff --git a/sound/soc/omap/mcbsp.h b/sound/soc/omap/mcbsp.h index ec00c275ec49..a991e1dcb5ed 100644 --- a/sound/soc/omap/mcbsp.h +++ b/sound/soc/omap/mcbsp.h | |||
@@ -316,9 +316,6 @@ void omap_mcbsp_config(struct omap_mcbsp *mcbsp, | |||
316 | const struct omap_mcbsp_reg_cfg *config); | 316 | const struct omap_mcbsp_reg_cfg *config); |
317 | void omap_mcbsp_set_tx_threshold(struct omap_mcbsp *mcbsp, u16 threshold); | 317 | void omap_mcbsp_set_tx_threshold(struct omap_mcbsp *mcbsp, u16 threshold); |
318 | void omap_mcbsp_set_rx_threshold(struct omap_mcbsp *mcbsp, u16 threshold); | 318 | void omap_mcbsp_set_rx_threshold(struct omap_mcbsp *mcbsp, u16 threshold); |
319 | u16 omap_mcbsp_get_max_tx_threshold(struct omap_mcbsp *mcbsp); | ||
320 | u16 omap_mcbsp_get_max_rx_threshold(struct omap_mcbsp *mcbsp); | ||
321 | u16 omap_mcbsp_get_fifo_size(struct omap_mcbsp *mcbsp); | ||
322 | u16 omap_mcbsp_get_tx_delay(struct omap_mcbsp *mcbsp); | 319 | u16 omap_mcbsp_get_tx_delay(struct omap_mcbsp *mcbsp); |
323 | u16 omap_mcbsp_get_rx_delay(struct omap_mcbsp *mcbsp); | 320 | u16 omap_mcbsp_get_rx_delay(struct omap_mcbsp *mcbsp); |
324 | int omap_mcbsp_get_dma_op_mode(struct omap_mcbsp *mcbsp); | 321 | int omap_mcbsp_get_dma_op_mode(struct omap_mcbsp *mcbsp); |
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index 892400259494..9c703f18714c 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c | |||
@@ -67,13 +67,12 @@ static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream) | |||
67 | struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai); | 67 | struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai); |
68 | struct omap_mcbsp_data *mcbsp_data = &mcbsp->mcbsp_data; | 68 | struct omap_mcbsp_data *mcbsp_data = &mcbsp->mcbsp_data; |
69 | struct omap_pcm_dma_data *dma_data; | 69 | struct omap_pcm_dma_data *dma_data; |
70 | int dma_op_mode = omap_mcbsp_get_dma_op_mode(mcbsp); | ||
71 | int words; | 70 | int words; |
72 | 71 | ||
73 | dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); | 72 | dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); |
74 | 73 | ||
75 | /* TODO: Currently, MODE_ELEMENT == MODE_FRAME */ | 74 | /* TODO: Currently, MODE_ELEMENT == MODE_FRAME */ |
76 | if (dma_op_mode == MCBSP_DMA_MODE_THRESHOLD) | 75 | if (mcbsp->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD) |
77 | /* | 76 | /* |
78 | * Configure McBSP threshold based on either: | 77 | * Configure McBSP threshold based on either: |
79 | * packet_size, when the sDMA is in packet mode, or | 78 | * packet_size, when the sDMA is in packet mode, or |
@@ -106,7 +105,7 @@ static int omap_mcbsp_hwrule_min_buffersize(struct snd_pcm_hw_params *params, | |||
106 | int size; | 105 | int size; |
107 | 106 | ||
108 | snd_interval_any(&frames); | 107 | snd_interval_any(&frames); |
109 | size = omap_mcbsp_get_fifo_size(mcbsp); | 108 | size = mcbsp->pdata->buffer_size; |
110 | 109 | ||
111 | frames.min = size / channels->min; | 110 | frames.min = size / channels->min; |
112 | frames.integer = 1; | 111 | frames.integer = 1; |
@@ -255,17 +254,14 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, | |||
255 | if (mcbsp->pdata->buffer_size) { | 254 | if (mcbsp->pdata->buffer_size) { |
256 | dma_data->set_threshold = omap_mcbsp_set_threshold; | 255 | dma_data->set_threshold = omap_mcbsp_set_threshold; |
257 | /* TODO: Currently, MODE_ELEMENT == MODE_FRAME */ | 256 | /* TODO: Currently, MODE_ELEMENT == MODE_FRAME */ |
258 | if (omap_mcbsp_get_dma_op_mode(mcbsp) == | 257 | if (mcbsp->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD) { |
259 | MCBSP_DMA_MODE_THRESHOLD) { | ||
260 | int period_words, max_thrsh; | 258 | int period_words, max_thrsh; |
261 | 259 | ||
262 | period_words = params_period_bytes(params) / (wlen / 8); | 260 | period_words = params_period_bytes(params) / (wlen / 8); |
263 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | 261 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) |
264 | max_thrsh = omap_mcbsp_get_max_tx_threshold( | 262 | max_thrsh = mcbsp->max_tx_thres; |
265 | mcbsp); | ||
266 | else | 263 | else |
267 | max_thrsh = omap_mcbsp_get_max_rx_threshold( | 264 | max_thrsh = mcbsp->max_rx_thres; |
268 | mcbsp); | ||
269 | /* | 265 | /* |
270 | * If the period contains less or equal number of words, | 266 | * If the period contains less or equal number of words, |
271 | * we are using the original threshold mode setup: | 267 | * we are using the original threshold mode setup: |