public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jhnikula@gmail.com>
To: Eduardo Valentin <eduardo.valentin@nokia.com>
Cc: Linux-OMAP <linux-omap@vger.kernel.org>,
	ALSA-Devel <alsa-devel@vger.kernel.org>,
	"Nurkkala Eero.An (EXT-Offcode/Oulu)"
	<ext-Eero.Nurkkala@nokia.com>,
	"\\\"Ujfalusi Peter (Nokia-D/Tampere)\\\""
	<peter.ujfalusi@nokia.com>
Subject: Re: [PATCHv2 16/20] ASoC: OMAP: Use DMA operating mode of McBSP
Date: Wed, 12 Aug 2009 15:38:38 +0300	[thread overview]
Message-ID: <20090812153838.d71f3c88.jhnikula@gmail.com> (raw)
In-Reply-To: <1249995931-26015-17-git-send-email-eduardo.valentin@nokia.com>

On Tue, 11 Aug 2009 16:05:27 +0300
Eduardo Valentin <eduardo.valentin@nokia.com> wrote:

> From: Eduardo Valentin <eduardo.valentin@nokia.com>
> 
> Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
> ---
>  sound/soc/omap/omap-mcbsp.c |    8 ++++++--
>  sound/soc/omap/omap-pcm.c   |   13 +++++++++++--
>  sound/soc/omap/omap-pcm.h   |    1 +
>  3 files changed, 18 insertions(+), 4 deletions(-)
> 
...
> diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
> index 0c1ba0f..d8f52e8 100644
> --- a/sound/soc/omap/omap-pcm.c
> +++ b/sound/soc/omap/omap-pcm.c
> @@ -144,7 +144,9 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream)
>  
>  	memset(&dma_params, 0, sizeof(dma_params));
>  
> -	if (cpu_is_omap34xx())
> +	/* TODO: Currently, MODE_ELEMENT == MODE_FRAME */
> +	if (cpu_is_omap34xx() &&
> +			(dma_data->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD))
>  		sync_mode = OMAP_DMA_SYNC_FRAME;
>  	else
>  		sync_mode = OMAP_DMA_SYNC_ELEMENT;

Note, you could avoid the compile error if you move this into
omap-mcbsp.c and pass only sync_mode here. Probably as easy as
dma_data->sync_mode since OMAP_DMA_SYNC_ELEMENT is zero.

The McBSP DAI must and can know the DMA parameters (like sync_mode) but
otherwise (like MCBSP_DMA_MODE_xxx) it sounds unnecessary glue between
the drivers.

> @@ -193,9 +195,16 @@ static int omap_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
>  	struct omap_pcm_dma_data *dma_data = prtd->dma_data;
>  	unsigned long flags;
>  	int ret = 0;
> -	int samples = snd_pcm_lib_period_bytes(substream) >> 1;
> +	int samples;
>  
>  	spin_lock_irqsave(&prtd->lock, flags);
> +
> +	/* TODO: Currently, MODE_ELEMENT == MODE_FRAME */
> +	if (dma_data->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD)
> +		samples = snd_pcm_lib_period_bytes(substream) >> 1;
> +	else
> +		samples = 1;
> +

Can these lines in this patch and in patch 15 to be moved into
omap_mcbsp_trigger? For me it looks it would simplify and remove the
glue between the drivers.


-- 
Jarkko

  parent reply	other threads:[~2009-08-12 12:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-11 13:05 [PATCHv2 00/20] OMAP ASoC changes in DMA utilization Eduardo Valentin
2009-08-11 13:05 ` [PATCHv2 01/20] OMAP: McBSP: Provide functions for ASoC frame syncronization Eduardo Valentin
2009-08-11 13:05   ` [PATCHv2 02/20] OMAP: McBSP: Add IRQEN, IRQSTATUS, THRESHOLD2 and THRESHOLD1 registers Eduardo Valentin
2009-08-11 13:05     ` [PATCHv2 03/20] OMAP: McBSP: Use appropriate value for startup delay Eduardo Valentin
2009-08-11 13:05       ` [PATCHv2 04/20] OMAP: McBSP: Add transmit/receive threshold handler Eduardo Valentin
2009-08-11 13:05         ` [PATCHv2 05/20] OMAP: McBSP: Create and export max_(r|t)x_thres property Eduardo Valentin
2009-08-11 13:05           ` [PATCHv2 06/20] OMAP3: McBSP: Lower the maximum buffersize for McBSP1,3,4,5 Eduardo Valentin
2009-08-11 13:05             ` [PATCHv2 07/20] OMAP: McBSP: Rename thres sysfs symbols Eduardo Valentin
2009-08-11 13:05               ` [PATCHv2 08/20] OMAP: McBSP: Add link DMA mode selection Eduardo Valentin
2009-08-11 13:05                 ` [PATCHv2 09/20] OMAP: McBSP: Wakeups utilized Eduardo Valentin
2009-08-11 13:05                   ` [PATCHv2 10/20] OMAP: McBSP: Change wakeup signals Eduardo Valentin
2009-08-11 13:05                     ` [PATCHv2 11/20] OMAP: McBSP: Retain McBSP FCLK clockactivity Eduardo Valentin
2009-08-11 13:05                       ` [PATCHv2 12/20] OMAP: McBSP: Configure NO IDLE mode for DMA mode different of threshold Eduardo Valentin
2009-08-11 13:05                         ` [PATCHv2 13/20] OMAP: McBSP: Do not enable wakeups for no-idle mode Eduardo Valentin
2009-08-11 13:05                           ` [PATCHv2 14/20] OMAP: McBSP: Let element DMA mode hit retention also Eduardo Valentin
2009-08-11 13:05                             ` [PATCHv2 15/20] ASoC: OMAP: Use McBSP threshold to playback and capture Eduardo Valentin
2009-08-11 13:05                               ` [PATCHv2 16/20] ASoC: OMAP: Use DMA operating mode of McBSP Eduardo Valentin
2009-08-11 13:05                                 ` [PATCHv2 17/20] ASoC: OMAP: Make DMA 64 aligned Eduardo Valentin
2009-08-11 13:05                                   ` [PATCHv2 18/20] ASoC: OMAP: Enable DMA burst mode Eduardo Valentin
2009-08-11 13:05                                     ` [PATCHv2 19/20] ASoC: Add runtime check for RFIG and XFIG Eduardo Valentin
2009-08-11 13:05                                       ` [PATCHv2 20/20] ASoC: Always syncronize audio transfers on frames Eduardo Valentin
2009-08-12 12:38                                 ` Jarkko Nikula [this message]
2009-08-12 13:03                                   ` [PATCHv2 16/20] ASoC: OMAP: Use DMA operating mode of McBSP Eduardo Valentin
2009-08-12 11:51                 ` [PATCHv2 08/20] OMAP: McBSP: Add link DMA mode selection Jarkko Nikula

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=20090812153838.d71f3c88.jhnikula@gmail.com \
    --to=jhnikula@gmail.com \
    --cc=alsa-devel@vger.kernel.org \
    --cc=eduardo.valentin@nokia.com \
    --cc=ext-Eero.Nurkkala@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=peter.ujfalusi@nokia.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox