diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-03-18 11:25:51 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-03-18 12:58:42 +0100 |
commit | 7504b6cd220a3dd8104abe3d0f985c6957dc3e17 (patch) | |
tree | cc9375edcd24847cad943c0a5d141874f67e743f /sound/pci/hda/hda_generic.c | |
parent | cf30f46acde1f84fbf603bba6540cbb40cc6c954 (diff) | |
download | linux-7504b6cd220a3dd8104abe3d0f985c6957dc3e17.tar.bz2 |
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.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index aae6b1023d69..d7fa1ee8302c 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; |