From patchwork Wed Sep 26 10:23:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 147558 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp532474lji; Wed, 26 Sep 2018 03:26:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV62alKtHhFaO+fYq+Gs50BTyzQOHyg2atYsz75NF/N+r1C6ki64EcuKQIqzDNlLiq+VtbsC7 X-Received: by 2002:a62:2d4:: with SMTP id 203-v6mr5691953pfc.100.1537957560066; Wed, 26 Sep 2018 03:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537957560; cv=none; d=google.com; s=arc-20160816; b=aobMqrC2TkKrubNrm6eAYiHVNmrLgCVKp2FAubYTQ6R+4glMdKJkumM7dil6FzpJ5p 0/7lgrsHcw1IZ8CYHvMQl7WZQe2O1syjFdwY4dJMQJKkR5ipAdQL+53yYRZKlsLDsMwN sYTX7b+5qlXoAok1K6rMJzzdZV6trXNgryaK8lVZWwXr7wgWY4uL2S+F2rI9hP9SmakL 5DtD9qZBhYKtwIkZSVYVQEZJoULy3uCIaApDcnI55bPbu1jgtN8oMw5zVCd8vAP4HRYY dPXetXdHB5msqlEVnRnlPeAG/unGEcY9SX2kLpLCKz5LEyH/VdUrgV0XHEPyuGSr2dtP S7Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4syfqTgzquPxdJpZoTtqhiu/8ooDs0QTCE3IX5nC3NM=; b=aWM0QIkUrrOwtwe5jPEDbKRk88UAp5DOQwd0n+K1oy1w9uabooxjlU1Fiv5r5WgQIC 2Pq/94t/dcJD3T2q6yim2zMbxSraV7kitoP9XhRZsErkLtq0R6a8WHSu5rTfHcRIVZOc ES4qs5208K6gBRAhmqhEVId7ZkYXHTj+Y4D1bmfrFnPGsJtjbPXzsLHGGCrYtqG2S4Us 7ZdVq9KyUN44ppEEz4cG5bi1WG7+s3MEzvZ8Pc3ZfLx6ejflBbtvJUFxqqDHPmP2mo9h lfo9wBQuDvMN34E/YYfZdXI/fFAeMITM3G4QjehXiop+R6nd+mNs6NNelq+W2HteOWIv mUkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k191EyrX; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10-v6si5181853plq.1.2018.09.26.03.25.59; Wed, 26 Sep 2018 03:26:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k191EyrX; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727620AbeIZQiO (ORCPT + 6 others); Wed, 26 Sep 2018 12:38:14 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:51749 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727015AbeIZQiO (ORCPT ); Wed, 26 Sep 2018 12:38:14 -0400 Received: by mail-wm1-f65.google.com with SMTP id y25-v6so1680374wmi.1 for ; Wed, 26 Sep 2018 03:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4syfqTgzquPxdJpZoTtqhiu/8ooDs0QTCE3IX5nC3NM=; b=k191EyrXLxWe+xiQxSAFleVYd57c5YfWYMhvy3ifTPCKeKUNV6EfTXWfrPdGHCSRdU DxJ8I9SNiz1uJP3Q8WbPqouHfzduVLENter9FM0Mre29fpJ2loEIapa2BizMqOVx6U9/ EPGWwZGV3Vmg55d401Z5Ph+RzI1bl4JGnDfxI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4syfqTgzquPxdJpZoTtqhiu/8ooDs0QTCE3IX5nC3NM=; b=t26IIuLxvP+3xBaCHBUR4tay+N7goIiBQqnq7JZss5VunDvp2cBlizt34+k+ezJhq9 PKtgAScsGJvNBm3pZo5R1WDtprpIV/ITNJVZ2OdFktAAxdzl1hY3/mNkEFkhPmVlRJ47 mxyEkHS6NIHk3XBN6/r3jDatRloLSzucrLekmlsyKCNRDtm3iEPd+cC2Y7oGGC58aoq0 mjHWhz06HfigfMLokaixRnwCt5tElXQ8ASIEa7wIOndZ+xwDmN6ZX44JEZKougZGuVL4 JIUbA9cH0yVAoM4TectmTU8uTTqXdtgTW7SsH/QUTHkFmDPzFGOFjjcRwSkdA0fOYdER F5+A== X-Gm-Message-State: ABuFfoh2wTVe9QXFimEcxrIBKGTCIxRqvYBl04meddxeBYdrzi4BBnqu dPqLA2orS0kbC2j3PZ9zfJEYpY4BWdY= X-Received: by 2002:a1c:7fc6:: with SMTP id a189-v6mr3682238wmd.42.1537957556849; Wed, 26 Sep 2018 03:25:56 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id b12sm4442648wrx.11.2018.09.26.03.25.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Sep 2018 03:25:56 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, alsa-devel@alsa-project.org, robh+dt@kernel.org Cc: linux-kernel@vger.kernel.org, vkoul@kernel.org, bgoswami@codeaurora.org, rohitkr@codeaurora.org, lgirdwood@gmail.com, tiwai@suse.com, devicetree@vger.kernel.org, mark.rutland@arm.com, Srinivas Kandagatla Subject: [PATCH v2 1/5] ALSA: soc-compress: add support to snd_compr_set_runtime_buffer() Date: Wed, 26 Sep 2018 11:23:45 +0100 Message-Id: <20180926102349.23481-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180926102349.23481-1-srinivas.kandagatla@linaro.org> References: <20180926102349.23481-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds support to set runtime dma buffer on compressed stream. Signed-off-by: Srinivas Kandagatla --- include/sound/compress_driver.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) -- 2.19.0 diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h index ea8c93bbb0e0..0cdc3999ecfa 100644 --- a/include/sound/compress_driver.h +++ b/include/sound/compress_driver.h @@ -23,6 +23,7 @@ struct snd_compr_ops; * struct snd_compr_runtime: runtime stream description * @state: stream state * @ops: pointer to DSP callbacks + * @dma_buffer_p: runtime dma buffer pointer * @buffer: pointer to kernel buffer, valid only when not in mmap mode or * DSP doesn't implement copy * @buffer_size: size of the above buffer @@ -37,6 +38,7 @@ struct snd_compr_ops; struct snd_compr_runtime { snd_pcm_state_t state; struct snd_compr_ops *ops; + struct snd_dma_buffer *dma_buffer_p; void *buffer; u64 buffer_size; u32 fragment_size; @@ -175,6 +177,23 @@ static inline void snd_compr_drain_notify(struct snd_compr_stream *stream) wake_up(&stream->runtime->sleep); } +/** + * snd_compr_set_runtime_buffer - Set the Compress runtime buffer + * @substream: compress substream to set + * @bufp: the buffer information, NULL to clear + * + * Copy the buffer information to runtime buffer when @bufp is non-NULL. + * Otherwise it clears the current buffer information. + */ +static inline void snd_compr_set_runtime_buffer( + struct snd_compr_stream *substream, + struct snd_dma_buffer *bufp) +{ + struct snd_compr_runtime *runtime = substream->runtime; + + runtime->dma_buffer_p = bufp; +} + int snd_compr_stop_error(struct snd_compr_stream *stream, snd_pcm_state_t state);