From a90229e0517938a5c5d9d682708b6ee7cd0e19b9 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 18 Jan 2013 14:10:00 +0100 Subject: ALSA: hda - Consolidate cap_sync_hook and capture_switch_hook Two hooks in hda_gen_spec, cap_sync_hook and capture_switch_hook, play very similar roles. The only differences are that the former is called more often (e.g. at init or switching capsrc) while the latter can take an on/off argument. As a more generic implementation, consolidate these two hooks, and pass snd_ctl_elem_value pointer as the second argument. If the secondary argument is non-NULL, it can take the on/off value, so the caller handles it like the former capture_switch_hook. If it's NULL, it's called in the init or capsrc switch case. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_generic.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sound/pci/hda/hda_generic.h') diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h index f6b88cd4584f..594a9cc4ecca 100644 --- a/sound/pci/hda/hda_generic.h +++ b/sound/pci/hda/hda_generic.h @@ -233,7 +233,8 @@ struct hda_gen_spec { /* hooks */ void (*init_hook)(struct hda_codec *codec); void (*automute_hook)(struct hda_codec *codec); - void (*cap_sync_hook)(struct hda_codec *codec); + void (*cap_sync_hook)(struct hda_codec *codec, + struct snd_ctl_elem_value *ucontrol); /* PCM hooks */ void (*pcm_playback_hook)(struct hda_pcm_stream *hinfo, @@ -252,9 +253,6 @@ struct hda_gen_spec { struct hda_jack_tbl *tbl); void (*mic_autoswitch_hook)(struct hda_codec *codec, struct hda_jack_tbl *tbl); - - /* capture switch hook (for mic-mute LED) */ - void (*capture_switch_hook)(struct hda_codec *codec, bool enable); }; int snd_hda_gen_spec_init(struct hda_gen_spec *spec); -- cgit v1.2.3