From 049fac9774e7b0c9d3bcb8dc157bfe3afd4a5396 Mon Sep 17 00:00:00 2001 From: Shuyu Li Date: Mon, 10 Dec 2018 16:47:24 +0800 Subject: [PATCH] audio: codec: the DAC gain set of acodec not work [1/1] PD#SWPL-3134 Problem: the DAC gain set is not work Solution: update and aml_codec_tl1_acodec.c, change the method of getting codec pointer from kcontrol pointer. Verify: verify by T962x2_X301 board Change-Id: I02f02b73fab3b8391ef4866a71ffaf0d48bbbbbf Signed-off-by: Shuyu Li --- sound/soc/codecs/amlogic/aml_codec_tl1_acodec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/amlogic/aml_codec_tl1_acodec.c b/sound/soc/codecs/amlogic/aml_codec_tl1_acodec.c index d2673b244fe2..928eca4e1a00 100644 --- a/sound/soc/codecs/amlogic/aml_codec_tl1_acodec.c +++ b/sound/soc/codecs/amlogic/aml_codec_tl1_acodec.c @@ -129,7 +129,8 @@ static int aml_DAC_Gain_set_enum( struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_component_to_codec(component); u32 reg_addr = ACODEC_1; u32 val = snd_soc_read(codec, reg_addr); @@ -177,7 +178,8 @@ static int aml_DAC2_Gain_set_enum( struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_component_to_codec(component); u32 reg_addr = ACODEC_7; u32 val = snd_soc_read(codec, reg_addr);