From dda415d41882449f841f88d829dd65b6ee1c374c Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 30 Nov 2012 18:34:38 +0100 Subject: ALSA: hda - Add a helper function for simple enum kcontrols The same type of code is being used in multiple places in various codec drivers, so put it as a core library. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_local.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sound/pci/hda/hda_local.h') diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 8c43198b7f56..4b40a5e7a8f5 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h @@ -600,6 +600,15 @@ int snd_hda_check_amp_list_power(struct hda_codec *codec, #define get_amp_offset(kc) (((kc)->private_value >> 23) & 0x3f) #define get_amp_min_mute(kc) (((kc)->private_value >> 29) & 0x1) +/* + * enum control helper + */ +int snd_hda_enum_helper_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo, + int num_entries, const char * const *texts); +#define snd_hda_enum_bool_helper_info(kcontrol, uinfo) \ + snd_hda_enum_helper_info(kcontrol, uinfo, 0, NULL) + /* * CEA Short Audio Descriptor data */ -- cgit v1.2.3-55-g7522