From patchwork Thu Apr 21 12:54:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 12821595 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 84EA0C433EF for ; Thu, 21 Apr 2022 12:55:25 +0000 (UTC) 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 3083F18F9; Thu, 21 Apr 2022 14:54:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3083F18F9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1650545723; bh=pgtX4YON8Zrq5OpIcU6N0ns6NSZEzAs8X3R7e2dHKOA=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=ayk19xFNV5n7Vud3l8DpwBNePAC1VDJ5vxY9raonawRKCfJfA1+sE/5n/d923YAA1 oVXNJCe8X0cpTOaDE4VT8GXzlCkAqgxsIh33hD0iTTh5w4CESRqHvMpxsc2MLhEJHH u7eir02LXkkt2wI1W0i+7fCBab7vTve9wkOEnB1o= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B247BF80279; Thu, 21 Apr 2022 14:54:32 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B0348F800F4; Thu, 21 Apr 2022 14:54:30 +0200 (CEST) Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EF23AF800F4 for ; Thu, 21 Apr 2022 14:54:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EF23AF800F4 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="VYj7LyJb" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1650545665; x=1682081665; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=pgtX4YON8Zrq5OpIcU6N0ns6NSZEzAs8X3R7e2dHKOA=; b=VYj7LyJbyO9p4Juectf10j8fqddO07SIYvP77I15SGFez84iE/5Siz3l NTpV+IJBKAzx59kb9tsEw74U1l596knVq6WhrzY8YkLPzV92YE0mifaZe fEO4DuCxHKxd3pSSMZexteZrtKlciPtzJHxyaGljEHW3sBwpImbj0gc0r r4cRcs19jS00Xr3QSk1Oeh/6a+D4mVlUHoD40AXSdYiHF9XAPU36lB33N lFn4u8SWM87qh5eMUH+eQLzBWLGyD0kh0FVA274MAEG/eZCCVPcXNgn7L Q+Lz1ZRfgtEiInrKhb0eBext1lODOMjULEtuKuQ3JMgSGoDt3XHO/dACh Q==; X-IronPort-AV: E=Sophos;i="5.90,278,1643698800"; d="scan'208";a="161255136" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Apr 2022 05:54:21 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Thu, 21 Apr 2022 05:54:20 -0700 Received: from rob-ult-m19940.amer.actel.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Thu, 21 Apr 2022 05:54:17 -0700 From: Codrin Ciubotariu To: , , Subject: [PATCH 1/2] Revert "ASoC: dmaengine: do not use a NULL prepare_slave_config() callback" Date: Thu, 21 Apr 2022 15:54:02 +0300 Message-ID: <20220421125403.2180824-1-codrin.ciubotariu@microchip.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Cc: alexandre.belloni@bootlin.com, tiwai@suse.com, broonie@kernel.org, Codrin Ciubotariu , sha@pengutronix.de 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 reverts commit 9a1e13440a4f2e7566fd4c5eae6a53e6400e08a4. As pointed out by Sascha Hauer, this patch changes: if (pmc->config && !pcm->config->prepare_slave_config) to: if (pmc->config && !pcm->config->prepare_slave_config) snd_dmaengine_pcm_prepare_slave_config() This breaks the drivers that do not need a call to dmaengine_slave_config(). Drivers that still need to call snd_dmaengine_pcm_prepare_slave_config(), but have a NULL pcm->config->prepare_slave_config should use snd_dmaengine_pcm_prepare_slave_config() as their prepare_slave_config callback. Fixes: 9a1e13440a4f ("ASoC: dmaengine: do not use a NULL prepare_slave_config() callback") Reported-by: Sascha Hauer Signed-off-by: Codrin Ciubotariu --- sound/soc/soc-generic-dmaengine-pcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 2ab2ddc1294dd..285441d6aeed4 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -86,10 +86,10 @@ static int dmaengine_pcm_hw_params(struct snd_soc_component *component, memset(&slave_config, 0, sizeof(slave_config)); - if (pcm->config && pcm->config->prepare_slave_config) - prepare_slave_config = pcm->config->prepare_slave_config; - else + if (!pcm->config) prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config; + else + prepare_slave_config = pcm->config->prepare_slave_config; if (prepare_slave_config) { int ret = prepare_slave_config(substream, params, &slave_config); From patchwork Thu Apr 21 12:54:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 12821596 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0909CC433F5 for ; Thu, 21 Apr 2022 12:55:56 +0000 (UTC) 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 46F691910; Thu, 21 Apr 2022 14:55:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 46F691910 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1650545754; bh=5fez7wr8uqc+IWPhOReqP+qP7BSjjeMLlqht5y+cQyI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=C/5sl2FLD/3nKQSCMP2innlsisinH0J7UTAMCEExp/IQHCaohphvz5tbZLCUH7Ma3 wcH1j9x/sLeypjOr4DtYcO3Q/N0TD/f0kzhPglWI/5iXoKQ0C74/gFfeLKmKi9bCOT eq3Nl03QK16JLUMSnOypS7Suf5dID6GpOzXgCA60= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4A42AF8047D; Thu, 21 Apr 2022 14:54:44 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 042F5F804DA; Thu, 21 Apr 2022 14:54:43 +0200 (CEST) Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 56B0AF8047D for ; Thu, 21 Apr 2022 14:54:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 56B0AF8047D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="Ha2g3ikx" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1650545677; x=1682081677; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5fez7wr8uqc+IWPhOReqP+qP7BSjjeMLlqht5y+cQyI=; b=Ha2g3ikxfWQAmcMGZaiJwsr0uUhhlSUhB2PhpKtSDIuYVeRGHMs0G9w9 4fL3p2CRXCCrddB7ocr3SreIDwh6af0y5nKNitR7mXj+4u1zm9YvF4r8V vDxQ2VfYmPJ/F1GMMepBiZMxbHeHJjjZ6ZmvUH1UdmNODZsTKevdqPn0Z KBZNWz3Gn4vbxW+EKKqXo8XMZyPfZlCkhG28MNXkq2HLSfets46SWRUWn wCmOBov4NFTCIcDTbApbqcYV8T6ycLE7LKcsQ9n/pT2eRPQAeGs3bliUW MQA/ZjnzJ/Zp/o7l2X2oK7e8tBmjYcKkUCKYwGdq/rwQCzmOUziQm1O1/ w==; X-IronPort-AV: E=Sophos;i="5.90,278,1643698800"; d="scan'208";a="156304300" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Apr 2022 05:54:24 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Thu, 21 Apr 2022 05:54:24 -0700 Received: from rob-ult-m19940.amer.actel.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Thu, 21 Apr 2022 05:54:21 -0700 From: Codrin Ciubotariu To: , , Subject: [PATCH 2/2] ASoC: atmel: mchp-pdmc: set prepare_slave_config Date: Thu, 21 Apr 2022 15:54:03 +0300 Message-ID: <20220421125403.2180824-2-codrin.ciubotariu@microchip.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220421125403.2180824-1-codrin.ciubotariu@microchip.com> References: <20220421125403.2180824-1-codrin.ciubotariu@microchip.com> MIME-Version: 1.0 Cc: alexandre.belloni@bootlin.com, tiwai@suse.com, broonie@kernel.org, Codrin Ciubotariu , sha@pengutronix.de 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" Since a pointer to struct snd_dmaengine_pcm_config is passed, snd_dmaengine_pcm_prepare_slave_config() is no longer called unless it's explicitly set in prepare_slave_config. Fixes: 50291652af52 ("ASoC: atmel: mchp-pdmc: add PDMC driver") Suggested-by: Sascha Hauer Signed-off-by: Codrin Ciubotariu --- sound/soc/atmel/mchp-pdmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/atmel/mchp-pdmc.c b/sound/soc/atmel/mchp-pdmc.c index 1a7802fbf23c1..a3856c73e2214 100644 --- a/sound/soc/atmel/mchp-pdmc.c +++ b/sound/soc/atmel/mchp-pdmc.c @@ -966,6 +966,7 @@ static int mchp_pdmc_process(struct snd_pcm_substream *substream, static struct snd_dmaengine_pcm_config mchp_pdmc_config = { .process = mchp_pdmc_process, + .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, }; static int mchp_pdmc_probe(struct platform_device *pdev)