All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Pargmann <mpa@pengutronix.de>
To: Mark Brown <broonie@kernel.org>
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
	alsa-devel@alsa-project.org, Timur Tabi <timur@tabi.org>,
	kernel@pengutronix.de, Nicolin Chen <Guangyu.Chen@freescale.com>,
	Markus Pargmann <mpa@pengutronix.de>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 06/15] ASoC: fsl-ssi: Remove useless DMA code
Date: Wed, 26 Feb 2014 17:02:09 +0100	[thread overview]
Message-ID: <1393430538-32333-7-git-send-email-mpa@pengutronix.de> (raw)
In-Reply-To: <1393430538-32333-1-git-send-email-mpa@pengutronix.de>

Simplify dma DT property handling. fsl,ssi-dma-events is not used
anymore. It passes invalid data to imx_pcm_dma_params_init_data() which
copies some data into an imx dma struct. This struct is never used in
imx-dma or imx-sdma because of generic OF DMA handling. The
"fsl,ssi-dma-events" is not used anywhere in dts files.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 sound/soc/fsl/fsl_ssi.c | 40 +++-------------------------------------
 1 file changed, 3 insertions(+), 37 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 054813d..43d4342 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -157,8 +157,6 @@ struct fsl_ssi_private {
 	struct clk *clk;
 	struct snd_dmaengine_dai_dma_data dma_params_tx;
 	struct snd_dmaengine_dai_dma_data dma_params_rx;
-	struct imx_dma_data filter_data_tx;
-	struct imx_dma_data filter_data_rx;
 	struct imx_pcm_fiq_params fiq_params;
 	/* Register values for rx/tx configuration */
 	struct fsl_ssi_rxtx_reg_val rxtx_reg_val;
@@ -977,8 +975,7 @@ static int fsl_ssi_imx_probe(struct platform_device *pdev,
 		struct fsl_ssi_private *ssi_private)
 {
 	struct device_node *np = pdev->dev.of_node;
-	u32 dma_events[2], dmas[4];
-	bool shared;
+	u32 dmas[4];
 	int ret;
 
 	ssi_private->clk = devm_clk_get(&pdev->dev, NULL);
@@ -1012,26 +1009,9 @@ static int fsl_ssi_imx_probe(struct platform_device *pdev,
 	ssi_private->dma_params_rx.maxburst = ssi_private->fifo_depth - 2;
 	ssi_private->dma_params_tx.addr = ssi_private->ssi_phys + CCSR_SSI_STX0;
 	ssi_private->dma_params_rx.addr = ssi_private->ssi_phys + CCSR_SSI_SRX0;
-	ssi_private->dma_params_tx.filter_data = &ssi_private->filter_data_tx;
-	ssi_private->dma_params_rx.filter_data = &ssi_private->filter_data_rx;
 
-	if (!of_property_read_bool(pdev->dev.of_node, "dmas") &&
-			ssi_private->use_dma) {
-		/*
-		 * FIXME: This is a temporary solution until all
-		 * necessary dma drivers support the generic dma
-		 * bindings.
-		 */
-		ret = of_property_read_u32_array(pdev->dev.of_node,
-				"fsl,ssi-dma-events", dma_events, 2);
-		if (ret && ssi_private->use_dma) {
-			dev_err(&pdev->dev, "could not get dma events but fsl-ssi is configured to use DMA\n");
-			goto error_dma_events;
-		}
-	}
-	/* Should this be merge with the above? */
-	if (!of_property_read_u32_array(pdev->dev.of_node, "dmas", dmas, 4)
-			&& dmas[2] == IMX_DMATYPE_SSI_DUAL) {
+	ret = !of_property_read_u32_array(np, "dmas", dmas, 4);
+	if (ssi_private->use_dma && !ret && dmas[2] == IMX_DMATYPE_SSI_DUAL) {
 		ssi_private->use_dual_fifo = true;
 		/* When using dual fifo mode, we need to keep watermark
 		 * as even numbers due to dma script limitation.
@@ -1040,21 +1020,7 @@ static int fsl_ssi_imx_probe(struct platform_device *pdev,
 		ssi_private->dma_params_rx.maxburst &= ~0x1;
 	}
 
-	shared = of_device_is_compatible(of_get_parent(np), "fsl,spba-bus");
-
-	imx_pcm_dma_params_init_data(&ssi_private->filter_data_tx,
-		dma_events[0], shared ? IMX_DMATYPE_SSI_SP : IMX_DMATYPE_SSI);
-	imx_pcm_dma_params_init_data(&ssi_private->filter_data_rx,
-		dma_events[1], shared ? IMX_DMATYPE_SSI_SP : IMX_DMATYPE_SSI);
-
 	return 0;
-
-error_dma_events:
-	if (!IS_ERR(ssi_private->baudclk))
-		clk_disable_unprepare(ssi_private->baudclk);
-	clk_disable_unprepare(ssi_private->clk);
-
-	return ret;
 }
 
 static void fsl_ssi_imx_clean(struct platform_device *pdev,
-- 
1.8.5.3

WARNING: multiple messages have this Message-ID
From: mpa@pengutronix.de (Markus Pargmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 06/15] ASoC: fsl-ssi: Remove useless DMA code
Date: Wed, 26 Feb 2014 17:02:09 +0100	[thread overview]
Message-ID: <1393430538-32333-7-git-send-email-mpa@pengutronix.de> (raw)
In-Reply-To: <1393430538-32333-1-git-send-email-mpa@pengutronix.de>

Simplify dma DT property handling. fsl,ssi-dma-events is not used
anymore. It passes invalid data to imx_pcm_dma_params_init_data() which
copies some data into an imx dma struct. This struct is never used in
imx-dma or imx-sdma because of generic OF DMA handling. The
"fsl,ssi-dma-events" is not used anywhere in dts files.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 sound/soc/fsl/fsl_ssi.c | 40 +++-------------------------------------
 1 file changed, 3 insertions(+), 37 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 054813d..43d4342 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -157,8 +157,6 @@ struct fsl_ssi_private {
 	struct clk *clk;
 	struct snd_dmaengine_dai_dma_data dma_params_tx;
 	struct snd_dmaengine_dai_dma_data dma_params_rx;
-	struct imx_dma_data filter_data_tx;
-	struct imx_dma_data filter_data_rx;
 	struct imx_pcm_fiq_params fiq_params;
 	/* Register values for rx/tx configuration */
 	struct fsl_ssi_rxtx_reg_val rxtx_reg_val;
@@ -977,8 +975,7 @@ static int fsl_ssi_imx_probe(struct platform_device *pdev,
 		struct fsl_ssi_private *ssi_private)
 {
 	struct device_node *np = pdev->dev.of_node;
-	u32 dma_events[2], dmas[4];
-	bool shared;
+	u32 dmas[4];
 	int ret;
 
 	ssi_private->clk = devm_clk_get(&pdev->dev, NULL);
@@ -1012,26 +1009,9 @@ static int fsl_ssi_imx_probe(struct platform_device *pdev,
 	ssi_private->dma_params_rx.maxburst = ssi_private->fifo_depth - 2;
 	ssi_private->dma_params_tx.addr = ssi_private->ssi_phys + CCSR_SSI_STX0;
 	ssi_private->dma_params_rx.addr = ssi_private->ssi_phys + CCSR_SSI_SRX0;
-	ssi_private->dma_params_tx.filter_data = &ssi_private->filter_data_tx;
-	ssi_private->dma_params_rx.filter_data = &ssi_private->filter_data_rx;
 
-	if (!of_property_read_bool(pdev->dev.of_node, "dmas") &&
-			ssi_private->use_dma) {
-		/*
-		 * FIXME: This is a temporary solution until all
-		 * necessary dma drivers support the generic dma
-		 * bindings.
-		 */
-		ret = of_property_read_u32_array(pdev->dev.of_node,
-				"fsl,ssi-dma-events", dma_events, 2);
-		if (ret && ssi_private->use_dma) {
-			dev_err(&pdev->dev, "could not get dma events but fsl-ssi is configured to use DMA\n");
-			goto error_dma_events;
-		}
-	}
-	/* Should this be merge with the above? */
-	if (!of_property_read_u32_array(pdev->dev.of_node, "dmas", dmas, 4)
-			&& dmas[2] == IMX_DMATYPE_SSI_DUAL) {
+	ret = !of_property_read_u32_array(np, "dmas", dmas, 4);
+	if (ssi_private->use_dma && !ret && dmas[2] == IMX_DMATYPE_SSI_DUAL) {
 		ssi_private->use_dual_fifo = true;
 		/* When using dual fifo mode, we need to keep watermark
 		 * as even numbers due to dma script limitation.
@@ -1040,21 +1020,7 @@ static int fsl_ssi_imx_probe(struct platform_device *pdev,
 		ssi_private->dma_params_rx.maxburst &= ~0x1;
 	}
 
-	shared = of_device_is_compatible(of_get_parent(np), "fsl,spba-bus");
-
-	imx_pcm_dma_params_init_data(&ssi_private->filter_data_tx,
-		dma_events[0], shared ? IMX_DMATYPE_SSI_SP : IMX_DMATYPE_SSI);
-	imx_pcm_dma_params_init_data(&ssi_private->filter_data_rx,
-		dma_events[1], shared ? IMX_DMATYPE_SSI_SP : IMX_DMATYPE_SSI);
-
 	return 0;
-
-error_dma_events:
-	if (!IS_ERR(ssi_private->baudclk))
-		clk_disable_unprepare(ssi_private->baudclk);
-	clk_disable_unprepare(ssi_private->clk);
-
-	return ret;
 }
 
 static void fsl_ssi_imx_clean(struct platform_device *pdev,
-- 
1.8.5.3

  parent reply	other threads:[~2014-02-26 16:02 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26 16:02 [PATCH 00/15] ASoC: fsl-ssi: Driver cleanup Markus Pargmann
2014-02-26 16:02 ` Markus Pargmann
2014-02-26 16:02 ` [PATCH 01/15] ASoC: fsl-ssi: Use regmap Markus Pargmann
2014-02-26 16:02   ` Markus Pargmann
2014-02-27  2:08   ` Li.Xiubo
2014-02-27  2:08     ` Li.Xiubo at freescale.com
2014-02-27 15:23     ` Markus Pargmann
2014-02-27 15:23       ` Markus Pargmann
2014-02-27 16:06       ` Timur Tabi
2014-02-27 16:06         ` Timur Tabi
2014-03-05  6:21     ` Mark Brown
2014-03-05  6:21       ` Mark Brown
2014-03-05  7:04       ` Li.Xiubo
2014-03-05  7:04         ` Li.Xiubo at freescale.com
2014-03-05  7:07       ` Li.Xiubo
2014-03-05  7:07         ` Li.Xiubo at freescale.com
2014-02-26 16:02 ` [PATCH 02/15] ASoC: fsl-ssi: Remove fsl_ssi_setup Markus Pargmann
2014-02-26 16:02   ` Markus Pargmann
2014-02-26 16:02 ` [PATCH 03/15] ASoC: fsl-ssi: Move debugging to seperate file Markus Pargmann
2014-02-26 16:02   ` Markus Pargmann
2014-02-26 16:02 ` [PATCH 04/15] ASoC: fsl-ssi: Use dev_name for DAI driver struct Markus Pargmann
2014-02-26 16:02   ` Markus Pargmann
2014-02-26 16:02 ` [PATCH 05/15] ASoC: fsl-ssi: Move imx-specific probe to seperate function Markus Pargmann
2014-02-26 16:02   ` Markus Pargmann
2014-02-26 16:02 ` Markus Pargmann [this message]
2014-02-26 16:02   ` [PATCH 06/15] ASoC: fsl-ssi: Remove useless DMA code Markus Pargmann
2014-02-26 16:02 ` [PATCH 07/15] ASoC: fsl-ssi: baud clock error handling Markus Pargmann
2014-02-26 16:02   ` Markus Pargmann
2014-02-26 16:02 ` [PATCH 08/15] ASoC: fsl-ssi: Cleanup probe function Markus Pargmann
2014-02-26 16:02   ` Markus Pargmann
2014-02-26 16:02 ` [PATCH 09/15] ASoC: fsl-ssi: Remove unnecessary variables from ssi_private Markus Pargmann
2014-02-26 16:02   ` Markus Pargmann
2014-02-26 16:02 ` [PATCH 10/15] ASoC: fsl-ssi: reorder and document fsl_ssi_private Markus Pargmann
2014-02-26 16:02   ` Markus Pargmann
2014-02-26 16:02 ` [PATCH 11/15] ASoC: fsl-ssi: Fix register values when disabling Markus Pargmann
2014-02-26 16:02   ` Markus Pargmann
2014-02-26 16:02 ` [PATCH 12/15] ASoC: fsl-ssi: Only enable baudclk when used Markus Pargmann
2014-02-26 16:02   ` Markus Pargmann
2014-02-26 16:02 ` [PATCH 13/15] ASoC: fsl-ssi: Set default dai-fmts Markus Pargmann
2014-02-26 16:02   ` Markus Pargmann
2014-02-26 16:02 ` [PATCH 14/15] ASoC: fsl-ssi: Transmit enable synchronization Markus Pargmann
2014-02-26 16:02   ` Markus Pargmann
2014-02-26 16:02 ` [PATCH 15/15] ASoC: fsl-ssi: Update binding documentation Markus Pargmann
2014-02-26 16:02   ` Markus Pargmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393430538-32333-7-git-send-email-mpa@pengutronix.de \
    --to=mpa@pengutronix.de \
    --cc=Guangyu.Chen@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=fabio.estevam@freescale.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=timur@tabi.org \
    --subject='Re: [PATCH 06/15] ASoC: fsl-ssi: Remove useless DMA code' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.