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
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)
{
}
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)
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);