diff options
author | Charles Keepax <ckeepax@opensource.cirrus.com> | 2020-01-14 16:18:41 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-01-17 15:28:31 +0000 |
commit | 8ab6ddc5c51b09630f3c89eb410ac48e13a2f0ff (patch) | |
tree | 2c9364fea741659b2aa4dc72e6a4b794dd9b0532 /sound/soc/codecs/madera.c | |
parent | 73ecf1a673d3502dff1445f06675aba65ff20ce7 (diff) | |
download | linux-8ab6ddc5c51b09630f3c89eb410ac48e13a2f0ff.tar.bz2 |
ASoC: madera: Update handling of DAPM routes for mono muxed outputs
Correctly link both channels on the DAC if an output muxed between a
stereo and mono output. Without this one channel of the DAC may be
erroneously powered down whilst in mono mode.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200114161841.451-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/madera.c')
-rw-r--r-- | sound/soc/codecs/madera.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sound/soc/codecs/madera.c b/sound/soc/codecs/madera.c index 52639811cc52..b537e60ef7c0 100644 --- a/sound/soc/codecs/madera.c +++ b/sound/soc/codecs/madera.c @@ -1162,7 +1162,9 @@ static const struct snd_soc_dapm_route madera_mono_routes[] = { { "OUT6R", NULL, "OUT6L" }, }; -int madera_init_outputs(struct snd_soc_component *component, int n_mono_routes) +int madera_init_outputs(struct snd_soc_component *component, + const struct snd_soc_dapm_route *routes, + int n_mono_routes, int n_real) { struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); @@ -1179,16 +1181,21 @@ int madera_init_outputs(struct snd_soc_component *component, int n_mono_routes) n_mono_routes = MADERA_MAX_OUTPUT; } + if (!routes) + routes = madera_mono_routes; + for (i = 0; i < n_mono_routes; i++) { /* Default is 0 so noop with defaults */ if (pdata->out_mono[i]) { val = MADERA_OUT1_MONO; - snd_soc_dapm_add_routes(dapm, - &madera_mono_routes[i], 1); + snd_soc_dapm_add_routes(dapm, &routes[i], 1); } else { val = 0; } + if (i >= n_real) + continue; + regmap_update_bits(madera->regmap, MADERA_OUTPUT_PATH_CONFIG_1L + (i * 8), MADERA_OUT1_MONO, val); |