Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210491
b: refs/heads/master
c: fe6ce80
h: refs/heads/master
i:
  210489: b8e8e32
  210487: 809ea68
v: v3
  • Loading branch information
Clemens Ladisch authored and Takashi Iwai committed Sep 8, 2010
1 parent f0076a8 commit b67ecb8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4c25b93223340deff73381cc47f9244fb379a74d
refs/heads/master: fe6ce80ae25953d95ebaf9bce27b585218cda25c
21 changes: 20 additions & 1 deletion trunk/sound/pci/oxygen/xonar_wm87x6.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ struct xonar_wm87x6 {
struct xonar_generic generic;
u16 wm8776_regs[0x17];
u16 wm8766_regs[0x10];
struct snd_kcontrol *line_adcmux_control;
struct snd_kcontrol *mic_adcmux_control;
struct snd_kcontrol *lc_controls[13];
};

Expand Down Expand Up @@ -604,15 +606,26 @@ static int wm8776_input_mux_put(struct snd_kcontrol *ctl,
{
struct oxygen *chip = ctl->private_data;
struct xonar_wm87x6 *data = chip->model_data;
struct snd_kcontrol *other_ctl;
unsigned int mux_bit = ctl->private_value;
u16 reg;
int changed;

mutex_lock(&chip->mutex);
reg = data->wm8776_regs[WM8776_ADCMUX];
if (value->value.integer.value[0]) {
reg &= ~0x003;
reg |= mux_bit;
/* line-in and mic-in are exclusive */
mux_bit ^= 3;
if (reg & mux_bit) {
reg &= ~mux_bit;
if (mux_bit == 1)
other_ctl = data->line_adcmux_control;
else
other_ctl = data->mic_adcmux_control;
snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
&other_ctl->id);
}
} else
reg &= ~mux_bit;
changed = reg != data->wm8776_regs[WM8776_ADCMUX];
Expand Down Expand Up @@ -964,7 +977,13 @@ static int xonar_ds_mixer_init(struct oxygen *chip)
err = snd_ctl_add(chip->card, ctl);
if (err < 0)
return err;
if (!strcmp(ctl->id.name, "Line Capture Switch"))
data->line_adcmux_control = ctl;
else if (!strcmp(ctl->id.name, "Mic Capture Switch"))
data->mic_adcmux_control = ctl;
}
if (!data->line_adcmux_control || !data->mic_adcmux_control)
return -ENXIO;
BUILD_BUG_ON(ARRAY_SIZE(lc_controls) != ARRAY_SIZE(data->lc_controls));
for (i = 0; i < ARRAY_SIZE(lc_controls); ++i) {
ctl = snd_ctl_new1(&lc_controls[i], chip);
Expand Down

0 comments on commit b67ecb8

Please sign in to comment.