int lola_setup_all_analog_gains(struct lola *chip, int dir, bool mute) { struct lola_pin *pin; int idx, max_idx; pin = chip->pin[dir].pins; max_idx = chip->pin[dir].num_pins; for (idx = 0; idx < max_idx; idx++) { if (pin[idx].is_analog) { unsigned int val = mute ? 0 : pin[idx].cur_gain_step; /* set volume and do not save the value */ set_analog_volume(chip, dir, idx, val, false); } } return lola_codec_flush(chip); }
static int lola_analog_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct lola *chip = snd_kcontrol_chip(kcontrol); int dir = kcontrol->private_value; int i, err; for (i = 0; i < chip->pin[dir].num_pins; i++) { err = set_analog_volume(chip, dir, i, ucontrol->value.integer.value[i], true); if (err < 0) return err; } return 0; }