From patchwork Thu Nov 15 18:13:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 151233 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7327789ljp; Thu, 15 Nov 2018 10:15:34 -0800 (PST) X-Google-Smtp-Source: AJdET5ce3DA8T7lLueGFFWSSnjEaaMeDoayYqusCTlU/GpJlco8DuYs2kTwhD6S9K2IJ6RVqn+oX X-Received: by 2002:a62:ab0d:: with SMTP id p13mr7009282pff.211.1542305734589; Thu, 15 Nov 2018 10:15:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542305734; cv=none; d=google.com; s=arc-20160816; b=b9VEnZPlmB1BMC/N8lSWh6Hce3DG8nRqd8W1E4n5IsH5tzYulnK8Xywht7j3LhBYK7 /hLoWlX5dkPZSyvfifKzAcwAgGaZaWoTZfmsbvOZJ67BdWXobk6pwTNhAomtDzxnyrR0 FdxZCrHaPW56tPfKVPGUvNOZRhQC8uROVOt2iXgm4bC1eDRQPqMPlFiZRnp8WbCOm8r0 Jr7/yGqiwt0JIrHj7WVm7CUAWF7bOQ1h5TYZARrlzPeINz1xKUKXf49sSpuGfkO9/bYH SoJ8y563e1J5QdG5bUudt8741ubNxpsOAxOb7jT66TCPPcfClbWQz3xatOfGjSN0Ak1d sW8g== 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=q3gLC+nmyp2mq9QJP7D6LeLPOksVBsoxF3h1ogX1tDA=; b=Y6xi6wBbVsfEewxJRRlCLihWznc14Um3+ImiffSq0Xo6N7UySQVFmOSPJQRJuCZ2lX GRHiD3dEOMJjerGSXrPJT3n5gU/ojLDAUBkM4P2HeDr8Wx6d4dQKuF0n4jn146pS0c6V qkvnAgREca1UG/zgYfvwj88Daiy3yEF5B3rDPVH/Xm+IOYXNsCMsFmqGPcVMesDfTd0A LU4hqK8ZWZPpsnRtsReHh7njnZvqAM5A0ak/jUIJI+VhBA4LTkQrfmY+NatNr+EZtx60 l6OdGuxKymSHl/1spzegcvp/89fpG41yednhX2bgb8hXnhaFccVn2oMD5O+aJPFFOTMj xkIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PD2Miuqt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 b59-v6si33104783plb.206.2018.11.15.10.15.34; Thu, 15 Nov 2018 10:15:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=PD2Miuqt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S2388854AbeKPEYY (ORCPT + 32 others); Thu, 15 Nov 2018 23:24:24 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37121 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388454AbeKPEYX (ORCPT ); Thu, 15 Nov 2018 23:24:23 -0500 Received: by mail-wr1-f66.google.com with SMTP id j10so8020267wru.4 for ; Thu, 15 Nov 2018 10:15:30 -0800 (PST) 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=q3gLC+nmyp2mq9QJP7D6LeLPOksVBsoxF3h1ogX1tDA=; b=PD2MiuqtbVX1pUtDQ5uG7knacHELfzxsm2rl4tC/L3ngPzrHoSpuX51Kj5XLtACe+8 TJyJoirK/chyhTCMDRGoAhgTM1HtEze10ObZ9eS24yWH3hRdYffonVmRxdc5UjMzb18n uEU3XUq52bRvcCBp+erqp9e6Ut6bP9aGmhXNI= 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=q3gLC+nmyp2mq9QJP7D6LeLPOksVBsoxF3h1ogX1tDA=; b=sdg5FnRJRXioWRUAV1WYUm+wtrr6pbr5OtrZ037W9m9PU0JF+rdrolBn/V/3ObwZ4e rTF0ueG5+uksbd2Wc6n5VVbB7vxwKeGTnKFFKiFkTA8PbwjtzSZxXqAPlw9yyDeeMHA+ t3DvXo3UIGNygPimBXPMOnWQtI9NEFR3f5PrH1/J4nLs6M+zRoWp5+12vNcmMgvklkId Oe7m8J1K31BLDSPEosSydA+Cs5QawBZmF4qOC1exEJtbXcEVGk4WFMTbE29B8N0SukFr OXTAgv9MhbNEjD5TfqKF+u/l4tiKFnephA/5ezDMt76se6UdttiYtwkC/OBJ2Rx/AR5Z gL2Q== X-Gm-Message-State: AGRZ1gJpGwG8sGCX05XJnTv6g9gi1uUeco303fkCGW/vxPb57N6Xi8/f pUIqGpe8T3jNbELkMq+aJMqAYg== X-Received: by 2002:adf:a78a:: with SMTP id j10-v6mr6975400wrc.286.1542305729876; Thu, 15 Nov 2018 10:15:29 -0800 (PST) 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 r76-v6sm20934737wmb.21.2018.11.15.10.15.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Nov 2018 10:15:29 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, vkoul@kernel.org Cc: alsa-devel@alsa-project.org, robh+dt@kernel.org, linux-kernel@vger.kernel.org, bgoswami@codeaurora.org, rohitkr@codeaurora.org, lgirdwood@gmail.com, tiwai@suse.com, devicetree@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v3 1/5] ALSA: soc-compress: add support to snd_compr_set_runtime_buffer() Date: Thu, 15 Nov 2018 18:13:20 +0000 Message-Id: <20181115181324.26784-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181115181324.26784-1-srinivas.kandagatla@linaro.org> References: <20181115181324.26784-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Existing compress offload code allocates data buffers using simple kmalloc, however there are situations where these buffers have to be mapped in smmu. So provide a way to set the runtime buffer by the driver itself, simillar to what we do with pcm. 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.1 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); From patchwork Thu Nov 15 18:13:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 151234 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7327836ljp; Thu, 15 Nov 2018 10:15:37 -0800 (PST) X-Google-Smtp-Source: AJdET5e9ZZ7rul7UGJEprP5gIcd6hHfP2uqQbrH49qxOZaoGHPqIa9j/w5OHjSxW5lrWG84rFdUS X-Received: by 2002:a17:902:aa41:: with SMTP id c1-v6mr7258254plr.219.1542305737108; Thu, 15 Nov 2018 10:15:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542305737; cv=none; d=google.com; s=arc-20160816; b=dj6/rKidR0WeoD32YugyXhkVVAGhJjsnFyNlR90EaI9cxhskEDrP1BQo8+CEOjbGxD pPjETPkxVkCqCQZqh1r30ZApVXGrQj28kY4c32+gjOOLRIRFmT4/XMEBuRCeDkWVo1tk dHsGuBLwExdCC1jLcyZhlZVR8+r2Z09wRzqUPcSJmVPDT102mUiTQYVXaBSmB+B8TB7/ Ew9Gc32cRWLUCmETL7QlUNjl6Z247anW5mz4CR+QaQSfJrsTHoulJtjK7+Ng3SLJMCdJ chWBk4pFV7adtxKsG6ElDTkad2JHUHXYPXizwp31JRHT2779fZS3lxsKXxAqyuGsFcXu UMhw== 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=NJe/Lh0u4I1EWKwZUx0PaLmr2WjeZlvlzz6DRN2R6yI=; b=q4uoJx+s62dXakIK4fGfbTfoWd4CrNP2JC/29k70LUWmTaQQlqR5D/XuzfipZU/YyM yfQm5p4nrFlucMu5xI80b1Jl+mQLaown4UqKCJCu05szM0JNV+k61R7Hi0IJLY+LmXAl 9UXmUMfWMtpkPKEPptJmjBbCql66yoNQ/NwDPxx9BoemODOG9xg3ETIw+cbAaSMGlI6C tiuNF8X/z21Cal3C0lz9MM9bZxWAAE3WVIzggDAS6+EFmAofo8xai0TeOLfVnXMt4/Gi RuhMEnQSpIA6y0N77oRNSUB6ocEYxgvqYUtImMYXrqAsFDV86hWzBT5BjRUCooqmUb/I AKcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DG9FoSML; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 y3-v6si27465221pfe.42.2018.11.15.10.15.36; Thu, 15 Nov 2018 10:15:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=DG9FoSML; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S2388896AbeKPEY0 (ORCPT + 32 others); Thu, 15 Nov 2018 23:24:26 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:36323 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388454AbeKPEYZ (ORCPT ); Thu, 15 Nov 2018 23:24:25 -0500 Received: by mail-wm1-f65.google.com with SMTP id s11so9558928wmh.1 for ; Thu, 15 Nov 2018 10:15:32 -0800 (PST) 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=NJe/Lh0u4I1EWKwZUx0PaLmr2WjeZlvlzz6DRN2R6yI=; b=DG9FoSMLSELm3P7rhJYiwePwmjMLFaU5/G43rzF/FDkJJGO6vcpfoAU1QpY+o7a5RI 1CuWRYu+/t/tgI2nV7GiM+gQHLPbctcV0/+XubhvHxueDJKQe/Sww0vGcQhKS+E88h9b kIQx2YDvMgQz8CYVlozSzI/0F3ScqsJy6NPXQ= 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=NJe/Lh0u4I1EWKwZUx0PaLmr2WjeZlvlzz6DRN2R6yI=; b=nAO9mrddEcDTV8+vsx6FY91rI/hY5Y12qJe4J785pdVoivHs9a2i6by3xTh4dJgrRx lGVInlRpG+ISg2KwWS+EbnjXFZTriMzWnU3reehT0VBWXRzchTD4VqEt0SOc3nPudEYD D2PfG5T1vB0ajRQOu+xx8vdWCsZDFbn1Udj7lJ+B5PWuIkdhWzKN3jhBHajDWGbvFTd3 qLguk/WQl9QB536O/ni5oVwhLO4i/439uhed2IfZYsnKdSxbqQL2ZjdUZyyntmSY55mm ZK3dAnp6qyZA0j9dfGv7N0OAp1tfKHh8+MJG8geW8JGOINTltfnAqWhbyXd5r9h3ZBOn QwEA== X-Gm-Message-State: AGRZ1gKMCOcE/bZ9yOsuHDvOVAlrfW0Nw1483wHaEH0Y4Qg9jupqzV3c xrWx2ereBo2yxUb8Hm2FO/EAww== X-Received: by 2002:a1c:248b:: with SMTP id k133-v6mr5864308wmk.148.1542305731343; Thu, 15 Nov 2018 10:15:31 -0800 (PST) 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 r76-v6sm20934737wmb.21.2018.11.15.10.15.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Nov 2018 10:15:30 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, vkoul@kernel.org Cc: alsa-devel@alsa-project.org, robh+dt@kernel.org, linux-kernel@vger.kernel.org, bgoswami@codeaurora.org, rohitkr@codeaurora.org, lgirdwood@gmail.com, tiwai@suse.com, devicetree@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v3 2/5] ALSA: compress: make use of runtime buffer for copy Date: Thu, 15 Nov 2018 18:13:21 +0000 Message-Id: <20181115181324.26784-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181115181324.26784-1-srinivas.kandagatla@linaro.org> References: <20181115181324.26784-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Default copy function uses kmalloc to allocate buffers, lets check if the runtime buffers are setup before making this allocations. This can be useful if the buffers are dma buffers. Signed-off-by: Srinivas Kandagatla --- sound/core/compress_offload.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) -- 2.19.1 diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 26b5e245b074..a5b09e75e787 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -171,7 +171,8 @@ static int snd_compr_free(struct inode *inode, struct file *f) } data->stream.ops->free(&data->stream); - kfree(data->stream.runtime->buffer); + if (!data->stream.runtime->dma_buffer_p) + kfree(data->stream.runtime->buffer); kfree(data->stream.runtime); kfree(data); return 0; @@ -505,7 +506,7 @@ static int snd_compr_allocate_buffer(struct snd_compr_stream *stream, struct snd_compr_params *params) { unsigned int buffer_size; - void *buffer; + void *buffer = NULL; buffer_size = params->buffer.fragment_size * params->buffer.fragments; if (stream->ops->copy) { @@ -514,7 +515,18 @@ static int snd_compr_allocate_buffer(struct snd_compr_stream *stream, * the data from core */ } else { - buffer = kmalloc(buffer_size, GFP_KERNEL); + if (stream->runtime->dma_buffer_p) { + + if (buffer_size > stream->runtime->dma_buffer_p->bytes) + dev_err(&stream->device->dev, + "Not enough DMA buffer"); + else + buffer = stream->runtime->dma_buffer_p->area; + + } else { + buffer = kmalloc(buffer_size, GFP_KERNEL); + } + if (!buffer) return -ENOMEM; } From patchwork Thu Nov 15 18:13:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 151236 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7327883ljp; Thu, 15 Nov 2018 10:15:39 -0800 (PST) X-Google-Smtp-Source: AJdET5fOg+vFDD+VcIj6gSjUgNkSCX6OkdZmN1wMXb4hK+9feRpYnveb5edhuz2r/YZ2SPbevknn X-Received: by 2002:a63:e915:: with SMTP id i21mr6633147pgh.409.1542305739083; Thu, 15 Nov 2018 10:15:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542305739; cv=none; d=google.com; s=arc-20160816; b=msCWvY8Wymx7hcUWBBPQ3Oe0y3RV82ABqs/1BSX+jlD+1N/UvonMVvNNVd5lh3chPW Snm1Fwkot+bO3z0ba8z6bJWU8zY9F7P1y7vlJBegGEqHcBpG3L+Xa00tN3Hsuu66QPJp SW0zPKAILIeHHJCRDc+ls2CwnAFMYXxlCsmd1gzoTtk+lDJF9i53BEnDmdRzKYZNzYxe aeIVh7wVmCfGUPqVISDaTQfmgv/EV/FGvhhQqxOmcMqaz98wo1HzLnyHcGSj8Beo/VaP FpZYzwR9Ivsqh70YKWc1MG9h0aFWYgZNGJu2MVWrhZbXlw+i+0AJdBbSmbK7bG1SHrD9 jbMA== 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=LYRqNC3RC3C8D1z2RDljriVISNyoMdcAQwEZ0hOyVmY=; b=fZ//DTUu69tMsHWxJX4IDctTcZ4QxKMi9kHdpyeKTBE1BRP6LQkd0KOo79W7mLcpo5 Dh9RD0GsVy+TCArdzSUnNzUJFXTbzkpCjzWdZPDDsFTSFuwpvvykgPUIZKYElDlVw+Pm moTygxbaMaydo+gXHG1xOZUGn0ZWcyeaCupZOdfdNvQFjdyuNCSm3Sl6m/evpLIPf8xg IeSgtMlb1Ob/mUkCwgeUyO44r8EvxQOM+NkamhWuzZzezelAgPHjrHUPSJGOhcRo3EPT V7vb8lNznhqgv1Z98EP0bgTHg/2XtnvRwpcxJTGX1z3Twa4DaaagV64yUOKNmu3pOn/s fu7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UeW0A/Hu"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 z21-v6si27859476plo.89.2018.11.15.10.15.38; Thu, 15 Nov 2018 10:15:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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="UeW0A/Hu"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S2388939AbeKPEY2 (ORCPT + 32 others); Thu, 15 Nov 2018 23:24:28 -0500 Received: from mail-wm1-f49.google.com ([209.85.128.49]:53433 "EHLO mail-wm1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388454AbeKPEY1 (ORCPT ); Thu, 15 Nov 2018 23:24:27 -0500 Received: by mail-wm1-f49.google.com with SMTP id f10-v6so19686883wme.3 for ; Thu, 15 Nov 2018 10:15:34 -0800 (PST) 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=LYRqNC3RC3C8D1z2RDljriVISNyoMdcAQwEZ0hOyVmY=; b=UeW0A/Hu7pYM3VodQ6SXBsirVZqx7FUK4P8KuwDC4JKYS3sSCXNHwgju59z99rJZCv 6sqgrVsLwoBv7m+pLy/vBjdzLs9NF0SyaPGvck9kttMzVuvj7GptY113n585mtKiIiaw d8orl/3jP/+feMIrB9lS/JHuzH5uRe6S91Ye0= 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=LYRqNC3RC3C8D1z2RDljriVISNyoMdcAQwEZ0hOyVmY=; b=ug/rblpIfz1Ewy0rYq/YJfLvBMAslyqhOwpG1vzwvV0DRJTr99c7QoMvijNm74u2cJ Ub4YEZO8cdG3LyVL/stsWYbUMYGyMSKVxPv1KKhIAH4tl2iFjVfgMy/hCgdXaGHzYAsG +2ICOENUGlH8Nj5XLpln8HpS+MqqRbuZ9hwacZM9nCBLLQRIJzoQof6auDAw+aZah3ul sgjVZRzn4cI8d/aTc0KqkOZQebwiZzkQYQ3ikk+RGBJeR+LLXYh+SZtKdOHTAbknjEPC YZuJGbaVzb6HmmUNWMIebEDOrcFOOskHyckavisOG94ep/MfdUNEVOBqvW55Y6k1T6w2 E97Q== X-Gm-Message-State: AGRZ1gK/0lAJkTeKOXmSbBQpM2tajaWMGasROD1vSXKfTnhFKNFGALSA /bYwdVYVYh+HJiHxdDFDMtxJxw== X-Received: by 2002:a1c:d1cd:: with SMTP id i196mr5969547wmg.107.1542305734050; Thu, 15 Nov 2018 10:15:34 -0800 (PST) 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 r76-v6sm20934737wmb.21.2018.11.15.10.15.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Nov 2018 10:15:33 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, vkoul@kernel.org Cc: alsa-devel@alsa-project.org, robh+dt@kernel.org, linux-kernel@vger.kernel.org, bgoswami@codeaurora.org, rohitkr@codeaurora.org, lgirdwood@gmail.com, tiwai@suse.com, devicetree@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v3 4/5] ASoC: qdsp6: q6asm: add support to MP3 format Date: Thu, 15 Nov 2018 18:13:23 +0000 Message-Id: <20181115181324.26784-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181115181324.26784-1-srinivas.kandagatla@linaro.org> References: <20181115181324.26784-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds support to mp3 format in ASM module. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6asm.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.19.1 diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c index e1cfa846a1dc..4f85cb19a309 100644 --- a/sound/soc/qcom/qdsp6/q6asm.c +++ b/sound/soc/qcom/qdsp6/q6asm.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -36,6 +37,7 @@ #define ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 0x00010DA3 #define ASM_SESSION_CMD_RUN_V2 0x00010DAA #define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 0x00010DA5 +#define ASM_MEDIA_FMT_MP3 0x00010BE9 #define ASM_DATA_CMD_WRITE_V2 0x00010DAB #define ASM_DATA_CMD_READ_V2 0x00010DAC #define ASM_SESSION_CMD_SUSPEND 0x00010DEC @@ -868,6 +870,9 @@ int q6asm_open_write(struct audio_client *ac, uint32_t format, open->postprocopo_id = ASM_NULL_POPP_TOPOLOGY; switch (format) { + case SND_AUDIOCODEC_MP3: + open->dec_fmt_id = ASM_MEDIA_FMT_MP3; + break; case FORMAT_LINEAR_PCM: open->dec_fmt_id = ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2; break;