Skip to content

Commit

Permalink
ASoC: wm5110: Power both channels for differential mono output
Browse files Browse the repository at this point in the history
On the wm5110 CODEC both the left and right channel must be powered
when an output is being used as a mono output, although no audio is
routed to the right output channel. This patch adds additional DAPM
routes to link the right channel to the left in the case where an output
is marked as mono. Audio must always be brought in on the left channel
for mono operation.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Charles Keepax authored and Mark Brown committed Jun 21, 2014
1 parent 7171511 commit b60f363
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions sound/soc/codecs/arizona.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,31 @@ int arizona_init_spk(struct snd_soc_codec *codec)
}
EXPORT_SYMBOL_GPL(arizona_init_spk);

static const struct snd_soc_dapm_route arizona_mono_routes[] = {
{ "OUT1R", NULL, "OUT1L" },
{ "OUT2R", NULL, "OUT2L" },
{ "OUT3R", NULL, "OUT3L" },
{ "OUT4R", NULL, "OUT4L" },
{ "OUT5R", NULL, "OUT5L" },
{ "OUT6R", NULL, "OUT6L" },
};

int arizona_init_mono(struct snd_soc_codec *codec)
{
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
struct arizona *arizona = priv->arizona;
int i;

for (i = 0; i < ARIZONA_MAX_OUTPUT; ++i) {
if (arizona->pdata.out_mono[i])
snd_soc_dapm_add_routes(&codec->dapm,
&arizona_mono_routes[i], 1);
}

return 0;
}
EXPORT_SYMBOL_GPL(arizona_init_mono);

int arizona_init_gpio(struct snd_soc_codec *codec)
{
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/arizona.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ extern int arizona_set_fll(struct arizona_fll *fll, int source,

extern int arizona_init_spk(struct snd_soc_codec *codec);
extern int arizona_init_gpio(struct snd_soc_codec *codec);
extern int arizona_init_mono(struct snd_soc_codec *codec);

extern int arizona_init_dai(struct arizona_priv *priv, int dai);

Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/wm5110.c
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,7 @@ static int wm5110_codec_probe(struct snd_soc_codec *codec)

arizona_init_spk(codec);
arizona_init_gpio(codec);
arizona_init_mono(codec);

ret = snd_soc_add_codec_controls(codec, wm_adsp2_fw_controls, 8);
if (ret != 0)
Expand Down

0 comments on commit b60f363

Please sign in to comment.