From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ondrej Zary Subject: [PATCH 5/5] snd-ice1712: Fix resume on ice1724 Date: Tue, 18 Sep 2012 20:58:36 +0200 Message-ID: <1347994716-10251-6-git-send-email-linux@rainbow-software.org> References: <1347994716-10251-1-git-send-email-linux@rainbow-software.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.atlantis.sk (mail-1-out2.atlantis.sk [80.94.52.71]) by alsa0.perex.cz (Postfix) with ESMTP id 6CB49265139 for ; Tue, 18 Sep 2012 21:03:48 +0200 (CEST) In-Reply-To: <1347994716-10251-1-git-send-email-linux@rainbow-software.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: alsa-devel@alsa-project.org Cc: broonie@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org List-Id: alsa-devel@alsa-project.org set_pro_rate() is called from hw_params() but not from prepare(), breaking running PCM on suspend/resume. Call it from prepare() if PCM was suspended to fix the problem. Signed-off-by: Ondrej Zary --- sound/pci/ice1712/ice1724.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 0eb7ec6..ade3354 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c @@ -783,6 +783,13 @@ static int snd_vt1724_playback_pro_prepare(struct snd_pcm_substream *substream) struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); unsigned char val; unsigned int size; + int err; + + if (substream->runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { + err = snd_vt1724_set_pro_rate(ice, substream->runtime->rate, 0); + if (err < 0) + return err; + } spin_lock_irq(&ice->reg_lock); val = (8 - substream->runtime->channels) >> 1; @@ -853,6 +860,13 @@ static int snd_vt1724_pcm_prepare(struct snd_pcm_substream *substream) { struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); const struct vt1724_pcm_reg *reg = substream->runtime->private_data; + int err; + + if (substream->runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { + err = snd_vt1724_set_pro_rate(ice, substream->runtime->rate, 0); + if (err < 0) + return err; + } spin_lock_irq(&ice->reg_lock); outl(substream->runtime->dma_addr, ice->profi_port + reg->addr); -- Ondrej Zary