Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148209
b: refs/heads/master
c: d7d5c54
h: refs/heads/master
i:
  148207: 046ce5b
v: v3
  • Loading branch information
Mark Brown committed Apr 22, 2009
1 parent 292476e commit db5f1cf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4dbfe8097157fde1f8054f48f991ea45833852cd
refs/heads/master: d7d5c5476a12333a33b7a14ebb10eccc729c01cb
14 changes: 14 additions & 0 deletions trunk/sound/soc/codecs/wm8903.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,14 +392,18 @@ static int wm8903_output_event(struct snd_soc_dapm_widget *w,
struct snd_soc_codec *codec = w->codec;
u16 val;
u16 reg;
u16 dcs_reg;
u16 dcs_bit;
int shift;

switch (w->reg) {
case WM8903_POWER_MANAGEMENT_2:
reg = WM8903_ANALOGUE_HP_0;
dcs_bit = 0 + w->shift;
break;
case WM8903_POWER_MANAGEMENT_3:
reg = WM8903_ANALOGUE_LINEOUT_0;
dcs_bit = 2 + w->shift;
break;
default:
BUG();
Expand Down Expand Up @@ -439,6 +443,11 @@ static int wm8903_output_event(struct snd_soc_dapm_widget *w,
val |= (WM8903_OUTPUT_OUT << shift);
wm8903_write(codec, reg, val);

/* Enable the DC servo */
dcs_reg = wm8903_read(codec, WM8903_DC_SERVO_0);
dcs_reg |= dcs_bit;
wm8903_write(codec, WM8903_DC_SERVO_0, dcs_reg);

/* Remove the short */
val |= (WM8903_OUTPUT_SHORT << shift);
wm8903_write(codec, reg, val);
Expand All @@ -451,6 +460,11 @@ static int wm8903_output_event(struct snd_soc_dapm_widget *w,
val &= ~(WM8903_OUTPUT_SHORT << shift);
wm8903_write(codec, reg, val);

/* Disable the DC servo */
dcs_reg = wm8903_read(codec, WM8903_DC_SERVO_0);
dcs_reg &= ~dcs_bit;
wm8903_write(codec, WM8903_DC_SERVO_0, dcs_reg);

/* Then disable the intermediate and output stages */
val &= ~((WM8903_OUTPUT_OUT | WM8903_OUTPUT_INT |
WM8903_OUTPUT_IN) << shift);
Expand Down

0 comments on commit db5f1cf

Please sign in to comment.