From patchwork Sat Sep 1 08:38:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Reid X-Patchwork-Id: 1394911 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 4E22E3FC66 for ; Sat, 1 Sep 2012 08:41:17 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T7jDs-0005dq-42; Sat, 01 Sep 2012 08:38:32 +0000 Received: from mail-gg0-f201.google.com ([209.85.161.201]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T7jDp-0005db-6K for linux-arm-kernel@lists.infradead.org; Sat, 01 Sep 2012 08:38:29 +0000 Received: by ggnb1 with SMTP id b1so395491ggn.0 for ; Sat, 01 Sep 2012 01:38:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=lGk+W63t/6c5o4/ddsvZOxEMZ1Z3r8cF2914Y/MCVWs=; b=ko6QNWoseSkUJlyB46quRyLRUviOmMQDdhsXK+ho7W85XbbW0OAltmqn9ENLp0Y6he HLEyZ4ZCJpwplPF2wJcCEGvl+ELIAICWLoDz/4rsIjiCM7BlFOm0LXvmiS4Xe5R8Rjl1 UL/NQuSe141DkZb2bbztNkMrJQNBW1t9TevoZLEmyyx9/QBORX9BixHwm2XPKlt9NqBF Bvt1Qxn5/PTtYcWIKeu/8j57i2bF/guUFGhaqO1Qni91chr3fY7HO8dO4naFIFtyH4vq jjrVWMbfUBl+r8d/3Jpougu1LQTci7KjMzVmbQKDFdFka0EUtDmHHV7rMKBUTQk+X84K EDrw== Received: by 10.236.191.33 with SMTP id f21mr7532601yhn.36.1346488707648; Sat, 01 Sep 2012 01:38:27 -0700 (PDT) Received: by 10.236.191.33 with SMTP id f21mr7532589yhn.36.1346488707590; Sat, 01 Sep 2012 01:38:27 -0700 (PDT) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id i27si1999218yhe.4.2012.09.01.01.38.27 (version=TLSv1/SSLv3 cipher=AES128-SHA); Sat, 01 Sep 2012 01:38:27 -0700 (PDT) Received: from hojo20.mtv.corp.google.com (hojo20.mtv.corp.google.com [172.22.73.78]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 7B8AE100047; Sat, 1 Sep 2012 01:38:27 -0700 (PDT) Received: by hojo20.mtv.corp.google.com (Postfix, from userid 123195) id 22782181341; Sat, 1 Sep 2012 01:38:27 -0700 (PDT) From: Dylan Reid To: linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org Subject: [PATCH v2] ASoC: samsung dma - Don't indicate support for pause/resume. Date: Sat, 1 Sep 2012 01:38:19 -0700 Message-Id: <1346488699-11027-1-git-send-email-dgreid@chromium.org> X-Mailer: git-send-email 1.7.12.146.g16d26b1 X-Gm-Message-State: ALoCoQkVyqOkvhgHBh9Ldk6C6lNch0xZKi7VnrT5jiz4L8nehZhscQeHaYGn9O/TJaPopB1ZeSPZbf7A0XrMiquYt2U0f+/dAB0H1xYHFvvWGmw77tD2KRvECqa3GMX/1m8zOaCoy7JNyEw90MHg66CkV+9dF69Iyv30uH9ciHE1pF66BEX+tz2Kdxzg/TH5uv+M3llqnftopHWUxHpRmYIe0cfjKJfOtg== X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.8 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.161.201 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.2 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: kgene.kim@samsung.com, Dylan Reid , broonie@opensource.wolfsonmicro.com, clemens@ladisch.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The pause and resume operations indicate that the stream can be un-paused/resumed from the exact location they were paused/suspended. This is not true for this driver, the pause and suspend triggers share the same code path with stop, they flush all pending DMA transfers. This drops all pending samples. The pause_release/resume triggers are the same as start, except that prepare won't be called beforehand, nothing will be enqueued to the DMA engine and nothing will happen (no audio). Removing the pause flag will let apps know that it isn't supported. Removing the resume flag will cause user space to call prepare and start instead of resume, so audio will continue playing when the system wakes up. Before removing the pause and resume flags, I tested this on an exynos 5250, using 'aplay -i'. Pause/un-pause leads to silence followed by a write error. Suspend/resume testing led to the same result. Removing the two flags fixes suspend/resume (since snd_pcm_prepare is called again). And leads to a proper reporting of pause not supported. Signed-off-by: Dylan Reid --- sound/soc/samsung/dma.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c index f3ebc38..b70964e 100644 --- a/sound/soc/samsung/dma.c +++ b/sound/soc/samsung/dma.c @@ -34,9 +34,7 @@ static const struct snd_pcm_hardware dma_hardware = { .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP | - SNDRV_PCM_INFO_MMAP_VALID | - SNDRV_PCM_INFO_PAUSE | - SNDRV_PCM_INFO_RESUME, + SNDRV_PCM_INFO_MMAP_VALID, .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_U8 | @@ -248,15 +246,11 @@ static int dma_trigger(struct snd_pcm_substream *substream, int cmd) switch (cmd) { case SNDRV_PCM_TRIGGER_START: - case SNDRV_PCM_TRIGGER_RESUME: - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: prtd->state |= ST_RUNNING; prtd->params->ops->trigger(prtd->params->ch); break; case SNDRV_PCM_TRIGGER_STOP: - case SNDRV_PCM_TRIGGER_SUSPEND: - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: prtd->state &= ~ST_RUNNING; prtd->params->ops->stop(prtd->params->ch); break;