Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp695079pxb; Fri, 3 Sep 2021 11:16:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsNNQ30c1vf2cUwFZAZnQj7QxTTAZpALzn0rRAdPyXNQ0cPaHW7Mbg9mHnAaVvCrSZtxT5 X-Received: by 2002:a05:6402:d66:: with SMTP id ec38mr310148edb.234.1630692962251; Fri, 03 Sep 2021 11:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630692962; cv=none; d=google.com; s=arc-20160816; b=vMOyeQF1/JVWM/2SwJ0ojTBvs6By63CN/PHKr06a3N0vpVeHcAAQLRA6tCEgIda2N1 MYG8X8GntvjMi6m6467H49djLc+ji/j6LbqSBZheCLFA+xFTuSmOG3kwM8Y90s40mHQG S5b4LtXAZxgxHN1LsnasNAAJO49QhyT9RSRB/pdjfMiOioL0AHkPW1Hhf3YoT8P1wfQ8 elPov5/WeQJ11wMZcGaSo1YiocpyECmJ8xs8Zf80z25SKSmpnqO+9u+wTAATI+Fq0sCY ccbsagyyExj2jp5E6cuHM672S8TKOLQ76Rqe8TVERjW/drmK4JPnbTHZVYHyanq0153g KV/w== 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=zJn+7MSpyLw2mY8//FRv6jaFcB1tf478SJ/M2iHtt6k=; b=L+Y2sKFkhRx0L1Tw4LuskzFznsO71Z0S4g7vZlGUWqYn4BznqX46sJ5tGuC0IjnfTR L/cJ79IGjKrAEReiNXRH1tfIDRrUaHW9gd5H7+z2pRbpS9ecmLo8WxeXtfkE1az+hK2L RS0xAAFfFSYTX1WF9GTfIV8sJ7ZlgtNxu2JQm5Nn3eVOx5z0CAu6ejMSO7fclNdSGo/9 78rtPx138TtmaCq7WoWul94ePn5GiqYXFBZBaxsNh31cXHsYDxsVpS0zdGEEiZ3ulScx 11DDG7VsgAN2box5lh/L6FpMRmY7OmGbnS5HmyKN1tj2KtxWaL+1SzkrGFdySxV6bQh+ cWxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Lciq/IIh"; 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 js5si6797859ejc.249.2021.09.03.11.15.38; Fri, 03 Sep 2021 11:16:02 -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=k20201202 header.b="Lciq/IIh"; 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 S1350386AbhICSPA (ORCPT + 99 others); Fri, 3 Sep 2021 14:15:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:50856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349959AbhICSO7 (ORCPT ); Fri, 3 Sep 2021 14:14:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2B4C160FDC; Fri, 3 Sep 2021 18:13:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630692839; bh=HV5QwvXd+G5X5BE1dhVVGio0bsaKoGZQ54JzrFuQYv0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Lciq/IIhEguLoSiuOCa3XnH+5hiXq2Wu1ONakJhGocr7FJdzgxKE4kURLzk4xQ4VB Y8/2+KZQSSO3t43Lp8CWIXOzwuPAEnzEp2vJVnsbgEi2aPjZVuwCd+3SZs2hPscwZa XoXam/PdM0Bws8VmCfY0b8smn4vrsTBx72sfmECTcSE63UYe+gyPJmlF86RSY27gNs JUvcpfmIrjM1PBLHsUOdJLZZUhdNMntp/mgpfmeIbB/OjxuPFfJox82Rk4p6LgLOsN WSaPfB8bmkyKOiRk9tMp51gEu3vEPqTurOqCy2h4yWuvBCIdTJxEBp4HWECVcKIKQ4 MCQw79usdNxrg== Date: Fri, 3 Sep 2021 19:13:26 +0100 From: Mark Brown To: Sameer Pujar Cc: lgirdwood@gmail.com, robh+dt@kernel.org, thierry.reding@gmail.com, jonathanh@nvidia.com, catalin.marinas@arm.com, will@kernel.org, perex@perex.cz, tiwai@suse.com, kuninori.morimoto.gx@renesas.com, sharadg@nvidia.com, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 06/13] ASoC: tegra: Add Tegra210 based MVC driver Message-ID: <20210903181326.GP4932@sirena.org.uk> References: <1630056839-6562-1-git-send-email-spujar@nvidia.com> <1630056839-6562-7-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NDuspjMMC1Ui5ypn" Content-Disposition: inline In-Reply-To: <1630056839-6562-7-git-send-email-spujar@nvidia.com> X-Cookie: Darth Vader sleeps with a Teddywookie. User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --NDuspjMMC1Ui5ypn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Aug 27, 2021 at 03:03:52PM +0530, Sameer Pujar wrote: > The Master Volume Control (MVC) provides gain or attenuation to a digital > signal path. It can be used in input or output signal path for per-stream > volume control or it can be used as master volume control. The MVC block > has one input and one output. The input digital stream can be mono or > multi-channel (up to 7.1 channels) stream. An independent mute control is > also included in the MVC block. Looks like it's also got a little bit of other DSP in there (a simple EQ?). Not that it really matters. > + if (reg == TEGRA210_MVC_CTRL) { > + u32 val; > + u8 mute_mask; > + } else { > + u8 chan = (reg - TEGRA210_MVC_TARGET_VOL) / REG_SIZE; > + s32 val = mvc->volume[chan]; It's not clear to me why we're using the same callbacks for the volume and mute settings - there's no shared code on the read path and only a tiny bit on the write path. > + err |= regmap_update_bits(mvc->regmap, TEGRA210_MVC_SWITCH, > + TEGRA210_MVC_VOLUME_SWITCH_MASK, > + TEGRA210_MVC_VOLUME_SWITCH_TRIGGER); > + > +end: > + pm_runtime_put(cmpnt->dev); > + return err; > +} _put() should return 0 if there's no change or 1 for a change. > + /* SW reset */ > + regmap_write(mvc->regmap, TEGRA210_MVC_SOFT_RESET, 1); What about all the cached values in the regmap, won't they get out of sync? Especially things like volume and mute, it looks like the mute just gets written directly to the regmap and not otherwise saved. --NDuspjMMC1Ui5ypn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmEyZcUACgkQJNaLcl1U h9AgMggAha/hIL9322l4CAz3Clg/xsZLabDdWCuHA9GA1Ze39XOrtPyBmwNyBOyj Re3PVvnBfeCzpGooqKXpTcdKaxiqBnF2ewOPcTLNrG3gnuAYR8X2NDbzFHd6rr3e frclpdZMOypNILokwrytDJG1ssscBTapV5KC3xjwQjqSAp2ckVRGgg+5SE++B1BV yrZuTVHJtmK3Sk78YYcYizgOndIGAOFHX48tLa81LaiSWUlePraGXtEXa8pzmSN0 uJkPyzGdiTK4bLBJgC75bOMuy/oI2Q+nsG/K6+grY7VjcuZaS94qsjngFJCdgz4U U3mbKcLaeF8Ov8lIpr4tKJn0THvJdw== =uPdC -----END PGP SIGNATURE----- --NDuspjMMC1Ui5ypn--