#include <sound/control.h>
#include <sound/gus.h>
-#define chip_t snd_gus_card_t
-
/*
*
*/
return change;
}
-#define GF1_CONTROLS (sizeof(snd_gf1_controls)/sizeof(snd_kcontrol_new_t))
-
static snd_kcontrol_new_t snd_gf1_controls[] = {
GF1_SINGLE("Master Playback Switch", 0, 1, 1),
GF1_SINGLE("Line Switch", 0, 0, 1),
GF1_SINGLE("Mic Switch", 0, 2, 0)
};
-#define ICS_CONTROLS (sizeof(snd_ics_controls)/sizeof(snd_kcontrol_new_t))
-
static snd_kcontrol_new_t snd_ics_controls[] = {
GF1_SINGLE("Master Playback Switch", 0, 1, 1),
ICS_DOUBLE("Master Playback Volume", 0, SNDRV_ICS_MASTER_DEV),
}
if (!gus->ics_flag) {
- max = gus->ess_flag ? 1 : GF1_CONTROLS;
+ max = gus->ess_flag ? 1 : ARRAY_SIZE(snd_gf1_controls);
for (idx = 0; idx < max; idx++) {
if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_gf1_controls[idx], gus))) < 0)
return err;
}
} else {
- for (idx = 0; idx < ICS_CONTROLS; idx++) {
+ for (idx = 0; idx < ARRAY_SIZE(snd_ics_controls); idx++) {
if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_ics_controls[idx], gus))) < 0)
return err;
}