diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-07-23 09:41:34 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 09:57:44 -0400 |
commit | b9ed4f2b68dc47b0c35c1a3ae8ae97c2517d5177 (patch) | |
tree | c967e895a8955cf5852d8155185e82316dd0beec | |
parent | 90fd5ce5f67968d3250eeab9bc1f6822644347ef (diff) |
[ALSA] Add helper functions for frequently used callbacks
Added helper functions for frequenty used callbacks:
snd_ctl_boolean_mono_info() and snd_ctl_boolean_stereo_info()
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r-- | include/sound/control.h | 8 | ||||
-rw-r--r-- | sound/core/control.c | 27 |
2 files changed, 35 insertions, 0 deletions
diff --git a/include/sound/control.h b/include/sound/control.h index 72e759f619b1..b26d4633ee2c 100644 --- a/include/sound/control.h +++ b/include/sound/control.h | |||
@@ -161,4 +161,12 @@ static inline struct snd_ctl_elem_id *snd_ctl_build_ioff(struct snd_ctl_elem_id | |||
161 | return dst_id; | 161 | return dst_id; |
162 | } | 162 | } |
163 | 163 | ||
164 | /* | ||
165 | * Frequently used control callbacks | ||
166 | */ | ||
167 | int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol, | ||
168 | struct snd_ctl_elem_info *uinfo); | ||
169 | int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol, | ||
170 | struct snd_ctl_elem_info *uinfo); | ||
171 | |||
164 | #endif /* __SOUND_CONTROL_H */ | 172 | #endif /* __SOUND_CONTROL_H */ |
diff --git a/sound/core/control.c b/sound/core/control.c index 1f1ab9c1b668..396e98ed086a 100644 --- a/sound/core/control.c +++ b/sound/core/control.c | |||
@@ -1486,3 +1486,30 @@ int snd_ctl_create(struct snd_card *card) | |||
1486 | snd_assert(card != NULL, return -ENXIO); | 1486 | snd_assert(card != NULL, return -ENXIO); |
1487 | return snd_device_new(card, SNDRV_DEV_CONTROL, card, &ops); | 1487 | return snd_device_new(card, SNDRV_DEV_CONTROL, card, &ops); |
1488 | } | 1488 | } |
1489 | |||
1490 | /* | ||
1491 | * Frequently used control callbacks | ||
1492 | */ | ||
1493 | int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol, | ||
1494 | struct snd_ctl_elem_info *uinfo) | ||
1495 | { | ||
1496 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
1497 | uinfo->count = 1; | ||
1498 | uinfo->value.integer.min = 0; | ||
1499 | uinfo->value.integer.max = 1; | ||
1500 | return 0; | ||
1501 | } | ||
1502 | |||
1503 | EXPORT_SYMBOL(snd_ctl_boolean_mono_info); | ||
1504 | |||
1505 | int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol, | ||
1506 | struct snd_ctl_elem_info *uinfo) | ||
1507 | { | ||
1508 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
1509 | uinfo->count = 2; | ||
1510 | uinfo->value.integer.min = 0; | ||
1511 | uinfo->value.integer.max = 1; | ||
1512 | return 0; | ||
1513 | } | ||
1514 | |||
1515 | EXPORT_SYMBOL(snd_ctl_boolean_stereo_info); | ||