From patchwork Mon Jul 27 09:38:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 11686689 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E48A1722 for ; Mon, 27 Jul 2020 09:43:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 782572070B for ; Mon, 27 Jul 2020 09:43:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="BZGlOrrU"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UPva6lbH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 782572070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 09A8A16A0; Mon, 27 Jul 2020 11:42:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 09A8A16A0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1595842989; bh=YDBp0EnwWA4Kih/7O3bfccMPrnj7Rxbjm6CXwW9FWPU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BZGlOrrUX/Gk99e1Wly5HQGVhi740nGO6FmFXj6LTMXsknL8xfTBgQ8+Vt8ltP1iC qoXfHMm0EKmxvoLgLF0w2Jiv18V/AQPxRkaF7YKQqFgakbEq/fhx5bYsFGzUI8LBdQ A6q7zXoQoEkci4yHlJofxrwtntd2RAatRPk8GwPI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3465DF802F7; Mon, 27 Jul 2020 11:38:37 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1C64FF802DC; Mon, 27 Jul 2020 11:38:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E51E0F800DE for ; Mon, 27 Jul 2020 11:38:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E51E0F800DE Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UPva6lbH" Received: by mail-wr1-x443.google.com with SMTP id z18so10597165wrm.12 for ; Mon, 27 Jul 2020 02:38:21 -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=Oaaxr1XrWDeHaCTc5ZRFtudk1Q+YHJL7mwPY5QYLst4=; b=UPva6lbHnT6aJkApbjzdPclDHZuqy7Fdq/YKotY/LvbsW8sTVfwaiVi0Cly0mwUbvV hda1HFrFJQIZxeo6gR+A/JbyE5jTxkMQBt5M+RSl7XQ5qgTGjTuARTV47LarnuuF9z0i meKGo7QHKoIs9YT1CAQuL1fak1xUY5XbDpspq9OJwOOoYXGDmT0OYc3SYsqxBMio/mVQ w7u36cc0Wp01tHAWOGOL+WORHfcQmr2o1E3YAPPHFirKgd9qErfUmlaN7Ui5kMEiuIs3 QGk3fhi8BTquSsy2xjuU8pCRjE4FPm/NZiSPWOxC80vD0EFfUCWjoUoY/2qsE27XjkfZ aFNQ== 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=Oaaxr1XrWDeHaCTc5ZRFtudk1Q+YHJL7mwPY5QYLst4=; b=JN8kf0xAXG8DLgPESfRC9HlBfRAOYS8wx5cXx4x46WYp2hictSHfQ7QSAaLZBh0cng rvwVtTnlQjE1D8eV7Yr0GCPPzr0jezjWpVeyhmTBytjJF2ZwE/iGpYYvBIEg45KRxHSr jknXKvtkthuyh33qkYNVxC4ayRzrZCUkISmYA5/UaQgP4vyeX1jB6v1nXRK8NBgUtd7h uEmamrnnP5CA/vD2IZT94nLQ64FhvOwgG0tF1Pq0UavuhE+VKvH6wSRe24YIoQtMWxPb poqDgXvn97oOKYIRap9zXkAHOxLELxtcZV6Cnmy78eKQb3rpg4WxYLZiCMEsUetCo7P6 Jnlg== X-Gm-Message-State: AOAM532RUzzgawiaXkrci/aWaBtlfD/oup1ftvkfEl+fLyTboYY+stMY SbP/SxGWvtiMa9mwWZHuPMiJJA== X-Google-Smtp-Source: ABdhPJwYDrPNX+3ZAENAGl9buZdCJ8GBfodGVnw8Ziwk0v7h4XS004nimyMPlTK611g7EmJW5ZpZnw== X-Received: by 2002:a5d:43c4:: with SMTP id v4mr18194825wrr.426.1595842701525; Mon, 27 Jul 2020 02:38:21 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id y189sm20566099wmd.27.2020.07.27.02.38.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 02:38:20 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Subject: [PATCH v3 06/10] ASoC: q6asm: add support to gapless flag in q6asm open Date: Mon, 27 Jul 2020 10:38:02 +0100 Message-Id: <20200727093806.17089-7-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200727093806.17089-1-srinivas.kandagatla@linaro.org> References: <20200727093806.17089-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Cc: pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org, ckeepax@opensource.cirrus.com, tiwai@suse.com, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, vkoul@kernel.org, Srinivas Kandagatla X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This patch adds support to gapless flag to q6asm_open_write(). Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6asm-dai.c | 4 ++-- sound/soc/qcom/qdsp6/q6asm.c | 4 +++- sound/soc/qcom/qdsp6/q6asm.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c index 5f0e36e23ef3..4652c78d57c5 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -258,7 +258,7 @@ static int q6asm_dai_prepare(struct snd_soc_component *component, if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { ret = q6asm_open_write(prtd->audio_client, prtd->stream_id, FORMAT_LINEAR_PCM, - 0, prtd->bits_per_sample); + 0, prtd->bits_per_sample, false); } else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { ret = q6asm_open_read(prtd->audio_client, prtd->stream_id, FORMAT_LINEAR_PCM, @@ -685,7 +685,7 @@ static int q6asm_dai_compr_set_params(struct snd_soc_component *component, if (dir == SND_COMPRESS_PLAYBACK) { ret = q6asm_open_write(prtd->audio_client, prtd->stream_id, params->codec.id, params->codec.profile, - prtd->bits_per_sample); + prtd->bits_per_sample, true); if (ret < 0) { dev_err(dev, "q6asm_open_write failed\n"); diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c index 14ec7dad5b65..22ac99029e56 100644 --- a/sound/soc/qcom/qdsp6/q6asm.c +++ b/sound/soc/qcom/qdsp6/q6asm.c @@ -923,7 +923,7 @@ static int q6asm_ac_send_cmd_sync(struct audio_client *ac, struct apr_pkt *pkt) */ int q6asm_open_write(struct audio_client *ac, uint32_t stream_id, uint32_t format, u32 codec_profile, - uint16_t bits_per_sample) + uint16_t bits_per_sample, bool is_gapless) { struct asm_stream_cmd_open_write_v3 *open; struct apr_pkt *pkt; @@ -943,6 +943,8 @@ int q6asm_open_write(struct audio_client *ac, uint32_t stream_id, pkt->hdr.opcode = ASM_STREAM_CMD_OPEN_WRITE_V3; open->mode_flags = 0x00; open->mode_flags |= ASM_LEGACY_STREAM_SESSION; + if (is_gapless) + open->mode_flags |= BIT(ASM_SHIFT_GAPLESS_MODE_FLAG); /* source endpoint : matrix */ open->sink_endpointype = ASM_END_POINT_DEVICE_MATRIX; diff --git a/sound/soc/qcom/qdsp6/q6asm.h b/sound/soc/qcom/qdsp6/q6asm.h index 2acfc2274069..f20e1441988f 100644 --- a/sound/soc/qcom/qdsp6/q6asm.h +++ b/sound/soc/qcom/qdsp6/q6asm.h @@ -99,7 +99,7 @@ int q6asm_write_async(struct audio_client *ac, uint32_t stream_id, uint32_t len, uint32_t msw_ts, uint32_t lsw_ts, uint32_t flags); int q6asm_open_write(struct audio_client *ac, uint32_t stream_id, uint32_t format, u32 codec_profile, - uint16_t bits_per_sample); + uint16_t bits_per_sample, bool is_gapless); int q6asm_open_read(struct audio_client *ac, uint32_t stream_id, uint32_t format, uint16_t bits_per_sample);