From patchwork Wed Jan 18 16:10:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 643692 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 69A80C32793 for ; Wed, 18 Jan 2023 16:12:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7FB2C79BE; Wed, 18 Jan 2023 17:11:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7FB2C79BE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674058335; bh=9lsf4Rm2C5XkHcvH4f3NT1A03Z7ddyEqH7Ndpj9WVgQ=; h=From:To:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=lRzYHt1JJw8B6APZuvahKRU9Vi7M1JffPMal6YlSiD//TvvIPOKwPQSzljF9QdTG+ hgHk+edlKfwzdqUGM3uHxj5j3wHMefNSOWNCWJLXEAihDQSlBXyBCpwb8RtH53/ezz 5nxNQTImN3vNSYqlQVmvU0wVu+GkOCJ67kQ8poSg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 229A6F80495; Wed, 18 Jan 2023 17:11:22 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 45C47F804BC; Wed, 18 Jan 2023 17:11:21 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 90E3BF8024D for ; Wed, 18 Jan 2023 17:11:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 90E3BF8024D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=i3OjmvfJ Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A7CC2618C2; Wed, 18 Jan 2023 16:11:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52746C433F0; Wed, 18 Jan 2023 16:11:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674058276; bh=9lsf4Rm2C5XkHcvH4f3NT1A03Z7ddyEqH7Ndpj9WVgQ=; h=From:To:Cc:Subject:Date:From; b=i3OjmvfJjrkOXSvvqNgnEwsRYksBPCnCC9hmz2oWHToSKf12DPIRywVZxRy+j/S5z 3UpnDj96kUM//uubhRWA83wDFKzQ8D2oRtbnlrIzemF9jOsmWR0BGdp3k9ZzZsuhmg Yq8DpJzAYze99A9hkmYg1qhWdaOB6/SBEV8eByE5FbhiowKat4fvsgW4hFlPUss2ic /e3pvEr/xwE810fWpINZiNBGJSmd8RXe48GQrdqGjv4hg7SO8PX1n/Dt0N+tiwu1NK sScI5I2xKUlSFd5C5+zdqam1QkrXPaB/oIKMc1+o88EKQGORcT4N2IFL+ZNr5ZOPWR 3q34Q2PIOJklA== From: Arnd Bergmann To: Sylwester Nawrocki , Mark Brown Subject: [PATCH 1/5] ASoC: samsung: remove DMA filter function and data Date: Wed, 18 Jan 2023 17:10:45 +0100 Message-Id: <20230118161110.521504-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, Charles Keepax , Arnd Bergmann , Liam Girdwood , linux-kernel@vger.kernel.org, Takashi Iwai , Krzysztof Kozlowski , Alim Akhtar , linux-arm-kernel@lists.infradead.org Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Arnd Bergmann This data is no longer passed by the platform code, so there is no point passing it down at all. Signed-off-by: Arnd Bergmann Acked-by: Krzysztof Kozlowski --- include/linux/platform_data/asoc-s3c.h | 6 ------ sound/soc/samsung/dma.h | 2 +- sound/soc/samsung/dmaengine.c | 3 +-- sound/soc/samsung/i2s.c | 21 +++------------------ sound/soc/samsung/pcm.c | 11 +---------- sound/soc/samsung/spdif.c | 9 +-------- 6 files changed, 7 insertions(+), 45 deletions(-) diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h index f9c00f839e9f..84874433cf21 100644 --- a/include/linux/platform_data/asoc-s3c.h +++ b/include/linux/platform_data/asoc-s3c.h @@ -30,7 +30,6 @@ struct samsung_i2s_type { #define QUIRK_SUPPORTS_IDMA (1 << 5) /* Quirks of the I2S controller */ u32 quirks; - dma_addr_t idma_addr; }; /** @@ -39,10 +38,5 @@ struct samsung_i2s_type { */ struct s3c_audio_pdata { int (*cfg_gpio)(struct platform_device *); - dma_filter_fn dma_filter; - void *dma_playback; - void *dma_capture; - void *dma_play_sec; - void *dma_capture_mic; struct samsung_i2s_type type; }; diff --git a/sound/soc/samsung/dma.h b/sound/soc/samsung/dma.h index 7b5d4556e0fd..bd0faf84972e 100644 --- a/sound/soc/samsung/dma.h +++ b/sound/soc/samsung/dma.h @@ -12,7 +12,7 @@ * @tx, @rx arguments can be NULL if the DMA channel names are "tx", "rx", * otherwise actual DMA channel names must be passed to this function. */ -int samsung_asoc_dma_platform_register(struct device *dev, dma_filter_fn filter, +int samsung_asoc_dma_platform_register(struct device *dev, const char *tx, const char *rx, struct device *dma_dev); #endif /* _SAMSUNG_DMA_H */ diff --git a/sound/soc/samsung/dmaengine.c b/sound/soc/samsung/dmaengine.c index 2802789a323e..900953ee3786 100644 --- a/sound/soc/samsung/dmaengine.c +++ b/sound/soc/samsung/dmaengine.c @@ -14,7 +14,7 @@ #include "dma.h" -int samsung_asoc_dma_platform_register(struct device *dev, dma_filter_fn filter, +int samsung_asoc_dma_platform_register(struct device *dev, const char *tx, const char *rx, struct device *dma_dev) { @@ -25,7 +25,6 @@ int samsung_asoc_dma_platform_register(struct device *dev, dma_filter_fn filter, return -ENOMEM; pcm_conf->prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config; - pcm_conf->compat_filter_fn = filter; pcm_conf->dma_dev = dma_dev; pcm_conf->chan_names[SNDRV_PCM_STREAM_PLAYBACK] = tx; diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 9505200f3d11..052c263c126a 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -79,7 +79,6 @@ struct i2s_dai { struct snd_dmaengine_dai_dma_data dma_playback; struct snd_dmaengine_dai_dma_data dma_capture; struct snd_dmaengine_dai_dma_data idma_playback; - dma_filter_fn filter; struct samsung_i2s_priv *priv; }; @@ -1431,13 +1430,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) spin_lock_init(&priv->lock); spin_lock_init(&priv->pcm_lock); - if (!np) { - pri_dai->dma_playback.filter_data = i2s_pdata->dma_playback; - pri_dai->dma_capture.filter_data = i2s_pdata->dma_capture; - pri_dai->filter = i2s_pdata->dma_filter; - - idma_addr = i2s_pdata->type.idma_addr; - } else { + if (np) { if (of_property_read_u32(np, "samsung,idma-addr", &idma_addr)) { if (priv->quirks & QUIRK_SUPPORTS_IDMA) { @@ -1475,8 +1468,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) if (priv->quirks & QUIRK_PRI_6CHAN) pri_dai->drv->playback.channels_max = 6; - ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter, - "tx", "rx", NULL); + ret = samsung_asoc_dma_platform_register(&pdev->dev, "tx", "rx", NULL); if (ret < 0) goto err_disable_clk; @@ -1485,12 +1477,6 @@ static int samsung_i2s_probe(struct platform_device *pdev) sec_dai->dma_playback.addr = regs_base + I2STXDS; sec_dai->dma_playback.chan_name = "tx-sec"; - - if (!np) { - sec_dai->dma_playback.filter_data = i2s_pdata->dma_play_sec; - sec_dai->filter = i2s_pdata->dma_filter; - } - sec_dai->dma_playback.addr_width = 4; sec_dai->idma_playback.addr = idma_addr; sec_dai->pri_dai = pri_dai; @@ -1502,8 +1488,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) goto err_disable_clk; ret = samsung_asoc_dma_platform_register(&priv->pdev_sec->dev, - sec_dai->filter, "tx-sec", NULL, - &pdev->dev); + "tx-sec", NULL, &pdev->dev); if (ret < 0) goto err_del_sec; diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c index e859252ae5e6..2f3a99de6434 100644 --- a/sound/soc/samsung/pcm.c +++ b/sound/soc/samsung/pcm.c @@ -489,7 +489,6 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev) struct s3c_pcm_info *pcm; struct resource *mem_res; struct s3c_audio_pdata *pcm_pdata; - dma_filter_fn filter; int ret; /* Check for valid device index */ @@ -542,18 +541,10 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev) s3c_pcm_stereo_in[pdev->id].addr = mem_res->start + S3C_PCM_RXFIFO; s3c_pcm_stereo_out[pdev->id].addr = mem_res->start + S3C_PCM_TXFIFO; - filter = NULL; - if (pcm_pdata) { - s3c_pcm_stereo_in[pdev->id].filter_data = pcm_pdata->dma_capture; - s3c_pcm_stereo_out[pdev->id].filter_data = pcm_pdata->dma_playback; - filter = pcm_pdata->dma_filter; - } - pcm->dma_capture = &s3c_pcm_stereo_in[pdev->id]; pcm->dma_playback = &s3c_pcm_stereo_out[pdev->id]; - ret = samsung_asoc_dma_platform_register(&pdev->dev, filter, - NULL, NULL, NULL); + ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL, NULL, NULL); if (ret) { dev_err(&pdev->dev, "failed to get register DMA: %d\n", ret); goto err_dis_pclk; diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c index 7d815e237e5c..beabcadd7d1d 100644 --- a/sound/soc/samsung/spdif.c +++ b/sound/soc/samsung/spdif.c @@ -363,7 +363,6 @@ static int spdif_probe(struct platform_device *pdev) struct s3c_audio_pdata *spdif_pdata; struct resource *mem_res; struct samsung_spdif_info *spdif; - dma_filter_fn filter; int ret; spdif_pdata = pdev->dev.platform_data; @@ -424,15 +423,9 @@ static int spdif_probe(struct platform_device *pdev) spdif_stereo_out.addr_width = 2; spdif_stereo_out.addr = mem_res->start + DATA_OUTBUF; - filter = NULL; - if (spdif_pdata) { - spdif_stereo_out.filter_data = spdif_pdata->dma_playback; - filter = spdif_pdata->dma_filter; - } spdif->dma_playback = &spdif_stereo_out; - ret = samsung_asoc_dma_platform_register(&pdev->dev, filter, - NULL, NULL, NULL); + ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL, NULL, NULL); if (ret) { dev_err(&pdev->dev, "failed to register DMA: %d\n", ret); goto err4; From patchwork Wed Jan 18 16:10:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 643691 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 B8DE5C32793 for ; Wed, 18 Jan 2023 16:12:48 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DDF2C799A; Wed, 18 Jan 2023 17:11:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DDF2C799A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674058366; bh=hfA2eXgm6COXrjgq0eXTI7FELNoNzfagIjCDGXpAipY=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=DF1i+jwZIPX8ffYGLXgmIIgI257l3RvCIAhjQizB5mMna1wZqMMyDsX3Ypob7FVWk qVK+5f2cD/d3DBlbkCQBpAgU8nwUqvX/MLCUjxzBFSUZLcke3s7LBABb4SgALUtATq 9QUdmcwrP7ix5JIg8ckGmXn+uvL98saPbMbORHm4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8FC5DF8053C; Wed, 18 Jan 2023 17:11:56 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AFD4DF8024C; Wed, 18 Jan 2023 17:11:54 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E22C5F8024C for ; Wed, 18 Jan 2023 17:11:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E22C5F8024C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Ivc0Sazk Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 35B57B81D7D; Wed, 18 Jan 2023 16:11:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 180ECC433D2; Wed, 18 Jan 2023 16:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674058309; bh=hfA2eXgm6COXrjgq0eXTI7FELNoNzfagIjCDGXpAipY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ivc0SazkaMpDaLRHVArm23f6+rwNgRkiIfG9MwhAW7qvfmEaAYeDraa6/XCaDxrJ1 s42Fqalv3DxyTCHjVmgR8W32HF/qP6/Dx61YFXpEaOP8tn2Gr1Fh7eHREZwxxm7K54 fZy5Z9xLEZA+VzFAFTeaIIvCY0qkmPpqf6N0sNFbxZhX6PWWIg3LNKLNnP1nLvsw+N Zd76G5DoooNgMXU4IQNxTLAIUJwHq/J4RYM3kl2VbBPz7kM5ZNGjaeLYwubohztVLT sjXcrSSe5mXmWxmBmUeeg9JSPgB99Eonvxw15xGm4MVLv9Lpi5P+Fa6h+OZ0JZQ6ac d0Gdcn5OqDrYw== From: Arnd Bergmann To: Lars-Peter Clausen , Jaroslav Kysela , Takashi Iwai Subject: [PATCH 2/5] ASoC: pxa: remove snd_dmaengine_pcm_open_request_chan() Date: Wed, 18 Jan 2023 17:10:46 +0100 Message-Id: <20230118161110.521504-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230118161110.521504-1-arnd@kernel.org> References: <20230118161110.521504-1-arnd@kernel.org> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: alsa-devel@alsa-project.org, Eugeniu Rosca , Andreas Pape , linux-kernel@vger.kernel.org, Arnd Bergmann Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Arnd Bergmann The last caller was removed, so there is no longer a need for this function. Signed-off-by: Arnd Bergmann --- include/sound/dmaengine_pcm.h | 2 -- sound/core/pcm_dmaengine.c | 21 --------------------- 2 files changed, 23 deletions(-) diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index 2df54cf02cb3..a497d1f81cab 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h @@ -37,8 +37,6 @@ int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream, struct dma_chan *chan); int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream); -int snd_dmaengine_pcm_open_request_chan(struct snd_pcm_substream *substream, - dma_filter_fn filter_fn, void *filter_data); int snd_dmaengine_pcm_close_release_chan(struct snd_pcm_substream *substream); struct dma_chan *snd_dmaengine_pcm_request_channel(dma_filter_fn filter_fn, diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c index 494ec0c207fa..9f4120f020d8 100644 --- a/sound/core/pcm_dmaengine.c +++ b/sound/core/pcm_dmaengine.c @@ -328,27 +328,6 @@ int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream, } EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_open); -/** - * snd_dmaengine_pcm_open_request_chan - Open a dmaengine based PCM substream and request channel - * @substream: PCM substream - * @filter_fn: Filter function used to request the DMA channel - * @filter_data: Data passed to the DMA filter function - * - * This function will request a DMA channel using the passed filter function and - * data. The function should usually be called from the pcm open callback. Note - * that this function will use private_data field of the substream's runtime. So - * it is not available to your pcm driver implementation. - * - * Return: 0 on success, a negative error code otherwise - */ -int snd_dmaengine_pcm_open_request_chan(struct snd_pcm_substream *substream, - dma_filter_fn filter_fn, void *filter_data) -{ - return snd_dmaengine_pcm_open(substream, - snd_dmaengine_pcm_request_channel(filter_fn, filter_data)); -} -EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_open_request_chan); - /** * snd_dmaengine_pcm_close - Close a dmaengine based PCM substream * @substream: PCM substream From patchwork Wed Jan 18 16:10:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 643690 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 C63F0C38147 for ; Wed, 18 Jan 2023 16:13:25 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DC23D7998; Wed, 18 Jan 2023 17:12:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DC23D7998 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674058403; bh=48FuYf73j5irAdfV5OvRijOa2+RnLc2iiO0dv0dASHs=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=uOlFJyaMl7FXWsDgjTZeTM9vXH1AZQOBZra8RFgTbGATI6rwgAFdC+xAJjOODPAZ5 Tb7qDOZHGajKuAXNDJMrGiEJaUbNpyRvw3qtVCuKzFDdOPkTs2v350SK17mlOXbuyN z1J/4Bua8uZgOB1gJdV36mOO61EYULLDLeatAvME= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7F406F80543; Wed, 18 Jan 2023 17:12:33 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5A120F80548; Wed, 18 Jan 2023 17:12:32 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 57EC1F8024D for ; Wed, 18 Jan 2023 17:12:30 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 57EC1F8024D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=pHJYhgtV Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AF8F1B81D7D; Wed, 18 Jan 2023 16:12:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6DA7C433EF; Wed, 18 Jan 2023 16:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674058347; bh=48FuYf73j5irAdfV5OvRijOa2+RnLc2iiO0dv0dASHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pHJYhgtVQnVdtM3GXH1PlDVa63tAXRgp+hPGoN+O2xX7XSgRNjW10imB20sRpRP81 ZyC+8sw4Oh1XbZzjHJMa5fs3h3r/j5TuQlHqO1aK85whjbAB5OoI88FP6tyr4KNgKB fa1BOFWvzOv5wDNPohWXJWO/mFhvHj7vHdOSKD2B/Vw4qRxvEl4wWwBpTIBGKX25Ih 0cOuV5Bv4PAkAlf/Ymr7340gcFZsZD0QaM44fUR7BT7f7bUUXo5AsZ3rd6TRGYP689 bWqSoAHItZRc2sahS2zRxyEYsj+g59xwFASryHSFXKMiIp2R69MSVwUvO1RYb/fStF wMPnAPKeVRPKA== From: Arnd Bergmann To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Subject: [PATCH 4/5] ASoC: ux500: remove stedma40 references Date: Wed, 18 Jan 2023 17:10:48 +0100 Message-Id: <20230118161110.521504-4-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230118161110.521504-1-arnd@kernel.org> References: <20230118161110.521504-1-arnd@kernel.org> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Christophe JAILLET , alsa-devel@alsa-project.org, Charles Keepax , linux-kernel@vger.kernel.org, Arnd Bergmann Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Arnd Bergmann ux500_pcm_request_chan() is never called because the dma channels are already set up from DT. Remove this, along with the ux500_msp_dma_params structure. Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij --- sound/soc/ux500/ux500_msp_dai.c | 4 +-- sound/soc/ux500/ux500_msp_i2s.c | 41 +------------------------------ sound/soc/ux500/ux500_msp_i2s.h | 9 +------ sound/soc/ux500/ux500_pcm.c | 43 +-------------------------------- 4 files changed, 5 insertions(+), 92 deletions(-) diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c index 6e86efd06ec1..6fb1a5c207bc 100644 --- a/sound/soc/ux500/ux500_msp_dai.c +++ b/sound/soc/ux500/ux500_msp_dai.c @@ -670,8 +670,8 @@ static int ux500_msp_dai_of_probe(struct snd_soc_dai *dai) if (!capture_dma_data) return -ENOMEM; - playback_dma_data->addr = drvdata->msp->playback_dma_data.tx_rx_addr; - capture_dma_data->addr = drvdata->msp->capture_dma_data.tx_rx_addr; + playback_dma_data->addr = drvdata->msp->tx_rx_addr; + capture_dma_data->addr = drvdata->msp->tx_rx_addr; playback_dma_data->maxburst = 4; capture_dma_data->maxburst = 4; diff --git a/sound/soc/ux500/ux500_msp_i2s.c b/sound/soc/ux500/ux500_msp_i2s.c index bfca5553381f..fbfeefa418ca 100644 --- a/sound/soc/ux500/ux500_msp_i2s.c +++ b/sound/soc/ux500/ux500_msp_i2s.c @@ -360,20 +360,6 @@ static int enable_msp(struct ux500_msp *msp, struct ux500_msp_config *config) __func__, status); } - /* Make sure the correct DMA-directions are configured */ - if ((config->direction & MSP_DIR_RX) && - !msp->capture_dma_data.dma_cfg) { - dev_err(msp->dev, "%s: ERROR: MSP RX-mode is not configured!", - __func__); - return -EINVAL; - } - if ((config->direction == MSP_DIR_TX) && - !msp->playback_dma_data.dma_cfg) { - dev_err(msp->dev, "%s: ERROR: MSP TX-mode is not configured!", - __func__); - return -EINVAL; - } - reg_val_DMACR = readl(msp->registers + MSP_DMACR); if (config->direction & MSP_DIR_RX) reg_val_DMACR |= RX_DMA_ENABLE; @@ -638,40 +624,17 @@ int ux500_msp_i2s_close(struct ux500_msp *msp, unsigned int dir) } -static int ux500_msp_i2s_of_init_msp(struct platform_device *pdev, - struct ux500_msp *msp); -{ - msp->playback_dma_data.dma_cfg = devm_kzalloc(&pdev->dev, - sizeof(struct stedma40_chan_cfg), - GFP_KERNEL); - if (!msp->playback_dma_data.dma_cfg) - return -ENOMEM; - - msp->capture_dma_data.dma_cfg = devm_kzalloc(&pdev->dev, - sizeof(struct stedma40_chan_cfg), - GFP_KERNEL); - if (!msp->capture_dma_data.dma_cfg) - return -ENOMEM; - - return 0; -} - int ux500_msp_i2s_init_msp(struct platform_device *pdev, struct ux500_msp **msp_p) { struct resource *res = NULL; struct ux500_msp *msp; - int ret; *msp_p = devm_kzalloc(&pdev->dev, sizeof(struct ux500_msp), GFP_KERNEL); msp = *msp_p; if (!msp) return -ENOMEM; - ret = ux500_msp_i2s_of_init_msp(pdev, msp); - if (ret) - return ret; - msp->dev = &pdev->dev; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -681,9 +644,7 @@ int ux500_msp_i2s_init_msp(struct platform_device *pdev, return -ENOMEM; } - msp->playback_dma_data.tx_rx_addr = res->start + MSP_DR; - msp->capture_dma_data.tx_rx_addr = res->start + MSP_DR; - + msp->tx_rx_addr = res->start + MSP_DR; msp->registers = devm_ioremap(&pdev->dev, res->start, resource_size(res)); if (msp->registers == NULL) { diff --git a/sound/soc/ux500/ux500_msp_i2s.h b/sound/soc/ux500/ux500_msp_i2s.h index 6b353423b75a..69d4ebc409fc 100644 --- a/sound/soc/ux500/ux500_msp_i2s.h +++ b/sound/soc/ux500/ux500_msp_i2s.h @@ -462,18 +462,11 @@ struct ux500_msp_config { unsigned int iodelay; }; -struct ux500_msp_dma_params { - unsigned int data_size; - dma_addr_t tx_rx_addr; - struct stedma40_chan_cfg *dma_cfg; -}; - struct ux500_msp { int id; void __iomem *registers; struct device *dev; - struct ux500_msp_dma_params playback_dma_data; - struct ux500_msp_dma_params capture_dma_data; + dma_addr_t tx_rx_addr; enum msp_state msp_state; int def_elem_len; unsigned int dir_busy; diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c index ca87517d80c9..53b5649cfdda 100644 --- a/sound/soc/ux500/ux500_pcm.c +++ b/sound/soc/ux500/ux500_pcm.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include @@ -29,44 +28,6 @@ #define UX500_PLATFORM_PERIODS_MAX 48 #define UX500_PLATFORM_BUFFER_BYTES_MAX (2048 * PAGE_SIZE) -static struct dma_chan *ux500_pcm_request_chan(struct snd_soc_pcm_runtime *rtd, - struct snd_pcm_substream *substream) -{ - struct snd_soc_dai *dai = asoc_rtd_to_cpu(rtd, 0); - u16 per_data_width, mem_data_width; - struct stedma40_chan_cfg *dma_cfg; - struct ux500_msp_dma_params *dma_params; - - dma_params = snd_soc_dai_get_dma_data(dai, substream); - dma_cfg = dma_params->dma_cfg; - - mem_data_width = DMA_SLAVE_BUSWIDTH_2_BYTES; - - switch (dma_params->data_size) { - case 32: - per_data_width = DMA_SLAVE_BUSWIDTH_4_BYTES; - break; - case 16: - per_data_width = DMA_SLAVE_BUSWIDTH_2_BYTES; - break; - case 8: - per_data_width = DMA_SLAVE_BUSWIDTH_1_BYTE; - break; - default: - per_data_width = DMA_SLAVE_BUSWIDTH_4_BYTES; - } - - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - dma_cfg->src_info.data_width = mem_data_width; - dma_cfg->dst_info.data_width = per_data_width; - } else { - dma_cfg->src_info.data_width = per_data_width; - dma_cfg->dst_info.data_width = mem_data_width; - } - - return snd_dmaengine_pcm_request_channel(stedma40_filter, dma_cfg); -} - static int ux500_pcm_prepare_slave_config(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config) @@ -98,7 +59,6 @@ static int ux500_pcm_prepare_slave_config(struct snd_pcm_substream *substream, } static const struct snd_dmaengine_pcm_config ux500_dmaengine_of_pcm_config = { - .compat_request_channel = ux500_pcm_request_chan, .prepare_slave_config = ux500_pcm_prepare_slave_config, }; @@ -107,8 +67,7 @@ int ux500_pcm_register_platform(struct platform_device *pdev) int ret; ret = snd_dmaengine_pcm_register(&pdev->dev, - &ux500_dmaengine_of_pcm_config, - SND_DMAENGINE_PCM_FLAG_COMPAT); + &ux500_dmaengine_of_pcm_config, 0); if (ret < 0) { dev_err(&pdev->dev, "%s: ERROR: Failed to register platform '%s' (%d)!\n",