summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaarten Zanders <maarten.zanders@mind.be>2022-10-28 21:13:01 +0200
committerMark Brown <broonie@kernel.org>2022-11-03 13:26:14 +0000
commitf7d97cb564a2ac5517ee7cc933de729e533d659a (patch)
tree6e1371f58f94a0f3617a1159657bfbb3f2f781d4
parenta984d8332d90afd2989e10b095ffdb2875d4bac8 (diff)
downloadlinux-f7d97cb564a2ac5517ee7cc933de729e533d659a.tar.bz2
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>
-rw-r--r--sound/soc/codecs/simple-mux.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/codecs/simple-mux.c b/sound/soc/codecs/simple-mux.c
index d30c0d24d90a..bf67de12d20b 100644
--- a/sound/soc/codecs/simple-mux.c
+++ b/sound/soc/codecs/simple-mux.c
@@ -55,6 +55,14 @@ static int simple_mux_control_put(struct snd_kcontrol *kcontrol,
e, NULL);
}
+static unsigned int simple_mux_read(struct snd_soc_component *component,
+ unsigned int reg)
+{
+ struct simple_mux *priv = snd_soc_component_get_drvdata(component);
+
+ return priv->mux;
+}
+
static const struct snd_kcontrol_new simple_mux_mux =
SOC_DAPM_ENUM_EXT("Muxer", simple_mux_enum, simple_mux_control_get, simple_mux_control_put);
@@ -76,6 +84,7 @@ static const struct snd_soc_component_driver simple_mux_component_driver = {
.num_dapm_widgets = ARRAY_SIZE(simple_mux_dapm_widgets),
.dapm_routes = simple_mux_dapm_routes,
.num_dapm_routes = ARRAY_SIZE(simple_mux_dapm_routes),
+ .read = simple_mux_read,
};
static int simple_mux_probe(struct platform_device *pdev)