Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: simple-mux: add read function

During initialisation DAPM tries to read the state of the MUX
being connected, resulting in this error log:
input-mux: ASoC: error at soc_component_read_no_lock on input-mux: -5

Provide a read function which allows DAPM to read the state of the
MUX.

Signed-off-by: Maarten Zanders <maarten.zanders@mind.be>
Link: https://lore.kernel.org/r/20221028191303.166115-1-maarten.zanders@mind.be
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Maarten Zanders and committed by
Mark Brown
f7d97cb5 a984d833

+9
+9
sound/soc/codecs/simple-mux.c
··· 55 55 e, NULL); 56 56 } 57 57 58 + static unsigned int simple_mux_read(struct snd_soc_component *component, 59 + unsigned int reg) 60 + { 61 + struct simple_mux *priv = snd_soc_component_get_drvdata(component); 62 + 63 + return priv->mux; 64 + } 65 + 58 66 static const struct snd_kcontrol_new simple_mux_mux = 59 67 SOC_DAPM_ENUM_EXT("Muxer", simple_mux_enum, simple_mux_control_get, simple_mux_control_put); 60 68 ··· 84 76 .num_dapm_widgets = ARRAY_SIZE(simple_mux_dapm_widgets), 85 77 .dapm_routes = simple_mux_dapm_routes, 86 78 .num_dapm_routes = ARRAY_SIZE(simple_mux_dapm_routes), 79 + .read = simple_mux_read, 87 80 }; 88 81 89 82 static int simple_mux_probe(struct platform_device *pdev)