Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1416444

Re: [PATCH 1/2 v8] ASoC: dwc: Add PIO PCM extension

From Mark Brown <broonie@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2 v8] ASoC: dwc: Add PIO PCM extension
Date 2016-06-07 19:40 +0200
Message-ID <rHt8R-5BX-7@gated-at.bofh.it> (permalink)
References <rEs9j-2s5-15@gated-at.bofh.it> <rEs9j-2s5-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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.

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH 1/2 v8] ASoC: dwc: Add PIO PCM extension Mark Brown <broonie@kernel.org> - 2016-06-07 19:40 +0200

csiph-web