Merge "asoc: codecs: Update on support for WCD938x DMICs"

This commit is contained in:
qctecmdr
2019-07-29 03:57:10 -07:00
committed by Gerrit - the friendly Code Review server
當前提交 bb4341f383
共有 2 個文件被更改,包括 36 次插入5 次删除

查看文件

@@ -415,7 +415,12 @@ static int va_macro_put_dec_enum(struct snd_kcontrol *kcontrol,
snd_soc_dapm_to_component(widget->dapm);
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
unsigned int val;
u16 mic_sel_reg;
u16 mic_sel_reg, dmic_clk_reg;
struct device *va_dev = NULL;
struct va_macro_priv *va_priv = NULL;
if (!va_macro_get_data(component, &va_dev, &va_priv, __func__))
return -EINVAL;
val = ucontrol->value.enumerated.item[0];
if (val > e->items - 1)
@@ -456,14 +461,24 @@ static int va_macro_put_dec_enum(struct snd_kcontrol *kcontrol,
}
if (strnstr(widget->name, "SMIC", strlen(widget->name))) {
if (val != 0) {
if (val < 5)
if (val < 5) {
snd_soc_component_update_bits(component,
mic_sel_reg,
1 << 7, 0x0 << 7);
else
} else {
snd_soc_component_update_bits(component,
mic_sel_reg,
1 << 7, 0x1 << 7);
snd_soc_component_update_bits(component,
BOLERO_CDC_VA_TOP_CSR_DMIC_CFG,
0x80, 0x00);
dmic_clk_reg =
BOLERO_CDC_TX_TOP_CSR_SWR_DMIC0_CTL +
((val - 5)/2) * 4;
snd_soc_component_update_bits(component,
dmic_clk_reg,
0x0E, va_priv->dmic_clk_div << 0x1);
}
}
} else {
/* DMIC selected */