diff options
Diffstat (limited to 'sound/pci/ice1712/quartet.c')
| -rw-r--r-- | sound/pci/ice1712/quartet.c | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/sound/pci/ice1712/quartet.c b/sound/pci/ice1712/quartet.c index 866596205710..099601edf1d0 100644 --- a/sound/pci/ice1712/quartet.c +++ b/sound/pci/ice1712/quartet.c @@ -396,7 +396,7 @@ static void reg_write(struct snd_ice1712 *ice, unsigned int reg, { unsigned int tmp; - mutex_lock(&ice->gpio_mutex); + guard(mutex)(&ice->gpio_mutex); /* set direction of used GPIOs*/ /* all outputs */ tmp = 0x00ffff; @@ -429,7 +429,6 @@ static void reg_write(struct snd_ice1712 *ice, unsigned int reg, ice->gpio.set_mask(ice, 0xffffff); /* outputs only 8-15 */ ice->gpio.set_dir(ice, 0x00ff00); - mutex_unlock(&ice->gpio_mutex); } static unsigned int get_scr(struct snd_ice1712 *ice) @@ -566,7 +565,7 @@ static int qtet_ain12_sw_put(struct snd_kcontrol *kcontrol, { struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); unsigned int old, new, tmp, masked_old; - old = new = get_scr(ice); + old = get_scr(ice); masked_old = old & (SCR_AIN12_SEL1 | SCR_AIN12_SEL0); tmp = ucontrol->value.integer.value[0]; if (tmp == 2) @@ -757,7 +756,7 @@ static const struct snd_kcontrol_new qtet_controls[] = { QTET_CONTROL("Output 3/4 to Monitor 1/2", sw, OUT34_MON12), }; -static const char * const slave_vols[] = { +static const char * const follower_vols[] = { PCM_12_PLAYBACK_VOLUME, PCM_34_PLAYBACK_VOLUME, NULL @@ -766,26 +765,6 @@ static const char * const slave_vols[] = { static DECLARE_TLV_DB_SCALE(qtet_master_db_scale, -6350, 50, 1); -static struct snd_kcontrol *ctl_find(struct snd_card *card, - const char *name) -{ - struct snd_ctl_elem_id sid = {0}; - - strlcpy(sid.name, name, sizeof(sid.name)); - sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER; - return snd_ctl_find_id(card, &sid); -} - -static void add_slaves(struct snd_card *card, - struct snd_kcontrol *master, const char * const *list) -{ - for (; *list; list++) { - struct snd_kcontrol *slave = ctl_find(card, *list); - if (slave) - snd_ctl_add_slave(master, slave); - } -} - static int qtet_add_controls(struct snd_ice1712 *ice) { struct qtet_spec *spec = ice->spec; @@ -806,10 +785,12 @@ static int qtet_add_controls(struct snd_ice1712 *ice) qtet_master_db_scale); if (!vmaster) return -ENOMEM; - add_slaves(ice->card, vmaster, slave_vols); err = snd_ctl_add(ice->card, vmaster); if (err < 0) return err; + err = snd_ctl_add_followers(ice->card, vmaster, follower_vols); + if (err < 0) + return err; /* only capture SPDIF over AK4113 */ return snd_ak4113_build(spec->ak4113, ice->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream); |
