From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH 2/4] ASoC: fsi: Add FIFO size calculate
Date: Thu, 25 Mar 2010 08:56:14 +0000 [thread overview]
Message-ID: <1269507374.3758.2.camel@odin> (raw)
In-Reply-To: <uk4t1unsy.wl%morimoto.kuninori@renesas.com>
On Thu, 2010-03-25 at 11:39 +0900, Kuninori Morimoto wrote:
>
> > > + dev_dbg(dai->dev, "fifo = %d words\n", fsi->fifo_max);
> > > +
> > > + for (i = 1; i < fsi->chan; i *= 2)
> > > + if (fsi->chan > i)
> > > + fsi->fifo_max >>= 1;
> >
> > Is the if really needed here. You may also want to calculate the shift
> > size rather than looping too.
>
> This calculate number of sample data.
> And it is depend on channel size.
> If chip fifo size is 256, the number of sample data will be...
>
> 1 chan : 256 (256 x 1 = 256)
> 2 chan : 128 (128 x 2 = 256)
> 3 chan : 64 ( 64 x 3 = 192)
> 4 chan : 64 ( 64 x 4 = 256)
> 5 chan : 32 ( 32 x 5 = 160)
> 6 chan : 32 ( 32 x 6 = 192)
> 7 chan : 32 ( 32 x 7 = 224)
> 8 chan : 32 ( 32 x 8 = 256)
>
> Above calculation is needed. but yes un-understandable.
> I don't know a method computable by one line.
> So, I will add tiny comment/document here.
> OK ?
>
Yes, this sounds fine :)
It wasn't understandable from the original code.
Thanks
Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
next prev parent reply other threads:[~2010-03-25 8:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-24 6:26 [PATCH 0/4] ASoC: fsi: FSI2 device support Kuninori Morimoto
2010-03-17 5:26 ` [PATCH 2/4] ASoC: fsi: Add FIFO size calculate Kuninori Morimoto
2010-03-24 9:46 ` Liam Girdwood
2010-03-25 2:39 ` Kuninori Morimoto
2010-03-25 8:56 ` Liam Girdwood [this message]
2010-03-23 2:47 ` [PATCH 3/4] ASoC: fsi: IRQ related process had be united Kuninori Morimoto
2010-03-24 9:48 ` Liam Girdwood
2010-03-24 6:27 ` [PATCH 1/4] ASoC: fsi: ensures process inside master lock Kuninori Morimoto
2010-03-24 9:49 ` Liam Girdwood
2010-03-24 6:27 ` [PATCH 4/4] ASoC: fsi: Add FSI2 device support Kuninori Morimoto
2010-03-24 9:50 ` Liam Girdwood
2010-03-24 9:33 ` [PATCH 0/4] ASoC: fsi: " Liam Girdwood
2010-03-24 11:19 ` Mark Brown
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=1269507374.3758.2.camel@odin \
--to=lrg@slimlogic.co.uk \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=morimoto.kuninori@renesas.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 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.