示例#1
0
static int tegra_play_route_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	struct tegra_audio_data* audio_data = snd_kcontrol_chip(kcontrol);

	if (audio_data) {
		int play_device_new = ucontrol->value.integer.value[0] &
				TEGRA_AUDIO_DEVICE_OUT_ALL;

		if (audio_data->play_device != play_device_new) {
			tegra_audio_route(audio_data,
				play_device_new | audio_data->capture_device,
				audio_data->is_call_mode);
			return 1;
		}
		return 0;
	}
	return -EINVAL;
}
示例#2
0
static int tegra_call_mode_put(struct snd_kcontrol *kcontrol,
				   struct snd_ctl_elem_value *ucontrol)
{
	struct tegra_audio_data* audio_data = snd_kcontrol_chip(kcontrol);

	if (audio_data) {
		int is_call_mode_new = ucontrol->value.integer.value[0];

		if (audio_data->is_call_mode != is_call_mode_new) {
			tegra_audio_route(audio_data,
				audio_data->play_device |
				audio_data->capture_device,
				is_call_mode_new);
			return 1;
		}
		return 0;
	}
	return -EINVAL;
}
示例#3
0
static int tegra_config_aic3008_dsp_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
	struct aic3008_priv *audio_data = snd_soc_codec_get_drvdata(codec);
	int aic3008_dsp_id;

	if (audio_data) {
		aic3008_dsp_id = ucontrol->value.integer.value[0];

		if (audio_data->aic3008_dsp_id != aic3008_dsp_id)
			audio_data->aic3008_dsp_id = aic3008_dsp_id;

		tegra_audio_route(audio_data, AIC3008_IO_CONFIG_MEDIA,
				aic3008_dsp_id);
		return 0;
	}
	return -EINVAL;

}
示例#4
0
static int tegra_capture_route_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
	struct aic3008_priv *audio_data = snd_soc_codec_get_drvdata(codec);
	int uplink;

	AUD_DBG("tegra_capture_route_put\n");

	if (audio_data) {
		uplink = ucontrol->value.integer.value[0];

		if (audio_data->uplink_id != uplink)
			audio_data->uplink_id = uplink;

		tegra_audio_route(audio_data, AIC3008_IO_CONFIG_TX, uplink);
		return 0;
	}
	return -EINVAL;
}