public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Jose Abreu <Jose.Abreu@synopsys.com>
Cc: alsa-devel@alsa-project.org,
	Carlos Palminha <CARLOS.PALMINHA@synopsys.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Rob Herring <robh@kernel.org>,
	Alexey Brodkin <Alexey.Brodkin@synopsys.com>,
	linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2 v8] ASoC: dwc: Add PIO PCM extension
Date: Tue, 7 Jun 2016 18:30:45 +0100	[thread overview]
Message-ID: <20160607173045.GE7510@sirena.org.uk> (raw)
In-Reply-To: <09988b615638750c435d95f87906d7974f2b239c.1464601439.git.joabreu@synopsys.com>

[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]

On Mon, May 30, 2016 at 10:53:15AM +0100, Jose Abreu wrote:

A few small things but this looks basically fine.

> +		if (isr[i] & 0x33)
> +			irq_valid = true;

This checks for a mask of 0x33 but...

> +
> +		/*
> +		 * Check if TX fifo is empty. If empty fill FIFO with samples
> +		 * NOTE: Only two channels supported
> +		 */
> +		if ((isr[i] & 0x10) && (i == 0) && dev->use_pio)
> +			dw_pcm_push_tx(dev);
> +
> +		/* Error Handling */
> +		if (isr[i] & 0x20)
> +			dev_err(dev->dev, "TX overrun (ch_id=%d)\n", i);
> +		if (isr[i] & 0x02)
> +			dev_err(dev->dev, "RX overrun (ch_id=%d)\n", i);

...only 0x32 seem to actually be handled, and then only sometimes.  It's
going to be clearer and more robust to just set the handled flag to true
when handling, that way we don't have to match up different numerical
masks.  Some defines would help legibility too.

> +	ret = snd_pcm_lib_malloc_pages(substream,
> +			params_buffer_bytes(hw_params));
> +	return (ret < 0) ? ret : 0;

Write normal if statements please, it helps legibility.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2016-06-07 17:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-30  9:53 [PATCH 0/2 v8] Add I2S audio support for ARC AXS10x boards Jose Abreu
2016-05-30  9:53 ` [PATCH 1/2 v8] ASoC: dwc: Add PIO PCM extension Jose Abreu
2016-06-07 17:30   ` Mark Brown [this message]
2016-05-30  9:53 ` [PATCH 2/2 v8] ASoC: dwc: Add irq parameter to DOCUMENTATION Jose Abreu

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=20160607173045.GE7510@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=Alexey.Brodkin@synopsys.com \
    --cc=CARLOS.PALMINHA@synopsys.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=tiwai@suse.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