From patchwork Fri Nov 8 09:46:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11234477 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 958E014E5 for ; Fri, 8 Nov 2019 09:54:01 +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 26A0221D7B for ; Fri, 8 Nov 2019 09:54:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="YX40/QRP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26A0221D7B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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 3D5301691; Fri, 8 Nov 2019 10:53:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3D5301691 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1573206839; bh=4HtBibI6+vKbwrcZMMKFf0wLslc7LHAMxa8OM9b/tOc=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YX40/QRP9k+bbUTGcmDs3d19iJwQ4fo9tmyLvci4KzBYUtejc4GKE0kRb5Gi78iZG piKVALKT+q/GjCbtjMWXA84zyegmlZskvLVhVTZuSLyVFEnvzVOrel1wVkvb1Q/aIe Rm4K5G/1HzwRswh2EvjK6mLvD1fBlBCfGeq0+/7Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2A469F8063B; Fri, 8 Nov 2019 10:49:07 +0100 (CET) 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 F200FF80321; Fri, 8 Nov 2019 10:48:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, SURBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 41785F803F4 for ; Fri, 8 Nov 2019 10:46:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 41785F803F4 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 99428AE8A; Fri, 8 Nov 2019 09:46:51 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 8 Nov 2019 10:46:34 +0100 Message-Id: <20191108094641.20086-2-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191108094641.20086-1-tiwai@suse.de> References: <20191108094641.20086-1-tiwai@suse.de> Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Mark Brown , Curtis Malainey , Bard Liao Subject: [alsa-devel] [PATCH 1/8] ASoC: Remove superfluous snd_dma_continuous_data() 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The recent change (commit 08422d2c559d: "ALSA: memalloc: Allow NULL device for SNDRV_DMA_TYPE_CONTINOUS type") made the PCM preallocation helper accepting NULL as the device pointer for the default usage. Drop the snd_dma_continuous_data() usage that became superfluous from the callers. Signed-off-by: Takashi Iwai --- sound/soc/au1x/dma.c | 2 +- sound/soc/dwc/dwc-pcm.c | 2 +- sound/soc/sh/dma-sh7760.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/au1x/dma.c b/sound/soc/au1x/dma.c index 49556eb409cd..054dfda89d3e 100644 --- a/sound/soc/au1x/dma.c +++ b/sound/soc/au1x/dma.c @@ -293,7 +293,7 @@ static int alchemy_pcm_new(struct snd_soc_component *component, struct snd_pcm *pcm = rtd->pcm; snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS, - snd_dma_continuous_data(GFP_KERNEL), 65536, (4096 * 1024) - 1); + NULL, 65536, (4096 * 1024) - 1); return 0; } diff --git a/sound/soc/dwc/dwc-pcm.c b/sound/soc/dwc/dwc-pcm.c index de6fcc808832..4771eb5fbe2a 100644 --- a/sound/soc/dwc/dwc-pcm.c +++ b/sound/soc/dwc/dwc-pcm.c @@ -258,7 +258,7 @@ static int dw_pcm_new(struct snd_soc_component *component, snd_pcm_lib_preallocate_pages_for_all(rtd->pcm, SNDRV_DMA_TYPE_CONTINUOUS, - snd_dma_continuous_data(GFP_KERNEL), size, size); + NULL, size, size); return 0; } diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c index 93bb80d089be..2b0eca02a8b9 100644 --- a/sound/soc/sh/dma-sh7760.c +++ b/sound/soc/sh/dma-sh7760.c @@ -309,7 +309,7 @@ static int camelot_pcm_new(struct snd_soc_component *component, */ snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS, - snd_dma_continuous_data(GFP_KERNEL), + NULL, DMABRG_PREALLOC_BUFFER, DMABRG_PREALLOC_BUFFER_MAX); return 0; From patchwork Fri Nov 8 09:46:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11234463 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 71D4E13BD for ; Fri, 8 Nov 2019 09:49:44 +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 79025214DA for ; Fri, 8 Nov 2019 09:49:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="VjY6TSP8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 79025214DA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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 3FCC511C; Fri, 8 Nov 2019 10:48:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3FCC511C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1573206581; bh=ZHcqq8wJ4PmdLXmkAoFjJYphkE9zdTvKqHXtDckzRx4=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VjY6TSP8TRVbhfKbr2cQGClzy6dhNuvodK1GF3SptKYJES9sYxY8mcZI+P9v7Yvhy JUPVs0UDbRlfx+SMYv5J1Q41M7+vZx6TxKb0VKfRaBmQwz20z2ySrgbAZmg0IyQEce DcPQc9HlzivNOCNDqpsEmMproOkXoGcCPxv5cKHY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B05C1F80321; Fri, 8 Nov 2019 10:48:50 +0100 (CET) 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 25B21F800F3; Fri, 8 Nov 2019 10:48:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, SURBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DA6DCF80321 for ; Fri, 8 Nov 2019 10:46:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DA6DCF80321 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B4541AEC4; Fri, 8 Nov 2019 09:46:51 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 8 Nov 2019 10:46:35 +0100 Message-Id: <20191108094641.20086-3-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191108094641.20086-1-tiwai@suse.de> References: <20191108094641.20086-1-tiwai@suse.de> Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Mark Brown , Curtis Malainey , Bard Liao Subject: [alsa-devel] [PATCH 2/8] ASoC: rt5514-spi: Convert to the common vmalloc memalloc 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The recent change (*) in the ALSA memalloc core allows us to drop the special vmalloc-specific allocation and page handling. This patch coverts to the common code. (*) 1fe7f397cfe2: ALSA: memalloc: Add vmalloc buffer allocation support 7e8edae39fd1: ALSA: pcm: Handle special page mapping in the default mmap handler Since it requires the specific buffer type (SNDRV_DMA_TYPE_VMALLOC), it's set in the pcm_new ops now. Signed-off-by: Takashi Iwai --- sound/soc/codecs/rt5514-spi.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c index 57ff5aee452d..f1b7b947ecbd 100644 --- a/sound/soc/codecs/rt5514-spi.c +++ b/sound/soc/codecs/rt5514-spi.c @@ -219,8 +219,7 @@ static int rt5514_spi_hw_params(struct snd_soc_component *component, u8 buf[8]; mutex_lock(&rt5514_dsp->dma_lock); - ret = snd_pcm_lib_alloc_vmalloc_buffer(substream, - params_buffer_bytes(hw_params)); + ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); rt5514_dsp->substream = substream; rt5514_dsp->dma_offset = 0; @@ -246,7 +245,7 @@ static int rt5514_spi_hw_free(struct snd_soc_component *component, cancel_delayed_work_sync(&rt5514_dsp->copy_work); - return snd_pcm_lib_free_vmalloc_buffer(substream); + return snd_pcm_lib_free_pages(substream); } static snd_pcm_uframes_t rt5514_spi_pcm_pointer( @@ -260,12 +259,6 @@ static snd_pcm_uframes_t rt5514_spi_pcm_pointer( return bytes_to_frames(runtime, rt5514_dsp->dma_offset); } -static struct page *rt5514_spi_pcm_page(struct snd_soc_component *component, - struct snd_pcm_substream *substream, - unsigned long offset) -{ - return snd_pcm_lib_get_vmalloc_page(substream, offset); -} static int rt5514_spi_pcm_probe(struct snd_soc_component *component) { @@ -298,6 +291,14 @@ static int rt5514_spi_pcm_probe(struct snd_soc_component *component) return 0; } +static int rt5514_spi_pcm_new(struct snd_soc_component *component, + struct snd_soc_pcm_runtime *rtd) +{ + snd_pcm_lib_preallocate_pages_for_all(rtd->pcm, SNDRV_DMA_TYPE_VMALLOC, + NULL, 0, 0); + return 0; +} + static const struct snd_soc_component_driver rt5514_spi_component = { .name = DRV_NAME, .probe = rt5514_spi_pcm_probe, @@ -305,7 +306,7 @@ static const struct snd_soc_component_driver rt5514_spi_component = { .hw_params = rt5514_spi_hw_params, .hw_free = rt5514_spi_hw_free, .pointer = rt5514_spi_pcm_pointer, - .page = rt5514_spi_pcm_page, + .pcm_construct = rt5514_spi_pcm_new, }; /** From patchwork Fri Nov 8 09:46:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11234469 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 1787514E5 for ; Fri, 8 Nov 2019 09:52:14 +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 9E4CB21D7E for ; Fri, 8 Nov 2019 09:52:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="WPpVcR21" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E4CB21D7E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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 D62A4167F; Fri, 8 Nov 2019 10:51:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D62A4167F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1573206731; bh=hI7IPFvH43H4+grGmbAgN+uQJtrhpeGrEpfrnIjUvXk=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WPpVcR21kg49AX+q8Dwww7tI++aTLDKh/YTuBczgcGD2/YpxsaQOvs8JS24DvSLPF g4LIhPHUPMvppLs1U3xwfiWGAaCd+mQHVU57BO9lV3Rijekpl77BTjo4K1JQqwb08C Iv8RYtQKvicsW+2x7OU+FixdURKy3wIfCm/nZ9aU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4AEADF8060D; Fri, 8 Nov 2019 10:49:02 +0100 (CET) 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 7D819F8045F; Fri, 8 Nov 2019 10:48:16 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 17F71F803D0 for ; Fri, 8 Nov 2019 10:46:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 17F71F803D0 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C53C8B03E; Fri, 8 Nov 2019 09:46:51 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 8 Nov 2019 10:46:36 +0100 Message-Id: <20191108094641.20086-4-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191108094641.20086-1-tiwai@suse.de> References: <20191108094641.20086-1-tiwai@suse.de> Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Mark Brown , Curtis Malainey , Bard Liao Subject: [alsa-devel] [PATCH 3/8] ASoC: intel: Drop superfluous snd_pcm_sgbuf_ops_page 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" snd_pcm_sgbuf_ops_page is no longer needed to be set explicitly to PCM page ops since the recent change in the PCM core (*). Leaving it NULL should work as long as the preallocation has been done properly. This patch drops the redundant lines. (*) 7e8edae39fd1: ALSA: pcm: Handle special page mapping in the default mmap handler Signed-off-by: Takashi Iwai --- sound/soc/intel/haswell/sst-haswell-pcm.c | 12 ------------ sound/soc/intel/skylake/skl-pcm.c | 12 ------------ 2 files changed, 24 deletions(-) diff --git a/sound/soc/intel/haswell/sst-haswell-pcm.c b/sound/soc/intel/haswell/sst-haswell-pcm.c index 6e498a581d20..a3a5bba2fbd9 100644 --- a/sound/soc/intel/haswell/sst-haswell-pcm.c +++ b/sound/soc/intel/haswell/sst-haswell-pcm.c @@ -796,17 +796,6 @@ static snd_pcm_uframes_t hsw_pcm_pointer(struct snd_soc_component *component, return offset; } -#ifdef CONFIG_SND_DMA_SGBUF -static struct page *hsw_pcm_page(struct snd_soc_component *component, - struct snd_pcm_substream *substream, - unsigned long offset) -{ - return snd_pcm_sgbuf_ops_page(substream, offset); -} -#else -#define hsw_pcm_page NULL -#endif /* CONFIG_SND_DMA_SGBUF */ - static int hsw_pcm_open(struct snd_soc_component *component, struct snd_pcm_substream *substream) { @@ -1128,7 +1117,6 @@ static const struct snd_soc_component_driver hsw_dai_component = { .hw_free = hsw_pcm_hw_free, .trigger = hsw_pcm_trigger, .pointer = hsw_pcm_pointer, - .page = hsw_pcm_page, .ioctl = snd_soc_pcm_lib_ioctl, .pcm_construct = hsw_pcm_new, .controls = hsw_volume_controls, diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index 0850141c7d47..6bd14f65fe71 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -1235,17 +1235,6 @@ static int skl_platform_soc_mmap(struct snd_soc_component *component, return snd_pcm_lib_default_mmap(substream, area); } -#ifdef CONFIG_SND_DMA_SGBUF -static struct page *skl_platform_soc_page(struct snd_soc_component *component, - struct snd_pcm_substream *substream, - unsigned long offset) -{ - return snd_pcm_sgbuf_ops_page(substream, offset); -} -#else -#define skl_platform_soc_page NULL -#endif /* CONFIG_SND_DMA_SGBUF */ - static u64 skl_adjust_codec_delay(struct snd_pcm_substream *substream, u64 nsec) { @@ -1493,7 +1482,6 @@ static const struct snd_soc_component_driver skl_component = { .pointer = skl_platform_soc_pointer, .get_time_info = skl_platform_soc_get_time_info, .mmap = skl_platform_soc_mmap, - .page = skl_platform_soc_page, .pcm_construct = skl_platform_soc_new, .pcm_destruct = skl_platform_soc_free, .module_get_upon_open = 1, /* increment refcount when a pcm is opened */ From patchwork Fri Nov 8 09:46:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11234467 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 17E1813BD for ; Fri, 8 Nov 2019 09:51:28 +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 9DE6121D7B for ; Fri, 8 Nov 2019 09:51:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="kds4MWsu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DE6121D7B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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 97919168D; Fri, 8 Nov 2019 10:50:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 97919168D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1573206685; bh=Iq1Zr4f2XBUuxcZv7OYse/+RuZkLvj/39xWLnBGARak=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kds4MWsucP+uo9rriY/Z9uXpT6QoBLsHfyGOaOcX5QO2QbZoQwnuxShaLCPNBuXAa qgxYP9awB6AnWYfSR0/DgI42EfF9a7SdVxsBFOLq5k10j9exLZIkEKZFQhXhvwWIF4 kKxDEmhoBNh9C91DBvta+dzaalq2saHVpOhuozfY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 962E5F805A1; Fri, 8 Nov 2019 10:49:00 +0100 (CET) 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 61548F805FB; Fri, 8 Nov 2019 10:48:16 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, SURBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 465A7F8045F for ; Fri, 8 Nov 2019 10:46:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 465A7F8045F X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D004BB0BF; Fri, 8 Nov 2019 09:46:51 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 8 Nov 2019 10:46:37 +0100 Message-Id: <20191108094641.20086-5-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191108094641.20086-1-tiwai@suse.de> References: <20191108094641.20086-1-tiwai@suse.de> Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Mark Brown , Curtis Malainey , Bard Liao Subject: [alsa-devel] [PATCH 4/8] ASoC: intel: Avoid non-standard macro usage 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Pass the device pointer from the PCI pointer directly, instead of a non-standard macro. The macro didn't give any better readability. Signed-off-by: Takashi Iwai --- sound/soc/intel/skylake/skl-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index 6bd14f65fe71..8b9abb79a69e 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -1314,7 +1314,7 @@ static int skl_platform_soc_new(struct snd_soc_component *component, size = MAX_PREALLOC_SIZE; snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, - snd_dma_pci_data(skl->pci), + &skl->pci->dev, size, MAX_PREALLOC_SIZE); } From patchwork Fri Nov 8 09:46:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11234471 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 006F313BD for ; Fri, 8 Nov 2019 09:52:45 +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 8738B21D7E for ; Fri, 8 Nov 2019 09:52:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="IZI/Z1lR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8738B21D7E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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 9C823166A; Fri, 8 Nov 2019 10:51:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9C823166A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1573206762; bh=2yNNRgDwAT20ua6gjmGyXJwVP83kl/CmMPV4zUU+14g=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IZI/Z1lRIkYtqWoM8VphojzQcmfnl/tdYGKBrFfrdGoYpXkZrVJN8XhYW6XObwLqp BrLne0agXCmldQ+a9jevX0wTak0nkUhAFj3z7doGBNFpTCXcqQTkOzEyPLzRS10X9B QaUyU3MuZA9b2gGV733eVoMlWvWw6/3d2qWvr8Fk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5FF95F80634; Fri, 8 Nov 2019 10:49:04 +0100 (CET) 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 A1F4DF803D0; Fri, 8 Nov 2019 10:48:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, SURBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6CAE5F8048D for ; Fri, 8 Nov 2019 10:46:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6CAE5F8048D X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D93B3AD77; Fri, 8 Nov 2019 09:46:51 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 8 Nov 2019 10:46:38 +0100 Message-Id: <20191108094641.20086-6-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191108094641.20086-1-tiwai@suse.de> References: <20191108094641.20086-1-tiwai@suse.de> Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Mark Brown , Curtis Malainey , Bard Liao Subject: [alsa-devel] [PATCH 5/8] ASoC: SOF: Drop superfluous snd_pcm_sgbuf_ops_page 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" snd_pcm_sgbuf_ops_page is no longer needed to be set explicitly to PCM page ops since the recent change in the PCM core (*). Leaving it NULL should work as long as the preallocation has been done properly. This patch drops the redundant lines. (*) 7e8edae39fd1: ALSA: pcm: Handle special page mapping in the default mmap handler Signed-off-by: Takashi Iwai --- sound/soc/sof/pcm.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c index 3d5cd1b445ba..549238a98b2a 100644 --- a/sound/soc/sof/pcm.c +++ b/sound/soc/sof/pcm.c @@ -454,17 +454,6 @@ static snd_pcm_uframes_t sof_pcm_pointer(struct snd_soc_component *component, return host; } -#ifdef CONFIG_SND_DMA_SGBUF -static struct page *sof_pcm_page(struct snd_soc_component *component, - struct snd_pcm_substream *substream, - unsigned long offset) -{ - return snd_pcm_sgbuf_ops_page(substream, offset); -} -#else -#define sof_pcm_page NULL -#endif /* CONFIG_SND_DMA_SGBUF */ - static int sof_pcm_open(struct snd_soc_component *component, struct snd_pcm_substream *substream) { @@ -788,7 +777,6 @@ void snd_sof_new_platform_drv(struct snd_sof_dev *sdev) pd->hw_free = sof_pcm_hw_free; pd->trigger = sof_pcm_trigger; pd->pointer = sof_pcm_pointer; - pd->page = sof_pcm_page; #if IS_ENABLED(CONFIG_SND_SOC_SOF_COMPRESS) pd->compr_ops = &sof_compressed_ops; From patchwork Fri Nov 8 09:46:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11234473 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 D669F13BD for ; Fri, 8 Nov 2019 09:53:15 +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 681B921D7E for ; Fri, 8 Nov 2019 09:53:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="DdD+xAWY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 681B921D7E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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 39F051678; Fri, 8 Nov 2019 10:52:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 39F051678 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1573206793; bh=A6hXHRbeJyDOIBkaCtur28IfqOIVzCXRNmT8cmHdUWM=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=DdD+xAWYDQ/57tdrBJ0x5SvHd+nDXMQs/vHqtfam+TMUEu3V1jjQ7Da+AAcE5VJ48 oP06L4K1QYgkGzwlNUEtxe3mUE0AEPRL3co9UrBApu8i4pM6hzMiHst+RxLhKJ1WYs BHcza726BwSW2VwNlvJTEFgtp7u2X5ghzOir53GM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 61691F80639; Fri, 8 Nov 2019 10:49:06 +0100 (CET) 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 DB382F8045F; Fri, 8 Nov 2019 10:48:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, SURBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DC84FF805A1 for ; Fri, 8 Nov 2019 10:46:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DC84FF805A1 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E741FB129; Fri, 8 Nov 2019 09:46:51 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 8 Nov 2019 10:46:39 +0100 Message-Id: <20191108094641.20086-7-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191108094641.20086-1-tiwai@suse.de> References: <20191108094641.20086-1-tiwai@suse.de> Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Mark Brown , Curtis Malainey , Bard Liao Subject: [alsa-devel] [PATCH 6/8] ASoC: rt5677-spi: Convert to the common vmalloc memalloc 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The recent change (*) in the ALSA memalloc core allows us to drop the special vmalloc-specific allocation and page handling. This patch coverts to the common code. (*) 1fe7f397cfe2: ALSA: memalloc: Add vmalloc buffer allocation support 7e8edae39fd1: ALSA: pcm: Handle special page mapping in the default mmap handler Signed-off-by: Takashi Iwai Acked-by: Curtis Malainey --- sound/soc/codecs/rt5677-spi.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sound/soc/codecs/rt5677-spi.c b/sound/soc/codecs/rt5677-spi.c index 3aa3ea7c2768..0c90f99b693f 100644 --- a/sound/soc/codecs/rt5677-spi.c +++ b/sound/soc/codecs/rt5677-spi.c @@ -128,8 +128,7 @@ static int rt5677_spi_hw_params( int ret; mutex_lock(&rt5677_dsp->dma_lock); - ret = snd_pcm_lib_alloc_vmalloc_buffer(substream, - params_buffer_bytes(hw_params)); + ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); rt5677_dsp->substream = substream; mutex_unlock(&rt5677_dsp->dma_lock); @@ -147,7 +146,7 @@ static int rt5677_spi_hw_free( rt5677_dsp->substream = NULL; mutex_unlock(&rt5677_dsp->dma_lock); - return snd_pcm_lib_free_vmalloc_buffer(substream); + return snd_pcm_lib_free_pages(substream); } static int rt5677_spi_prepare( @@ -361,12 +360,12 @@ static void rt5677_spi_copy_work(struct work_struct *work) mutex_unlock(&rt5677_dsp->dma_lock); } -static struct page *rt5677_spi_pcm_page( - struct snd_soc_component *component, - struct snd_pcm_substream *substream, - unsigned long offset) +static int rt5677_spi_pcm_new(struct snd_soc_component *component, + struct snd_soc_pcm_runtime *rtd) { - return snd_pcm_lib_get_vmalloc_page(substream, offset); + snd_pcm_lib_preallocate_pages_for_all(rtd->pcm, SNDRV_DMA_TYPE_VMALLOC, + NULL, 0, 0); + return 0; } static int rt5677_spi_pcm_probe(struct snd_soc_component *component) @@ -394,7 +393,7 @@ static const struct snd_soc_component_driver rt5677_spi_dai_component = { .hw_free = rt5677_spi_hw_free, .prepare = rt5677_spi_prepare, .pointer = rt5677_spi_pcm_pointer, - .page = rt5677_spi_pcm_page, + .pcm_construct = rt5677_spi_pcm_new, }; /* Select a suitable transfer command for the next transfer to ensure From patchwork Fri Nov 8 09:46:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11234481 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 7E10613BD for ; Fri, 8 Nov 2019 09:55:25 +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 0F7C421D7E for ; Fri, 8 Nov 2019 09:55:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="IqFcnCCk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F7C421D7E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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 2D1111666; Fri, 8 Nov 2019 10:54:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2D1111666 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1573206923; bh=gJSlCNIY36BrQalqGw3w12TV4rtn6SyvIdmUtD82xko=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IqFcnCCkf2qh/4zt6PULQAjyLvqZ3bg/z8eO5yNkWwP7Y2bCzVArwdDP1HFWk4nFV MUiioWP8B4BCQijbbctao3LJvtr1Tll+2AeO9qgAzyTotjrFC9GUPqmXyisdWN2qY8 vRSOdc4ldOp1qFK6iioqbtECrfeUJveK6r3QPUKA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2183BF8065D; Fri, 8 Nov 2019 10:49:09 +0100 (CET) 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 69FBBF803D0; Fri, 8 Nov 2019 10:48:19 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E147EF805DF for ; Fri, 8 Nov 2019 10:46:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E147EF805DF X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id F16CDB14F; Fri, 8 Nov 2019 09:46:51 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 8 Nov 2019 10:46:40 +0100 Message-Id: <20191108094641.20086-8-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191108094641.20086-1-tiwai@suse.de> References: <20191108094641.20086-1-tiwai@suse.de> Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Mark Brown , Curtis Malainey , Bard Liao Subject: [alsa-devel] [PATCH 7/8] ASoC: cros_ec_codec: Convert to the common vmalloc memalloc 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The recent change (*) in the ALSA memalloc core allows us to drop the special vmalloc-specific allocation and page handling. This patch coverts to the common code. (*) 1fe7f397cfe2: ALSA: memalloc: Add vmalloc buffer allocation support 7e8edae39fd1: ALSA: pcm: Handle special page mapping in the default mmap handler Signed-off-by: Takashi Iwai --- sound/soc/codecs/cros_ec_codec.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/cros_ec_codec.c b/sound/soc/codecs/cros_ec_codec.c index dd14caf9091a..7b17f39a6a10 100644 --- a/sound/soc/codecs/cros_ec_codec.c +++ b/sound/soc/codecs/cros_ec_codec.c @@ -918,8 +918,7 @@ static int wov_pcm_hw_params(struct snd_soc_component *component, priv->wov_burst_read = true; mutex_unlock(&priv->wov_dma_lock); - return snd_pcm_lib_alloc_vmalloc_buffer(substream, - params_buffer_bytes(hw_params)); + return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); } static int wov_pcm_hw_free(struct snd_soc_component *component, @@ -935,7 +934,7 @@ static int wov_pcm_hw_free(struct snd_soc_component *component, cancel_delayed_work_sync(&priv->wov_copy_work); - return snd_pcm_lib_free_vmalloc_buffer(substream); + return snd_pcm_lib_free_pages(substream); } static snd_pcm_uframes_t wov_pcm_pointer(struct snd_soc_component *component, @@ -948,11 +947,12 @@ static snd_pcm_uframes_t wov_pcm_pointer(struct snd_soc_component *component, return bytes_to_frames(runtime, priv->wov_dma_offset); } -static struct page *wov_pcm_page(struct snd_soc_component *component, - struct snd_pcm_substream *substream, - unsigned long offset) +static int wov_pcm_new(struct snd_soc_component *component, + struct snd_soc_pcm_runtime *rtd) { - return snd_pcm_lib_get_vmalloc_page(substream, offset); + snd_pcm_lib_preallocate_pages_for_all(rtd->pcm, SNDRV_DMA_TYPE_VMALLOC, + NULL, 0, 0); + return 0; } static const struct snd_soc_component_driver wov_component_driver = { @@ -964,7 +964,7 @@ static const struct snd_soc_component_driver wov_component_driver = { .hw_params = wov_pcm_hw_params, .hw_free = wov_pcm_hw_free, .pointer = wov_pcm_pointer, - .page = wov_pcm_page, + .pcm_construct = wov_pcm_new, }; static int cros_ec_codec_platform_probe(struct platform_device *pdev) From patchwork Fri Nov 8 09:46:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11234479 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 513D013BD for ; Fri, 8 Nov 2019 09:54:47 +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 D6BC421D7B for ; Fri, 8 Nov 2019 09:54:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="UaFQg6Gt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6BC421D7B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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 0AF56168F; Fri, 8 Nov 2019 10:53:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0AF56168F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1573206885; bh=ZJUOzNDHf4cY6iCEFFtCEy8xzbTgviRCNgqenBRAXY8=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UaFQg6Gt+xUjeOzJF83rHLUMSqzsP34y6p/1n/aOJS8s423vNP6fjDWtA4fd+nSne RA7vXchl6+pCTemjcN40NXFNEYPYySEB2oPy1WbhGYhQFltOdADt7Lgh6cAYUPFr/d Diw+JOBvoerYmHsoY0EQK64KR1KC/gElwE3WTySk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 124F8F80649; Fri, 8 Nov 2019 10:49:08 +0100 (CET) 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 43340F803F4; Fri, 8 Nov 2019 10:48:19 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, SURBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BC230F804CF for ; Fri, 8 Nov 2019 10:46:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BC230F804CF X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0DAE9B152; Fri, 8 Nov 2019 09:46:52 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 8 Nov 2019 10:46:41 +0100 Message-Id: <20191108094641.20086-9-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191108094641.20086-1-tiwai@suse.de> References: <20191108094641.20086-1-tiwai@suse.de> Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Mark Brown , Curtis Malainey , Bard Liao Subject: [alsa-devel] [PATCH 8/8] ALSA: pcm: Unexport snd_pcm_sgbuf_ops_page 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The helper is no longer referred after the recent code refactoring. Drop the export for saving some bits and future misuse. Signed-off-by: Takashi Iwai --- include/sound/pcm.h | 8 -------- sound/core/pcm_local.h | 5 +++++ sound/core/pcm_memory.c | 3 +-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/include/sound/pcm.h b/include/sound/pcm.h index bbe6eb1ff5d2..2c0aa884f5f1 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -1236,14 +1236,6 @@ static inline int snd_pcm_lib_alloc_vmalloc_32_buffer */ #define snd_pcm_substream_sgbuf(substream) \ snd_pcm_get_dma_buf(substream)->private_data - -struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, - unsigned long offset); -#else /* !SND_DMA_SGBUF */ -/* - * fake using a continuous buffer - */ -#define snd_pcm_sgbuf_ops_page NULL #endif /* SND_DMA_SGBUF */ /** diff --git a/sound/core/pcm_local.h b/sound/core/pcm_local.h index 1161ab2d6a5b..5565e1c4196a 100644 --- a/sound/core/pcm_local.h +++ b/sound/core/pcm_local.h @@ -67,4 +67,9 @@ static inline void snd_pcm_timer_done(struct snd_pcm_substream *substream) {} void __snd_pcm_xrun(struct snd_pcm_substream *substream); void snd_pcm_group_init(struct snd_pcm_group *group); +#ifdef CONFIG_SND_DMA_SGBUF +struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, + unsigned long offset); +#endif + #endif /* __SOUND_CORE_PCM_LOCAL_H */ diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c index 17ee361ce791..286f333f8e4c 100644 --- a/sound/core/pcm_memory.c +++ b/sound/core/pcm_memory.c @@ -255,7 +255,7 @@ void snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm, EXPORT_SYMBOL(snd_pcm_lib_preallocate_pages_for_all); #ifdef CONFIG_SND_DMA_SGBUF -/** +/* * snd_pcm_sgbuf_ops_page - get the page struct at the given offset * @substream: the pcm substream instance * @offset: the buffer offset @@ -273,7 +273,6 @@ struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigne return NULL; return sgbuf->page_table[idx]; } -EXPORT_SYMBOL(snd_pcm_sgbuf_ops_page); #endif /* CONFIG_SND_DMA_SGBUF */ /**