Skip to content

Commit

Permalink
ASoC: wm_hubs: Make sure we don't disable differential line outputs
Browse files Browse the repository at this point in the history
While we need to clean up unused single ended line outputs we don't want
to do this if the outputs are in differential mode.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Apr 23, 2012
1 parent 1a38336 commit de050ac
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions sound/soc/codecs/wm_hubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ void wm_hubs_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level)
{
struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
int val;
int mask, val;

switch (level) {
case SND_SOC_BIAS_STANDBY:
Expand All @@ -1047,6 +1047,13 @@ void wm_hubs_set_bias_level(struct snd_soc_codec *codec,
case SND_SOC_BIAS_ON:
/* Turn off any unneded single ended outputs */
val = 0;
mask = 0;

if (hubs->lineout1_se)
mask |= WM8993_LINEOUT1N_ENA | WM8993_LINEOUT1P_ENA;

if (hubs->lineout2_se)
mask |= WM8993_LINEOUT2N_ENA | WM8993_LINEOUT2P_ENA;

if (hubs->lineout1_se && hubs->lineout1n_ena)
val |= WM8993_LINEOUT1N_ENA;
Expand All @@ -1061,11 +1068,7 @@ void wm_hubs_set_bias_level(struct snd_soc_codec *codec,
val |= WM8993_LINEOUT2P_ENA;

snd_soc_update_bits(codec, WM8993_POWER_MANAGEMENT_3,
WM8993_LINEOUT1N_ENA |
WM8993_LINEOUT1P_ENA |
WM8993_LINEOUT2N_ENA |
WM8993_LINEOUT2P_ENA,
val);
mask, val);

/* Remove the input clamps */
snd_soc_update_bits(codec, WM8993_INPUTS_CLAMP_REG,
Expand Down

0 comments on commit de050ac

Please sign in to comment.