From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Brown Subject: Re: [PATCH 3/9] ASoC: amd: dma driver changes for BT I2S controller instance Date: Mon, 19 Feb 2018 16:45:25 +0000 Message-ID: <20180219164525.GJ32761@sirena.org.uk> References: <1518766434-7911-1-git-send-email-Vijendar.Mukunda@amd.com> <1518766434-7911-4-git-send-email-Vijendar.Mukunda@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6486190144028349583==" Return-path: Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 094A9266E78 for ; Mon, 19 Feb 2018 17:45:27 +0100 (CET) In-Reply-To: <1518766434-7911-4-git-send-email-Vijendar.Mukunda@amd.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Vijendar Mukunda Cc: alsa-devel@alsa-project.org, tiwai@suse.de, lgirdwood@gmail.com, Akshu Agrawal , Alexander.Deucher@amd.com List-Id: alsa-devel@alsa-project.org --===============6486190144028349583== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="d6iqOn7HZPWKXx18" Content-Disposition: inline --d6iqOn7HZPWKXx18 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --d6iqOn7HZPWKXx18 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlqK/yQACgkQJNaLcl1U h9AHBAf+KXY0WWNcvzvSAw1aJGDHDrdvp2FXr5DSlXfQYL1C6FE19vRvSr9Ih63l YmSwM+DxrVX7h/KFpTaDk7rDDRpYLT5pjtxNLtWNt4n5moQe0tePoXgokZ9t29cx tEuyhgJoxqol0CneMMowGhitw1uEGoNzfG20mLt7Yzcry+Yafi7oRhvgTTVEfnzG iERkiwskxLlHY932nLlZqpLQwiMLInyQGOES1EVNBhNzPXPwMUexjKBU3YBsO3Pp berEPv4aUvqP3+D/XiQjzGJTTtnAqEnlOPzaqJLeyU0+dFcgVBK/14GJJ47LSNM5 q8ssK38Nvs+ri1KkVUTVso00hv4Abw== =oJg1 -----END PGP SIGNATURE----- --d6iqOn7HZPWKXx18-- --===============6486190144028349583== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============6486190144028349583==--