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/patch_conexant.c | |
parent | cf30f46acde1f84fbf603bba6540cbb40cc6c954 (diff) |
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/patch_conexant.c')
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index d0100a85e18..54996439577 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -139,8 +139,12 @@ struct conexant_spec { #ifdef CONFIG_SND_HDA_INPUT_BEEP -#define set_beep_amp(spec, nid, idx, dir) \ - ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 1, idx, dir)) +static inline void set_beep_amp(struct conexant_spec *spec, hda_nid_t nid, + int idx, int dir) +{ + spec->gen.beep_nid = nid; + spec->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 1, idx, dir); +} /* additional beep mixers; the actual parameters are overwritten at build */ static const struct snd_kcontrol_new cxt_beep_mixer[] = { HDA_CODEC_VOLUME_MONO("Beep Playback Volume", 0, 1, 0, HDA_OUTPUT), @@ -3191,17 +3195,11 @@ static int cx_auto_build_controls(struct hda_codec *codec) return 0; } -static void cx_auto_free(struct hda_codec *codec) -{ - snd_hda_detach_beep_device(codec); - snd_hda_gen_free(codec); -} - static const struct hda_codec_ops cx_auto_patch_ops = { .build_controls = cx_auto_build_controls, .build_pcms = snd_hda_gen_build_pcms, .init = snd_hda_gen_init, - .free = cx_auto_free, + .free = snd_hda_gen_free, .unsol_event = snd_hda_jack_unsol_event, #ifdef CONFIG_PM .check_power_status = snd_hda_gen_check_power_status, @@ -3395,8 +3393,6 @@ static int patch_conexant_auto(struct hda_codec *codec) goto error; codec->patch_ops = cx_auto_patch_ops; - if (spec->beep_amp) - snd_hda_attach_beep_device(codec, get_amp_nid_(spec->beep_amp)); /* Some laptops with Conexant chips show stalls in S3 resume, * which falls into the single-cmd mode. |