diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-12-18 12:48:40 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-12-18 14:29:38 -0500 |
commit | d3aee7996c30f928bbbbfd0994148e35d2e83084 (patch) | |
tree | d2c9ceabdeaebf406846c1918a7e97851225b213 | |
parent | 4e30b69108b20eca80f1a323f969bf7629c7795f (diff) |
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.c | 22 |
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, | |||
444 | aacirun->pcm->r[0].slots); | 444 | aacirun->pcm->r[0].slots); |
445 | 445 | ||
446 | aacirun->pcm_open = err == 0; | 446 | aacirun->pcm_open = err == 0; |
447 | aacirun->cr = CR_FEN | CR_COMPACT | CR_SZ16; | ||
448 | aacirun->fifosz = aaci->fifosize * 4; | ||
449 | |||
450 | if (aacirun->cr & CR_COMPACT) | ||
451 | aacirun->fifosz >>= 1; | ||
447 | } | 452 | } |
448 | 453 | ||
449 | return err; | 454 | return err; |
@@ -554,14 +559,9 @@ static int aaci_pcm_playback_hw_params(struct snd_pcm_substream *substream, | |||
554 | * Enable FIFO, compact mode, 16 bits per sample. | 559 | * Enable FIFO, compact mode, 16 bits per sample. |
555 | * FIXME: double rate slots? | 560 | * FIXME: double rate slots? |
556 | */ | 561 | */ |
557 | if (ret >= 0) { | 562 | if (ret >= 0) |
558 | aacirun->cr = CR_FEN | CR_COMPACT | CR_SZ16; | ||
559 | aacirun->cr |= channels_to_txmask[channels]; | 563 | aacirun->cr |= channels_to_txmask[channels]; |
560 | 564 | ||
561 | aacirun->fifosz = aaci->fifosize * 4; | ||
562 | if (aacirun->cr & CR_COMPACT) | ||
563 | aacirun->fifosz >>= 1; | ||
564 | } | ||
565 | return ret; | 565 | return ret; |
566 | } | 566 | } |
567 | 567 | ||
@@ -648,18 +648,10 @@ static int aaci_pcm_capture_hw_params(struct snd_pcm_substream *substream, | |||
648 | int ret; | 648 | int ret; |
649 | 649 | ||
650 | ret = aaci_pcm_hw_params(substream, aacirun, params); | 650 | ret = aaci_pcm_hw_params(substream, aacirun, params); |
651 | 651 | if (ret >= 0) | |
652 | if (ret >= 0) { | ||
653 | aacirun->cr = CR_FEN | CR_COMPACT | CR_SZ16; | ||
654 | |||
655 | /* Line in record: slot 3 and 4 */ | 652 | /* Line in record: slot 3 and 4 */ |
656 | aacirun->cr |= CR_SL3 | CR_SL4; | 653 | aacirun->cr |= CR_SL3 | CR_SL4; |
657 | 654 | ||
658 | aacirun->fifosz = aaci->fifosize * 4; | ||
659 | |||
660 | if (aacirun->cr & CR_COMPACT) | ||
661 | aacirun->fifosz >>= 1; | ||
662 | } | ||
663 | return ret; | 655 | return ret; |
664 | } | 656 | } |
665 | 657 | ||