All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sangbeom Kim <sbkim73@samsung.com>
To: 'Jassi Brar' <jassisinghbrar@gmail.com>
Cc: alsa-devel@alsa-project.org, kgene.kim@samsung.com,
	broonie@opensource.wolfsonmicro.com,
	linux-samsung-soc@vger.kernel.org, ben-linux@fluff.org,
	lrg@slimlogic.co.uk
Subject: RE: [alsa-devel] [PATCH 2/4] ASoC: SAMSUNG: Add I2S0 internal dma driver
Date: Mon, 13 Jun 2011 16:55:51 +0900	[thread overview]
Message-ID: <005001cc299f$5105b850$f31128f0$@com> (raw)
In-Reply-To: <BANLkTikND3dyqmi9xj93ZDPh2-NaXo_jTA@mail.gmail.com>

On Thu, Jun 10, 2011 at 7:08 PM, Jassi Brar wrote:
> For my convenience, could you please tell how does it differ from my
> original implementation?  Most things look same, except for a few
> variables.
Original code only can support specific buffer size and period count.
New idma driver can work with various buffer size and multiple period.
And Original code is implemented it based on wrapper arch.
But This patch can support driver arch.

> 
> > @@ -16,6 +17,7 @@ obj-$(CONFIG_SND_S3C_I2SV2_SOC) += snd-soc-s3c-i2s-
> v2.o
> >  obj-$(CONFIG_SND_SAMSUNG_SPDIF) += snd-soc-samsung-spdif.o
> >  obj-$(CONFIG_SND_SAMSUNG_PCM) += snd-soc-pcm.o
> >  obj-$(CONFIG_SND_SAMSUNG_I2S) += snd-soc-i2s.o
> > +obj-$(CONFIG_SND_SAMSUNG_I2S) += snd-soc-idma.o
> 
> Please check that building only for s3c64xx doesn't break by this.
If It have building problem, I will modify it in the next version

> 
> > +
> > +static struct idma_info {
> > +       spinlock_t      lock;
> > +       void             __iomem  *regs;
> > +       int             trigger_stat;
> The role of trigger_stat is not necessary.
trigger_stat can be used LP audio mode.
It can be used flag for checking idma operation.


> > +
> > +       /* Start address0 of I2S internal DMA operation. */
> > +       val = readl(idma.regs + I2SSTR0);
> Why read when you immediately overwrite it ?
This is useless code, It will be deleted.
 
> > +static int idma_hw_params(struct snd_pcm_substream *substream,
> > +                               struct snd_pcm_hw_params *params)
> > +{
> > +       struct snd_pcm_runtime *runtime = substream->runtime;
> > +       struct idma_ctrl *prtd = substream->runtime->private_data;
> > +
> > +       pr_debug("Entered %s\n", __func__);
> can we have all the pr_debug's converted to dev_debug ?
OK, I will change it.
 
> 
> > +       snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
> > +       runtime->dma_bytes = params_buffer_bytes(params);
> > +       memset(runtime->dma_area, 0, runtime->dma_bytes);
> Is it really needed ?
It can delete useless data in dma buffer.
But It looks not need absolutely.

> > +
> > +       if (iisahb & AHB_LVL0INT)
> > +               val = AHB_CLRLVL0INT;
> > +       else
> > +               val = 0;
>   val = (iisahb & AHB_LVL0INT) ? AHB_CLRLVL0INT : 0;     looks better
OK, I will change
> > +
> > +       if (val) {
> > +               iisahb |= val;
> > +               writel(iisahb, idma.regs + I2SAHB);
> > +
> > +               addr = readl(idma.regs + I2SLVL0ADDR);
> > +               addr += prtd->periodsz;
> > +
> > +               if (addr >= prtd->end)
> > +                       addr = LP_TXBUFF_ADDR;
> This will break if ring buffer is not a multiple of period size.
> Either set the constraint in open or do modulo operation here.
OK,

> > +
> > +static int idma_close(struct snd_pcm_substream *substream)
> > +{
> > +       struct snd_pcm_runtime *runtime = substream->runtime;
> > +       struct idma_ctrl *prtd = runtime->private_data;
> > +
> > +       pr_debug("Entered %s, prtd = %p\n", __func__, prtd);
> > +
> > +       free_irq(IRQ_I2S0, prtd);
> > +
> > +       if (!prtd)
> > +               pr_err("idma_close called with prtd == NULL\n");
> > +
> > +       kfree(prtd);
> 
> Also       runtime->private_data = NULL;
OK,

> > diff --git a/sound/soc/samsung/idma.h b/sound/soc/samsung/idma.h
> > new file mode 100644
> > index 0000000..2b0ac37
> > --- /dev/null
> > +++ b/sound/soc/samsung/idma.h
> > @@ -0,0 +1,28 @@
> > +/*
> > + * idma.h  --  I2S0's Internal Dma driver
> > + *
> > + * Copyright (c) 2010 Samsung Electronics Co. Ltd
> Copyright 2011 ?
OK, I will modify it.
> 
> > +/* idma_state */
> > +#define LPAM_DMA_STOP    0
> > +#define LPAM_DMA_START   1
> These are internal to idma.c, please move them there.
OK, I will move it.

Thanks,

  reply	other threads:[~2011-06-13  7:55 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09  8:09 [PATCH 0/4] Adding idma driver for samsung SoCs Sangbeom Kim
2011-06-09  8:09 ` [PATCH 1/4] ASoC: SAMSUNG: Modify I2S driver to support idma Sangbeom Kim
2011-06-10 11:31   ` Jassi Brar
2011-06-13  7:58     ` [alsa-devel] " Sangbeom Kim
2011-06-13  8:57       ` Jassi Brar
2011-06-09  8:09 ` [PATCH 2/4] ASoC: SAMSUNG: Add I2S0 internal dma driver Sangbeom Kim
2011-06-09  9:50   ` Liam Girdwood
2011-06-09 23:31     ` Sangbeom Kim
2011-06-09 12:33   ` Kyungmin Park
2011-06-09 23:41     ` [alsa-devel] " Sangbeom Kim
2011-06-10 10:08   ` Jassi Brar
2011-06-13  7:55     ` Sangbeom Kim [this message]
2011-06-13  9:07       ` [alsa-devel] " Jassi Brar
2011-06-13  9:40       ` Jassi Brar
2011-06-09  8:09 ` [PATCH 3/4] ASoC: SAMSUNG: Change platform driver for SMDKs Sangbeom Kim
2011-06-09 10:46   ` Mark Brown
2011-06-09 23:36     ` [alsa-devel] " Sangbeom Kim
2011-06-10  7:03   ` Jassi Brar
2011-06-10  7:16     ` [alsa-devel] " Sangbeom Kim
2011-06-10  7:26       ` Jassi Brar
2011-06-10  9:49         ` [alsa-devel] " Mark Brown
2011-06-10 10:12           ` Jassi Brar
2011-06-10 10:16             ` Mark Brown
2011-06-10 10:43               ` [alsa-devel] " Jassi Brar
2011-06-13  1:47         ` Sangbeom Kim
2011-06-09  8:09 ` [PATCH 4/4] ARM: SAMSUNG: Add platform device for idma Sangbeom Kim

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='005001cc299f$5105b850$f31128f0$@com' \
    --to=sbkim73@samsung.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=ben-linux@fluff.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    /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.