Re: [PATCH 06/13] ASoC: tegra: Add Tegra210 based MVC driver

From
Mark Brown <broonie@kernel.org>
Date
2021-09-03 18:14:02
Also in
alsa-devel, linux-arm-kernel, linux-tegra, lkml
Reply to
Sameer Pujar, 2021-08-27
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.
quoted hunk ↗ jump to hunk
+	if (reg == TEGRA210_MVC_CTRL) {
+		u32 val;
+		u8 mute_mask;
quoted hunk ↗ jump to hunk
+	} 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.
quoted hunk ↗ jump to hunk
+	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.

Attachments

Thread (22 messages) 22 messages, 4 authors, last reply 2021-10-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help