Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp378074pxx; Mon, 26 Oct 2020 10:32:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziUcC5rpa7WElm9CDzfPK4Fa0Y4XJ7hvAig20DHKSDWv8fp9sDDSeJw1eQCerqFq5hGrjY X-Received: by 2002:a17:906:4816:: with SMTP id w22mr17580534ejq.458.1603733523719; Mon, 26 Oct 2020 10:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603733523; cv=none; d=google.com; s=arc-20160816; b=nheEk1DG1A4c1THfVPxuzg1clXnbN1Kk0HSLGkQL16cmQld2S7voYr9/gT/8BUJsYb cru0ibVa4QYAnOBoilUbzFp5xg78nqRpGBsy1qNSmFf0CIIr5lShLxe9Z0w6Ceh0v0Vp E2Ps0xQxZskKbYtvXpkUPfBZhRHLqKlOqmdRAu77usOut6vWpdihL5m8ggPyJNum2djC LTF+rsdADwSEylgFcBxePk8SQFfDjZVDZ2bnHcHeJBZxwTTPVbfYubpsxtwrUxRwsoBf k3jETXoBz0PiieG2fWFXfUvBVcuBhaReg8IkqBne8Jg4chc0hevH5AVZ/AtikdB1HL1Z GRig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=1Luc7rFVakmPJx10LACQc96iMK7olhlGJ5fgoAYjbtA=; b=twb600C4TjWbUSmttGOwH5hpFCCh45bZsWpH6msYtoSOaEvYNmgnuRcTlNH4xlKVVx HNeDrV/2+Fbfdaj900QExC0pY1klLdNPntqruYpRU6q06JUv85bBju/oBxkZq1YxyzgD a7R0RFCZ0/FPsd2bbxE3uuG1jufBVf8yVqg/Y3AI56+enDGYtkHDR6fZm4Om/W48QNJL CNyC+BfCEublDo+LRT0eaS+WqmVpIo3nd/+M0M7m2utkPkVMNnavaxblL7GnFJJvTbRy rx/6QzYR2QKibhd0qbC4y1UQgfY9jqRF/CfyXTup+k6z9DFuBtjqEyw0e823BYp98GNm OImA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="sYC1/7QI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si7290002eje.415.2020.10.26.10.31.41; Mon, 26 Oct 2020 10:32:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="sYC1/7QI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1780046AbgJZNaM (ORCPT + 99 others); Mon, 26 Oct 2020 09:30:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:35788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1780033AbgJZNaJ (ORCPT ); Mon, 26 Oct 2020 09:30:09 -0400 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0EB0624641; Mon, 26 Oct 2020 13:30:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603719008; bh=47xZnNmgaWb2Nvry34Wr0Gg1IlbyBbZg6E0TRu2Og8U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sYC1/7QI8zplIgXIdmH+wo8zWU0rdI7LtnjUjK9PriIjHJka+pxMljrbGIEGcjpJ0 HDpl8AcGB6iuB+R8Q1SwfdWqvIymNTn4VmxiY0kDQei4uVUCjqj96VDBcnOv36RiTH NlNQV4mCEqg64Iv5xk3NrhwW3oTlHPWK4Ccl+LOY= Date: Mon, 26 Oct 2020 13:30:03 +0000 From: Mark Brown To: Shengjiu Wang Cc: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, lgirdwood@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] ASoC: fsl_aud2htx: Add aud2htx module driver Message-ID: <20201026133003.GD7402@sirena.org.uk> References: <1603708855-2663-1-git-send-email-shengjiu.wang@nxp.com> <1603708855-2663-2-git-send-email-shengjiu.wang@nxp.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qGV0fN9tzfkG3CxV" Content-Disposition: inline In-Reply-To: <1603708855-2663-2-git-send-email-shengjiu.wang@nxp.com> X-Cookie: Safety Third. User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qGV0fN9tzfkG3CxV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 26, 2020 at 06:40:55PM +0800, Shengjiu Wang wrote: > +static int fsl_aud2htx_hw_params(struct snd_pcm_substream *substream, > + struct snd_pcm_hw_params *params, > + struct snd_soc_dai *cpu_dai) > +{ > + struct fsl_aud2htx *aud2htx = snd_soc_dai_get_drvdata(cpu_dai); > + > + /* DMA request when number of entries < WTMK_LOW */ > + regmap_update_bits(aud2htx->regmap, AUD2HTX_CTRL_EXT, > + AUD2HTX_CTRE_DT_MASK, 0); > + > + /* Disable interrupts*/ > + regmap_update_bits(aud2htx->regmap, AUD2HTX_IRQ_MASK, > + AUD2HTX_WM_HIGH_IRQ_MASK | > + AUD2HTX_WM_LOW_IRQ_MASK | > + AUD2HTX_OVF_MASK, > + AUD2HTX_WM_HIGH_IRQ_MASK | > + AUD2HTX_WM_LOW_IRQ_MASK | > + AUD2HTX_OVF_MASK); > + > + /* Configur watermark */ > + regmap_update_bits(aud2htx->regmap, AUD2HTX_CTRL_EXT, > + AUD2HTX_CTRE_WL_MASK, > + AUD2HTX_WTMK_LOW << AUD2HTX_CTRE_WL_SHIFT); > + regmap_update_bits(aud2htx->regmap, AUD2HTX_CTRL_EXT, > + AUD2HTX_CTRE_WH_MASK, > + AUD2HTX_WTMK_HIGH << AUD2HTX_CTRE_WH_SHIFT); > + return 0; > +} This doesn't look like a hw_params operation - it doesn't appear to reference the params at all, or even containt any conditional statements. Shouldn't this be configured just once at driver load? --qGV0fN9tzfkG3CxV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl+Wz1sACgkQJNaLcl1U h9BRkgf9GJDUVG/3LsgNUi10w457aA3PPnnK/cZnW28xpxfqtNNpZ2+HycVG+ky1 qwJAezTyWBG+OP2aZy3h8F68htNT3KqgkybywSCjdE8/wSqvTT42KTRDbqJuhr1F Mnx1+Opres2oQkJqcTUqUkcnIc4gSSZYR9vzzUF7oRPgxF6AKTFLwFfDSsve8Nds b1oJ6xeiAXrNZM+S1+ESvuaSlZzrK3fL00OxgFG0IjELhy+Wcasf+5QKbiego3BK 2PcYrQjRLqXCqXOw9ABpKZWUqruNAf6JuRryoGETL+OPP2uXRuwh5lXIhUKfNosa tv1qtawmZN4dyUUGxBPWVV44Lf1FPw== =1hAM -----END PGP SIGNATURE----- --qGV0fN9tzfkG3CxV--