[alsa-devel] [PATCH v3 3/5] ASoC: usp-pcm: add CPU DAI driver for PCM simulated from USP
Mark Brown
broonie at kernel.org
Mon Jan 6 18:20:43 CET 2014
On Fri, Jan 03, 2014 at 02:05:02PM +0800, RongJun Ying wrote:
> +static void sirf_usp_tx_fifo_op(struct sirf_usp *susp, int cmd)
> +{
> + switch (cmd) {
> + case FIFO_RESET:
> + writel(USP_TX_FIFO_RESET, susp->base + USP_TX_FIFO_OP);
> + writel(0, susp->base + USP_TX_FIFO_OP);
> + break;
> + case FIFO_START:
> + writel(USP_TX_FIFO_START, susp->base + USP_TX_FIFO_OP);
> + break;
> + case FIFO_STOP:
> + writel(0, susp->base + USP_TX_FIFO_OP);
> + break;
> + }
> +}
I'm not sure these functions and the switch statements in them are
adding anything - none of the statements share any code. Either
refactor this so that the callers pass in USP_TX_FIFO_blah for the
argument or just inline the register operations.
> +static inline void sirf_usp_tx_enable(struct sirf_usp *susp)
> +{
> + writel(readl(susp->base + USP_TX_RX_ENABLE) | USP_TX_ENA,
> + susp->base + USP_TX_RX_ENABLE);
> +}
Similar thing here, just inline.
> +static int sirf_usp_pcm_dai_probe(struct snd_soc_dai *dai)
> +{
> + dai->playback_dma_data = &dma_data[0];
> + dai->capture_dma_data = &dma_data[1];
snd_soc_dai_init_dma_data().
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20140106/e6ea2694/attachment.sig>
More information about the Alsa-devel
mailing list