summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2009-12-18 18:48:40 +0100
committerTakashi Iwai <tiwai@suse.de>2009-12-18 20:29:38 +0100
commitd3aee7996c30f928bbbbfd0994148e35d2e83084 (patch)
treed2c9ceabdeaebf406846c1918a7e97851225b213
parentALSA: AACI: cleanup aaci_pcm_hw_params (diff)
downloadlinux-d3aee7996c30f928bbbbfd0994148e35d2e83084.tar.xz
linux-d3aee7996c30f928bbbbfd0994148e35d2e83084.zip
ALSA: AACI: factor common hw_params logic into aaci_pcm_hw_params
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/arm/aaci.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c
index 2e28748a3d8d..b88bbded2f4f 100644
--- a/sound/arm/aaci.c
+++ b/sound/arm/aaci.c
@@ -444,6 +444,11 @@ static int aaci_pcm_hw_params(struct snd_pcm_substream *substream,
aacirun->pcm->r[0].slots);
aacirun->pcm_open = err == 0;
+ aacirun->cr = CR_FEN | CR_COMPACT | CR_SZ16;
+ aacirun->fifosz = aaci->fifosize * 4;
+
+ if (aacirun->cr & CR_COMPACT)
+ aacirun->fifosz >>= 1;
}
return err;
@@ -554,14 +559,9 @@ static int aaci_pcm_playback_hw_params(struct snd_pcm_substream *substream,
* Enable FIFO, compact mode, 16 bits per sample.
* FIXME: double rate slots?
*/
- if (ret >= 0) {
- aacirun->cr = CR_FEN | CR_COMPACT | CR_SZ16;
+ if (ret >= 0)
aacirun->cr |= channels_to_txmask[channels];
- aacirun->fifosz = aaci->fifosize * 4;
- if (aacirun->cr & CR_COMPACT)
- aacirun->fifosz >>= 1;
- }
return ret;
}
@@ -648,18 +648,10 @@ static int aaci_pcm_capture_hw_params(struct snd_pcm_substream *substream,
int ret;
ret = aaci_pcm_hw_params(substream, aacirun, params);
-
- if (ret >= 0) {
- aacirun->cr = CR_FEN | CR_COMPACT | CR_SZ16;
-
+ if (ret >= 0)
/* Line in record: slot 3 and 4 */
aacirun->cr |= CR_SL3 | CR_SL4;
- aacirun->fifosz = aaci->fifosize * 4;
-
- if (aacirun->cr & CR_COMPACT)
- aacirun->fifosz >>= 1;
- }
return ret;
}