ASOC:Pick Patch from ODM's Base
authorYao Zhengming <yaozm1@motorola.com>
Tue, 15 Jan 2019 03:28:54 +0000 (22:28 -0500)
committerlingsen1 <lingsen1@lenovo.com>
Sun, 7 Feb 2021 09:36:53 +0000 (17:36 +0800)
EKKANE-227:[Kane][audio]kernel:get the enum by read hard status

sometimes the enum show wrong

Change-Id: I1eea4a01c05e9d9e49508f54d3e5ac6281dbda3f
Signed-off-by: zhangjiaquan <zhangjiaquan@huaqin.com>
Signed-off-by: yaozm1 <yaozm1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1295695
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key

sound/soc/codecs/cs47l35.c
sound/soc/codecs/madera.c
sound/soc/codecs/madera.h

index 9a773ed606b0fa4351c9ce4e4634def1dac50561..19df5ece275b1d1fa9fe24fff34d806c71dcc092 100755 (executable)
@@ -142,7 +142,7 @@ static SOC_ENUM_SINGLE_DECL(cs47l35_outdemux_enum, SND_SOC_NOPM, 0,
 
 static const struct snd_kcontrol_new cs47l35_outdemux =
        SOC_DAPM_ENUM_EXT("HPOUT1 Demux", cs47l35_outdemux_enum,
-                         snd_soc_dapm_get_enum_double, madera_out1_demux_put);
+                         madera_out1_demux_get, madera_out1_demux_put);
 static int cs47l35_get_sources(unsigned int reg,
                               const unsigned int **cur_sources, int *lim)
 {
index 7aed44a8767662a8109dcf233de1fd31455d47a2..59a4bf329ce53911bb74b8d77bb015beb5e54937 100755 (executable)
@@ -601,6 +601,18 @@ end:
 }
 EXPORT_SYMBOL_GPL(madera_out1_demux_put);
 
+int madera_out1_demux_get(struct snd_kcontrol *kcontrol,
+                         struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol);
+       unsigned int val;
+       val = snd_soc_read(codec, MADERA_OUTPUT_ENABLES_1);
+       val &= MADERA_EP_SEL_MASK;
+       val >>= MADERA_EP_SEL_SHIFT;
+       ucontrol->value.enumerated.item[0] = val;
+       return 0;
+}
+EXPORT_SYMBOL_GPL(madera_out1_demux_get);
 
 static int madera_inmux_put(struct snd_kcontrol *kcontrol,
                            struct snd_ctl_elem_value *ucontrol)
index 6f5f23177aafa4383e02a64da527f20cbf7efb29..662c48ea883059dfa0b6178b7cdb9da385cf2a00 100755 (executable)
@@ -442,6 +442,8 @@ int madera_in_rate_put(struct snd_kcontrol *kcontrol,
 
 int madera_out1_demux_put(struct snd_kcontrol *kcontrol,
                          struct snd_ctl_elem_value *ucontrol);
+int madera_out1_demux_get(struct snd_kcontrol *kcontrol,
+                         struct snd_ctl_elem_value *ucontrol);
 
 int madera_dre_put(struct snd_kcontrol *kcontrol,
                   struct snd_ctl_elem_value *ucontrol);