コード例 #1
0
ファイル: mixart_mixer.c プロジェクト: 3sOx/asuswrt-merlin
static void mixart_reset_audio_levels(struct snd_mixart *chip)
{
	/* analog volumes can be set even if there is no pipe */
	mixart_update_analog_audio_level(chip, 0);
	/* analog levels for capture only on the first two chips */
	if(chip->chip_idx < 2) {
		mixart_update_analog_audio_level(chip, 1);
	}
	return;
}
コード例 #2
0
static void mixart_reset_audio_levels(struct snd_mixart *chip)
{
	/*                                                    */
	mixart_update_analog_audio_level(chip, 0);
	/*                                                       */
	if(chip->chip_idx < 2) {
		mixart_update_analog_audio_level(chip, 1);
	}
	return;
}
コード例 #3
0
static int mixart_analog_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
	struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
	int changed = 0;
	int is_capture, i;

	mutex_lock(&chip->mgr->mixer_mutex);
	is_capture = (kcontrol->private_value != 0);
	for (i = 0; i < 2; i++) {
		int new_volume = ucontrol->value.integer.value[i];
		int *stored_volume = is_capture ?
			&chip->analog_capture_volume[i] :
			&chip->analog_playback_volume[i];
		if (is_capture) {
			if (new_volume < MIXART_ANALOG_CAPTURE_LEVEL_MIN ||
			    new_volume > MIXART_ANALOG_CAPTURE_LEVEL_MAX)
				continue;
		} else {
			if (new_volume < MIXART_ANALOG_PLAYBACK_LEVEL_MIN ||
			    new_volume > MIXART_ANALOG_PLAYBACK_LEVEL_MAX)
				continue;
		}
		if (*stored_volume != new_volume) {
			*stored_volume = new_volume;
			changed = 1;
		}
	}
	if (changed)
		mixart_update_analog_audio_level(chip, is_capture);
	mutex_unlock(&chip->mgr->mixer_mutex);
	return changed;
}
コード例 #4
0
ファイル: mixart_mixer.c プロジェクト: 3sOx/asuswrt-merlin
static int mixart_audio_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
	struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
	int i, changed = 0;
	mutex_lock(&chip->mgr->mixer_mutex);
	for(i=0; i<2; i++) {
		if(chip->analog_playback_active[i] != ucontrol->value.integer.value[i]) {
			chip->analog_playback_active[i] = ucontrol->value.integer.value[i];
			changed = 1;
		}
	}
	if(changed)	mixart_update_analog_audio_level(chip, 0); /* update playback levels */
	mutex_unlock(&chip->mgr->mixer_mutex);
	return changed;
}