[alsa-devel] [PATCH 3/9] ASoC: amd: dma driver changes for BT I2S controller instance

Mark Brown broonie at kernel.org
Mon Feb 19 17:45:25 CET 2018


On Fri, Feb 16, 2018 at 01:03:48PM +0530, Vijendar Mukunda wrote:

> Implemented dma driver changes to support BT I2S controller
> instance.

Some sort of description of the changes would make this a lot easier to
review.

> +		if (strcmp(prtd->cpu_dai->name, "designware-i2s.1.auto") == 0) {
> +			adata->i2s_play_instance = I2S_SP_INSTANCE;
> +			adata->i2ssp_renderbytescount = 0;
> +		}
> +		if (strcmp(prtd->cpu_dai->name, "designware-i2s.3.auto") == 0) {
> +			adata->i2s_play_instance = I2S_BT_INSTANCE;
> +			adata->i2sbt_renderbytescount = 0;
> +		}

This strcmp on what looks like an autogenerated DAI name seems a bit
fragile, especially given that we just silently accept cases where we
fail to match anything.  Why are we doing things this way rather than
at least using explicitly set names?

> +	if (adata->asic_type != CHIP_CARRIZO) {
> +		if (adata->play_i2sbt_stream &&
> +			adata->play_i2sbt_stream->runtime) {

As ever please use switch statements for quirking, it makes life easier
when more variants appear.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20180219/e5bf501b/attachment.sig>


More information about the Alsa-devel mailing list