From aaea8beb763a0167a31aacf4643e62a548ab7cb8 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 9 Jun 2009 08:19:02 +0200 Subject: [PATCH] --- yaml --- r: 148385 b: refs/heads/master c: a5990dc5b96f537618b0f057c8723a6a0b0cdc74 h: refs/heads/master i: 148383: 579e61297e639ab6302996a07d830375014840f1 v: v3 --- [refs] | 2 +- trunk/sound/pci/ctxfi/ctatc.c | 4 ++-- trunk/sound/pci/ctxfi/ctpcm.c | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index d0c1daa1e071..c2ea6af0845f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5242bc7613311aa1a3d5ed41e9cf81015b65563f +refs/heads/master: a5990dc5b96f537618b0f057c8723a6a0b0cdc74 diff --git a/trunk/sound/pci/ctxfi/ctatc.c b/trunk/sound/pci/ctxfi/ctatc.c index e54006ef83cf..80fb2baed7a7 100644 --- a/trunk/sound/pci/ctxfi/ctatc.c +++ b/trunk/sound/pci/ctxfi/ctatc.c @@ -523,7 +523,7 @@ atc_pcm_capture_get_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm) struct src_node_conf_t src_node_conf[2] = {{0} }; /* first release old resources */ - atc->pcm_release_resources(atc, apcm); + atc_pcm_release_resources(atc, apcm); /* The numbers of converting SRCs and SRCIMPs should be determined * by pitch value. */ @@ -802,7 +802,7 @@ static int spdif_passthru_playback_get_resources(struct ct_atc *atc, unsigned int pitch, rsr = atc->pll_rate; /* first release old resources */ - atc->pcm_release_resources(atc, apcm); + atc_pcm_release_resources(atc, apcm); /* Get SRC resource */ desc.multi = apcm->substream->runtime->channels; diff --git a/trunk/sound/pci/ctxfi/ctpcm.c b/trunk/sound/pci/ctxfi/ctpcm.c index 870fa170f046..9e5c0c4da726 100644 --- a/trunk/sound/pci/ctxfi/ctpcm.c +++ b/trunk/sound/pci/ctxfi/ctpcm.c @@ -176,12 +176,26 @@ static int ct_pcm_playback_close(struct snd_pcm_substream *substream) static int ct_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) { - return snd_pcm_lib_malloc_pages(substream, + struct ct_atc *atc = snd_pcm_substream_chip(substream); + struct ct_atc_pcm *apcm = substream->runtime->private_data; + int err; + + err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); + if (err < 0) + return err; + /* clear previous resources */ + atc->pcm_release_resources(atc, apcm); + return err; } static int ct_pcm_hw_free(struct snd_pcm_substream *substream) { + struct ct_atc *atc = snd_pcm_substream_chip(substream); + struct ct_atc_pcm *apcm = substream->runtime->private_data; + + /* clear previous resources */ + atc->pcm_release_resources(atc, apcm); /* Free snd-allocated pages */ return snd_pcm_lib_free_pages(substream); }