summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_generic.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-03-18 11:25:51 +0100
committerTakashi Iwai <tiwai@suse.de>2013-03-18 12:58:42 +0100
commit7504b6cd220a3dd8104abe3d0f985c6957dc3e17 (patch)
treecc9375edcd24847cad943c0a5d141874f67e743f /sound/pci/hda/hda_generic.c
parentcf30f46acde1f84fbf603bba6540cbb40cc6c954 (diff)
downloadop-kernel-dev-7504b6cd220a3dd8104abe3d0f985c6957dc3e17.zip
op-kernel-dev-7504b6cd220a3dd8104abe3d0f985c6957dc3e17.tar.gz
ALSA: hda - Move beep attach/detach calls in hda_generic.c
Instead of calling snd_hda_attach_beep_device() and snd_hda_detach_beep_device() in each codec driver, move them to the generic parser. The codec driver just needs to set spec->beep_nid for activating the digital beep. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_generic.c')
-rw-r--r--sound/pci/hda/hda_generic.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index aae6b10..d7fa1ee 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -34,6 +34,7 @@
#include "hda_local.h"
#include "hda_auto_parser.h"
#include "hda_jack.h"
+#include "hda_beep.h"
#include "hda_generic.h"
@@ -4238,6 +4239,12 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec,
if (spec->power_down_unused)
codec->power_filter = snd_hda_gen_path_power_filter;
+ if (!spec->no_analog && spec->beep_nid) {
+ err = snd_hda_attach_beep_device(codec, spec->beep_nid);
+ if (err < 0)
+ return err;
+ }
+
return 1;
}
EXPORT_SYMBOL_HDA(snd_hda_gen_parse_auto_config);
@@ -5063,6 +5070,7 @@ EXPORT_SYMBOL_HDA(snd_hda_gen_init);
*/
void snd_hda_gen_free(struct hda_codec *codec)
{
+ snd_hda_detach_beep_device(codec);
snd_hda_gen_spec_free(codec->spec);
kfree(codec->spec);
codec->spec = NULL;
OpenPOWER on IntegriCloud