All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timur Tabi <timur@tabi.org>
To: Markus Pargmann <mpa@pengutronix.de>,
	linux-arm-kernel@lists.infradead.org
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
	alsa-devel@alsa-project.org, devicetree-discuss@lists.ozlabs.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Sascha Hauer <kernel@pengutronix.de>,
	Shawn Guo <shawn.guo@linaro.org>
Subject: Re: [PATCH v2 05/11] ASoC: fsl-ssi: Add support for imx-pcm-fiq
Date: Sun, 07 Apr 2013 19:18:50 -0500	[thread overview]
Message-ID: <51620CEA.3010703@tabi.org> (raw)
In-Reply-To: <1365362721-3731-6-git-send-email-mpa@pengutronix.de>

Markus Pargmann wrote:
> Add support for non-dma pcm for imx platforms with imx-pcm-fiq support.
> Instead of imx-pcm-audio, in this case imx-pcm-fiq-audio device is added
> and the SIER flags are set differently.

So just to be clear, this is interrupt-driven SSI audio?  So you're 
generating an interrupt every time the transmit FIFO goes below the threshold?

I wonder if it makes sense to enable both FIFOs, so that you take half as 
many interrupts per second.

>
> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> ---
>   sound/soc/fsl/fsl_ssi.c | 70 ++++++++++++++++++++++++++++++++++++++++---------
>   1 file changed, 58 insertions(+), 12 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> index 7decbd9..afb5a23 100644
> --- a/sound/soc/fsl/fsl_ssi.c
> +++ b/sound/soc/fsl/fsl_ssi.c
> @@ -120,10 +120,12 @@ struct fsl_ssi_private {
>
>   	bool new_binding;
>   	bool ssi_on_imx;
> +	bool dma;

Can you rename this to "use_dma" or something like that?

>   	struct clk *clk;
>   	struct platform_device *imx_pcm_pdev;
>   	struct imx_pcm_dma_params dma_params_tx;
>   	struct imx_pcm_dma_params dma_params_rx;
> +	struct imx_pcm_fiq_params fiq_params;
>
>   	struct {
>   		unsigned int rfrc;
> @@ -353,7 +355,8 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream,
>   		 */
>
>   		/* Enable the interrupts and DMA requests */
> -		write_ssi(SIER_FLAGS, &ssi->sier);
> +		if (ssi_private->dma)
> +			write_ssi(SIER_FLAGS, &ssi->sier);
>
>   		/*
>   		 * Set the watermark for transmit FIFI 0 and receive FIFO 0. We
> @@ -520,6 +523,18 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
>   		return -EINVAL;
>   	}
>
> +	if (!ssi_private->dma) {
> +		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
> +			write_ssi(CCSR_SSI_SOR_TX_CLR, &ssi->sor);
> +			write_ssi(CCSR_SSI_SIER_TIE | CCSR_SSI_SIER_TFE0_EN,
> +					&ssi->sier);
> +		} else {
> +			write_ssi(CCSR_SSI_SOR_RX_CLR, &ssi->sor);
> +			write_ssi(CCSR_SSI_SIER_RIE | CCSR_SSI_SIER_RFF0_EN,
> +					&ssi->sier);
> +		}
> +	}
> +
>   	return 0;
>   }
>
> @@ -680,6 +695,8 @@ static int fsl_ssi_probe(struct platform_device *pdev)
>   	       sizeof(fsl_ssi_dai_template));
>   	ssi_private->cpu_dai_drv.name = ssi_private->name;
>
> +	ssi_private->dma = !of_property_read_bool(np, "fsl,imx-fiq");

Instead of looking for the FIQ property, maybe you should just look for 
the absence of a DMA property/node, and then default to interrupts if 
there is no DMA.  That would make it more generic, and even work on 
non-IMX systems.

-- 
Timur Tabi

WARNING: multiple messages have this Message-ID (diff)
From: timur@tabi.org (Timur Tabi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 05/11] ASoC: fsl-ssi: Add support for imx-pcm-fiq
Date: Sun, 07 Apr 2013 19:18:50 -0500	[thread overview]
Message-ID: <51620CEA.3010703@tabi.org> (raw)
In-Reply-To: <1365362721-3731-6-git-send-email-mpa@pengutronix.de>

Markus Pargmann wrote:
> Add support for non-dma pcm for imx platforms with imx-pcm-fiq support.
> Instead of imx-pcm-audio, in this case imx-pcm-fiq-audio device is added
> and the SIER flags are set differently.

So just to be clear, this is interrupt-driven SSI audio?  So you're 
generating an interrupt every time the transmit FIFO goes below the threshold?

I wonder if it makes sense to enable both FIFOs, so that you take half as 
many interrupts per second.

>
> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> ---
>   sound/soc/fsl/fsl_ssi.c | 70 ++++++++++++++++++++++++++++++++++++++++---------
>   1 file changed, 58 insertions(+), 12 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> index 7decbd9..afb5a23 100644
> --- a/sound/soc/fsl/fsl_ssi.c
> +++ b/sound/soc/fsl/fsl_ssi.c
> @@ -120,10 +120,12 @@ struct fsl_ssi_private {
>
>   	bool new_binding;
>   	bool ssi_on_imx;
> +	bool dma;

Can you rename this to "use_dma" or something like that?

>   	struct clk *clk;
>   	struct platform_device *imx_pcm_pdev;
>   	struct imx_pcm_dma_params dma_params_tx;
>   	struct imx_pcm_dma_params dma_params_rx;
> +	struct imx_pcm_fiq_params fiq_params;
>
>   	struct {
>   		unsigned int rfrc;
> @@ -353,7 +355,8 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream,
>   		 */
>
>   		/* Enable the interrupts and DMA requests */
> -		write_ssi(SIER_FLAGS, &ssi->sier);
> +		if (ssi_private->dma)
> +			write_ssi(SIER_FLAGS, &ssi->sier);
>
>   		/*
>   		 * Set the watermark for transmit FIFI 0 and receive FIFO 0. We
> @@ -520,6 +523,18 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
>   		return -EINVAL;
>   	}
>
> +	if (!ssi_private->dma) {
> +		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
> +			write_ssi(CCSR_SSI_SOR_TX_CLR, &ssi->sor);
> +			write_ssi(CCSR_SSI_SIER_TIE | CCSR_SSI_SIER_TFE0_EN,
> +					&ssi->sier);
> +		} else {
> +			write_ssi(CCSR_SSI_SOR_RX_CLR, &ssi->sor);
> +			write_ssi(CCSR_SSI_SIER_RIE | CCSR_SSI_SIER_RFF0_EN,
> +					&ssi->sier);
> +		}
> +	}
> +
>   	return 0;
>   }
>
> @@ -680,6 +695,8 @@ static int fsl_ssi_probe(struct platform_device *pdev)
>   	       sizeof(fsl_ssi_dai_template));
>   	ssi_private->cpu_dai_drv.name = ssi_private->name;
>
> +	ssi_private->dma = !of_property_read_bool(np, "fsl,imx-fiq");

Instead of looking for the FIQ property, maybe you should just look for 
the absence of a DMA property/node, and then default to interrupts if 
there is no DMA.  That would make it more generic, and even work on 
non-IMX systems.

-- 
Timur Tabi

  reply	other threads:[~2013-04-08  0:18 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-07 19:25 [PATCH v2 00/11] ASoC: fsl-ssi: ac97-slave support Markus Pargmann
2013-04-07 19:25 ` Markus Pargmann
2013-04-07 19:25 ` [PATCH v2 02/11] ASoC: imx-pcm-dma: Add support for DMA init by device node Markus Pargmann
2013-04-07 19:25   ` Markus Pargmann
     [not found] ` <1365362721-3731-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-04-07 19:25   ` [PATCH v2 01/11] ASoC: phycore-ac97: Add DT support Markus Pargmann
2013-04-07 19:25     ` Markus Pargmann
2013-04-08  2:52     ` Timur Tabi
2013-04-08  2:52       ` Timur Tabi
2013-04-10 11:03       ` Markus Pargmann
2013-04-10 11:03         ` Markus Pargmann
2013-04-07 19:25   ` [PATCH v2 03/11] ASoC: imx-pcm-fiq: Introduce pcm-fiq-params Markus Pargmann
2013-04-07 19:25     ` Markus Pargmann
2013-04-07 19:25   ` [PATCH v2 04/11] ASoC: fsl-ssi: Add SACNT definitions Markus Pargmann
2013-04-07 19:25     ` Markus Pargmann
2013-04-08  0:13     ` Timur Tabi
2013-04-08  0:13       ` Timur Tabi
2013-04-07 19:25   ` [PATCH v2 05/11] ASoC: fsl-ssi: Add support for imx-pcm-fiq Markus Pargmann
2013-04-07 19:25     ` Markus Pargmann
2013-04-08  0:18     ` Timur Tabi [this message]
2013-04-08  0:18       ` Timur Tabi
     [not found]       ` <51620CEA.3010703-N01EOCouUvQ@public.gmane.org>
2013-04-14 10:38         ` Markus Pargmann
2013-04-14 10:38           ` Markus Pargmann
2013-04-14 13:37           ` Timur Tabi
2013-04-14 13:37             ` Timur Tabi
2013-04-14 14:10             ` Markus Pargmann
2013-04-14 14:10               ` Markus Pargmann
2013-04-14 14:53               ` Timur Tabi
2013-04-14 14:53                 ` Timur Tabi
     [not found]                 ` <516AC305.2000800-N01EOCouUvQ@public.gmane.org>
2013-04-14 15:20                   ` Markus Pargmann
2013-04-14 15:20                     ` Markus Pargmann
2013-04-14 15:25                     ` Timur Tabi
2013-04-14 15:25                       ` Timur Tabi
2013-04-14 15:44                       ` Markus Pargmann
2013-04-14 15:44                         ` Markus Pargmann
2013-04-15 16:15                       ` Mark Brown
2013-04-15 16:15                         ` Mark Brown
2013-04-07 19:25   ` [PATCH v2 06/11] ASoC: fsl-ssi: Setup generic imx dma params Markus Pargmann
2013-04-07 19:25     ` Markus Pargmann
2013-04-08  2:50     ` Timur Tabi
2013-04-08  2:50       ` Timur Tabi
2013-04-13 13:52       ` Markus Pargmann
2013-04-13 13:52         ` Markus Pargmann
2013-04-07 19:25   ` [PATCH v2 07/11] ARM: imx: Export ac97 reset functions Markus Pargmann
2013-04-07 19:25     ` Markus Pargmann
2013-04-07 19:25   ` [PATCH v2 08/11] ASoC: fsl-ssi: imx ac97 support Markus Pargmann
2013-04-07 19:25     ` Markus Pargmann
2013-04-08  2:49     ` Timur Tabi
2013-04-08  2:49       ` Timur Tabi
2013-04-10 11:33       ` Markus Pargmann
2013-04-10 11:33         ` Markus Pargmann
2013-04-07 19:25   ` [PATCH v2 09/11] ASoC: fsl: Kconfig: Use fsl-ssi for phycore-ac97 Markus Pargmann
2013-04-07 19:25     ` Markus Pargmann
2013-04-07 19:25   ` [PATCH v2 11/11] ASoC: fsl: Update fsl-ssi binding doc Markus Pargmann
2013-04-07 19:25     ` Markus Pargmann
2013-04-07 19:25 ` [PATCH v2 10/11] ASoC: fsl: Move fsl-ssi binding doc to sound/ Markus Pargmann
2013-04-07 19:25   ` Markus Pargmann
2013-04-08  0:20   ` Timur Tabi
2013-04-08  0:20     ` Timur Tabi
2013-04-07 19:39 ` [PATCH v2 00/11] ASoC: fsl-ssi: ac97-slave support Lars-Peter Clausen
2013-04-07 19:39   ` [alsa-devel] " Lars-Peter Clausen
2013-04-07 20:08   ` Markus Pargmann
2013-04-07 20:08     ` [alsa-devel] " Markus Pargmann
     [not found]     ` <20130407200843.GA8350-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-04-07 20:35       ` Lars-Peter Clausen
2013-04-07 20:35         ` Lars-Peter Clausen
2013-04-13 13:32         ` Markus Pargmann
2013-04-13 13:32           ` [alsa-devel] " Markus Pargmann
2013-04-13 13:40           ` Lars-Peter Clausen
2013-04-13 13:40             ` [alsa-devel] " Lars-Peter Clausen
     [not found]             ` <51696034.6060709-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2013-04-13 13:55               ` Markus Pargmann
2013-04-13 13:55                 ` 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=51620CEA.3010703@tabi.org \
    --to=timur@tabi.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=fabio.estevam@freescale.com \
    --cc=grant.likely@secretlab.ca \
    --cc=kernel@pengutronix.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mpa@pengutronix.de \
    --cc=shawn.guo@linaro.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.