@@ -41,6 +41,7 @@ struct rt5682_platform_data {
unsigned int dmic_clk_rate;
unsigned int dmic_delay;
bool dmic_clk_driving_high;
+ bool ldo2_pow_en;
const char *dai_clk_names[RT5682_DAI_NUM_CLKS];
};
@@ -1343,6 +1343,19 @@ static int is_using_asrc(struct snd_soc_dapm_widget *w,
}
}
+static int is_using_ldo2(struct snd_soc_dapm_widget *w,
+ struct snd_soc_dapm_widget *sink)
+{
+ struct snd_soc_component *component =
+ snd_soc_dapm_to_component(w->dapm);
+ struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
+
+ if (rt5682->pdata.ldo2_pow_en)
+ return 1;
+
+ return 0;
+}
+
/* Digital Mixer */
static const struct snd_kcontrol_new rt5682_sto1_adc_l_mix[] = {
SOC_DAPM_SINGLE("ADC1 Switch", RT5682_STO1_ADC_MIXER,
@@ -1854,7 +1867,7 @@ static const struct snd_soc_dapm_route rt5682_dapm_routes[] = {
{"CLKDET SYS", NULL, "CLKDET"},
- {"IN1P", NULL, "LDO2"},
+ {"IN1P", NULL, "LDO2", is_using_ldo2},
{"BST1 CBJ", NULL, "IN1P"},
@@ -2999,6 +3012,9 @@ int rt5682_parse_dt(struct rt5682_priv *rt5682, struct device *dev)
rt5682->pdata.dmic_clk_driving_high = device_property_read_bool(dev,
"realtek,dmic-clk-driving-high");
+ rt5682->pdata.ldo2_pow_en = device_property_read_bool(dev,
+ "realtek,ldo2-pow-en");
+
return 0;
}
EXPORT_SYMBOL_GPL(rt5682_parse_dt);