diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-11-12 10:45:04 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-11-13 08:37:14 -0500 |
commit | 4d4e9bb339cfcde7811af10859ba1ce2fe3d46b4 (patch) | |
tree | bf9bbfdc9e6c0a9d912013edfba83924d50b6eda /sound/pci/hda/hda_beep.c | |
parent | d7a8943635485597ae7c6d554a8ccf3ce5a42d2d (diff) |
ALSA: hda - Add digital beep playback switch for STAC/IDT codecs
The digital beep widget may have no mute control, and always enabling
the beep is ofen pretty annoying, especially on laptops.
This patch adds a mixer control "PC Beep Playback Switch" when there
is no mixer amp mute is found, and controls it on software.
Reference: Novell bnc#444572
https://bugzilla.novell.com/show_bug.cgi?id=444572
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_beep.c')
-rw-r--r-- | sound/pci/hda/hda_beep.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c index 9b77b3e0fa98..b1796ae1e8fb 100644 --- a/sound/pci/hda/hda_beep.c +++ b/sound/pci/hda/hda_beep.c | |||
@@ -37,6 +37,9 @@ static void snd_hda_generate_beep(struct work_struct *work) | |||
37 | container_of(work, struct hda_beep, beep_work); | 37 | container_of(work, struct hda_beep, beep_work); |
38 | struct hda_codec *codec = beep->codec; | 38 | struct hda_codec *codec = beep->codec; |
39 | 39 | ||
40 | if (!beep->enabled) | ||
41 | return; | ||
42 | |||
40 | /* generate tone */ | 43 | /* generate tone */ |
41 | snd_hda_codec_write_cache(codec, beep->nid, 0, | 44 | snd_hda_codec_write_cache(codec, beep->nid, 0, |
42 | AC_VERB_SET_BEEP_CONTROL, beep->tone); | 45 | AC_VERB_SET_BEEP_CONTROL, beep->tone); |
@@ -115,6 +118,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) | |||
115 | beep->nid = nid; | 118 | beep->nid = nid; |
116 | beep->dev = input_dev; | 119 | beep->dev = input_dev; |
117 | beep->codec = codec; | 120 | beep->codec = codec; |
121 | beep->enabled = 1; | ||
118 | codec->beep = beep; | 122 | codec->beep = beep; |
119 | 123 | ||
120 | INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); | 124 | INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); |