Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321906
b: refs/heads/master
c: 14bc9c6
h: refs/heads/master
v: v3
  • Loading branch information
David Henningsson authored and Takashi Iwai committed Aug 10, 2012
1 parent 42c26fb commit 0ad2683
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 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: de64c0ee7dbcbfbbe63bd9ea45783d87babc6452
refs/heads/master: 14bc9c6dc694e2d7930802f7afd275de25ef8394
20 changes: 14 additions & 6 deletions trunk/sound/pci/hda/hda_beep.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,9 @@ int snd_hda_mixer_amp_switch_get_beep(struct snd_kcontrol *kcontrol,
{
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct hda_beep *beep = codec->beep;
if (beep) {
if (beep && !beep->enabled) {
ucontrol->value.integer.value[0] =
ucontrol->value.integer.value[1] =
beep->enabled;
ucontrol->value.integer.value[1] = 0;
return 0;
}
return snd_hda_mixer_amp_switch_get(kcontrol, ucontrol);
Expand All @@ -252,9 +251,18 @@ int snd_hda_mixer_amp_switch_put_beep(struct snd_kcontrol *kcontrol,
{
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct hda_beep *beep = codec->beep;
if (beep)
snd_hda_enable_beep_device(codec,
*ucontrol->value.integer.value);
if (beep) {
u8 chs = get_amp_channels(kcontrol);
int enable = 0;
long *valp = ucontrol->value.integer.value;
if (chs & 1) {
enable |= *valp;
valp++;
}
if (chs & 2)
enable |= *valp;
snd_hda_enable_beep_device(codec, enable);
}
return snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
}
EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_put_beep);

0 comments on commit 0ad2683

Please sign in to comment.