[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54802355.4070500@arm.com>
Date: Thu, 04 Dec 2014 09:03:17 +0000
From: Andrew Jackson <Andrew.Jackson@....com>
To: Mark Brown <broonie@...nel.org>
CC: Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Rajeev Kumar <rajeevkumar.linux@...il.com>,
Liam Girdwood <lgirdwood@...il.com>,
Liviu Dudau <Liviu.Dudau@....com>
Subject: Re: [PATCH 3/5] ASoC: dwc: Iterate over all channels
On 12/03/14 17:29, Mark Brown wrote:
> On Wed, Dec 03, 2014 at 04:39:01PM +0000, Andrew Jackson wrote:
>
>> + /* Iterate over set of channels - independently controlled.
>> + */
>> + do {
>> + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
>> + i2s_write_reg(dev->i2s_base, TCR(ch_reg),
>> + xfer_resolution);
>> + i2s_write_reg(dev->i2s_base, TFCR(ch_reg), 0x02);
>> + irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg));
>> + i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x30);
>> + i2s_write_reg(dev->i2s_base, TER(ch_reg), 1);
>> + } else {
>> + i2s_write_reg(dev->i2s_base, RCR(ch_reg),
>> + xfer_resolution);
>> + i2s_write_reg(dev->i2s_base, RFCR(ch_reg), 0x07);
>> + irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg));
>> + i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x03);
>> + i2s_write_reg(dev->i2s_base, RER(ch_reg), 1);
>> + }
>> + } while (ch_reg-- > 0);
>
> The normal way to write an iteration would be with a for loop - why are
> we not doing that?
The intention was to minimise the changes, excluding whitespace, between this version and the original. Also, it is a perfectly valid looping construct. I'm happy to rework it into a for loop.
> Also I see that you've not sent these as a single thread - please use
> --thread.
>
Andrew
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists