From f77c18ee6f0e9e3c9e3b5ade9e0593e85d116c54 Mon Sep 17 00:00:00 2001 From: Viraj Karandikar Date: Tue, 3 Nov 2015 16:09:40 +0530 Subject: [PATCH] tegra-alt: fixes for kernel-3.18 Use snd_soc_kcontrol_codec() instead of snd_kcontrol_chip(). Put additional T186 ADMAIF channels under macro. Bug 200100724 Change-Id: I20d280f067414bec16a4f07e38a05b64306cb217 Signed-off-by: Viraj Karandikar Reviewed-on: http://git-master/r/826932 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Ravindra Lokhande Reviewed-by: Nitin Pai Reviewed-by: Sumit Bhattacharya --- sound/soc/tegra-alt/tegra210_admaif_alt.c | 6 ++++-- sound/soc/tegra-alt/tegra210_amx_alt.c | 4 ++-- sound/soc/tegra-alt/tegra210_sfc_alt.c | 8 ++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sound/soc/tegra-alt/tegra210_admaif_alt.c b/sound/soc/tegra-alt/tegra210_admaif_alt.c index 1b297aac..3a8a4c50 100644 --- a/sound/soc/tegra-alt/tegra210_admaif_alt.c +++ b/sound/soc/tegra-alt/tegra210_admaif_alt.c @@ -470,7 +470,7 @@ static struct snd_soc_dai_ops tegra210_admaif_dai_ops = { static int tegra210_admaif_get_channels(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; struct tegra210_admaif *admaif = snd_soc_codec_get_drvdata(codec); @@ -484,7 +484,7 @@ static int tegra210_admaif_put_channels(struct snd_kcontrol *kcontrol, { struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct tegra210_admaif *admaif = snd_soc_codec_get_drvdata(codec); int value = ucontrol->value.integer.value[0]; @@ -728,6 +728,7 @@ static struct snd_kcontrol_new tegra210_admaif_controls[] = { TEGRA210_ADMAIF_CHANNEL_CTRL(8), TEGRA210_ADMAIF_CHANNEL_CTRL(9), TEGRA210_ADMAIF_CHANNEL_CTRL(10), +#if defined(CONFIG_ARCH_TEGRA_18x_SOC) TEGRA210_ADMAIF_CHANNEL_CTRL(11), TEGRA210_ADMAIF_CHANNEL_CTRL(12), TEGRA210_ADMAIF_CHANNEL_CTRL(13), @@ -738,6 +739,7 @@ static struct snd_kcontrol_new tegra210_admaif_controls[] = { TEGRA210_ADMAIF_CHANNEL_CTRL(18), TEGRA210_ADMAIF_CHANNEL_CTRL(19), TEGRA210_ADMAIF_CHANNEL_CTRL(20) +#endif }; static int tegra210_admaif_codec_probe(struct snd_soc_codec *codec) diff --git a/sound/soc/tegra-alt/tegra210_amx_alt.c b/sound/soc/tegra-alt/tegra210_amx_alt.c index cc33e1ae..3189abc0 100644 --- a/sound/soc/tegra-alt/tegra210_amx_alt.c +++ b/sound/soc/tegra-alt/tegra210_amx_alt.c @@ -509,7 +509,7 @@ static int tegra210_amx_put_byte_map(struct snd_kcontrol *kcontrol, static int tegra210_amx_get_output_channels(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct tegra210_amx *amx = snd_soc_codec_get_drvdata(codec); ucontrol->value.integer.value[0] = amx->output_channels; @@ -519,7 +519,7 @@ static int tegra210_amx_get_output_channels(struct snd_kcontrol *kcontrol, static int tegra210_amx_put_output_channels(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct tegra210_amx *amx = snd_soc_codec_get_drvdata(codec); int value = ucontrol->value.integer.value[0]; diff --git a/sound/soc/tegra-alt/tegra210_sfc_alt.c b/sound/soc/tegra-alt/tegra210_sfc_alt.c index 8a4120d4..cc3dff78 100644 --- a/sound/soc/tegra-alt/tegra210_sfc_alt.c +++ b/sound/soc/tegra-alt/tegra210_sfc_alt.c @@ -570,7 +570,7 @@ static int tegra210_sfc_init_put(struct snd_kcontrol *kcontrol, static int tegra210_sfc_get_stereo_conv(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct tegra210_sfc *sfc = snd_soc_codec_get_drvdata(codec); ucontrol->value.integer.value[0] = sfc->stereo_conv_input; @@ -580,7 +580,7 @@ static int tegra210_sfc_get_stereo_conv(struct snd_kcontrol *kcontrol, static int tegra210_sfc_put_stereo_conv(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct tegra210_sfc *sfc = snd_soc_codec_get_drvdata(codec); sfc->stereo_conv_input = ucontrol->value.integer.value[0]; @@ -590,7 +590,7 @@ static int tegra210_sfc_put_stereo_conv(struct snd_kcontrol *kcontrol, static int tegra210_sfc_get_mono_conv(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct tegra210_sfc *sfc = snd_soc_codec_get_drvdata(codec); ucontrol->value.integer.value[0] = sfc->mono_conv_output; @@ -600,7 +600,7 @@ static int tegra210_sfc_get_mono_conv(struct snd_kcontrol *kcontrol, static int tegra210_sfc_put_mono_conv(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct tegra210_sfc *sfc = snd_soc_codec_get_drvdata(codec); sfc->mono_conv_output = ucontrol->value.integer.value[0];