|
@@ -566,10 +566,24 @@ static int lpass_cdc_va_macro_mclk_event(struct snd_soc_dapm_widget *w,
|
|
|
if (!ret)
|
|
|
va_priv->dapm_tx_clk_status++;
|
|
|
|
|
|
- ret = lpass_cdc_va_macro_mclk_enable(va_priv, 1, true);
|
|
|
+ if (va_priv->clk_id == TX_CORE_CLK) {
|
|
|
+ ret = lpass_cdc_va_macro_mclk_enable(va_priv, 1, true);
|
|
|
+ } else {
|
|
|
+ if (va_priv->lpi_enable)
|
|
|
+ ret = lpass_cdc_va_macro_mclk_enable(va_priv, 1, true);
|
|
|
+ else
|
|
|
+ ret = lpass_cdc_tx_mclk_enable(component, 1);
|
|
|
+ }
|
|
|
break;
|
|
|
case SND_SOC_DAPM_POST_PMD:
|
|
|
- lpass_cdc_va_macro_mclk_enable(va_priv, 0, true);
|
|
|
+ if (va_priv->clk_id == TX_CORE_CLK) {
|
|
|
+ lpass_cdc_va_macro_mclk_enable(va_priv, 0, true);
|
|
|
+ } else {
|
|
|
+ if (va_priv->lpi_enable)
|
|
|
+ lpass_cdc_va_macro_mclk_enable(va_priv, 0, true);
|
|
|
+ else
|
|
|
+ lpass_cdc_tx_mclk_enable(component, 0);
|
|
|
+ }
|
|
|
|
|
|
if (va_priv->dapm_tx_clk_status > 0) {
|
|
|
lpass_cdc_clk_rsc_request_clock(va_priv->dev,
|
|
@@ -2368,7 +2382,7 @@ static int lpass_cdc_va_macro_probe(struct platform_device *pdev)
|
|
|
const char *micb_current_str = "qcom,va-vdd-micb-current";
|
|
|
int ret = 0;
|
|
|
const char *dmic_sample_rate = "qcom,va-dmic-sample-rate";
|
|
|
- u32 default_clk_id = 0;
|
|
|
+ u32 default_clk_id = 0, use_clk_id = 0;
|
|
|
struct clk *lpass_audio_hw_vote = NULL;
|
|
|
u32 is_used_va_swr_gpio = 0;
|
|
|
const char *is_used_va_swr_gpio_dt = "qcom,is-used-swr-gpio";
|
|
@@ -2475,14 +2489,24 @@ static int lpass_cdc_va_macro_probe(struct platform_device *pdev)
|
|
|
return ret;
|
|
|
}
|
|
|
}
|
|
|
+ use_clk_id = VA_CORE_CLK; /* default to using VA CORE CLK */
|
|
|
+ if (of_find_property(pdev->dev.of_node, "qcom,use-clk-id", NULL)) {
|
|
|
+ ret = of_property_read_u32(pdev->dev.of_node, "qcom,use-clk-id",
|
|
|
+ &use_clk_id);
|
|
|
+ if (ret) {
|
|
|
+ dev_dbg(&pdev->dev, "%s: could not find %s entry in dt\n",
|
|
|
+ __func__, "qcom,use-clk-id");
|
|
|
+ use_clk_id = VA_CORE_CLK;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ va_priv->clk_id = use_clk_id;
|
|
|
ret = of_property_read_u32(pdev->dev.of_node, "qcom,default-clk-id",
|
|
|
&default_clk_id);
|
|
|
if (ret) {
|
|
|
dev_err(&pdev->dev, "%s: could not find %s entry in dt\n",
|
|
|
__func__, "qcom,default-clk-id");
|
|
|
- default_clk_id = TX_CORE_CLK;
|
|
|
+ default_clk_id = use_clk_id;
|
|
|
}
|
|
|
- va_priv->clk_id = TX_CORE_CLK;
|
|
|
va_priv->default_clk_id = default_clk_id;
|
|
|
va_priv->current_clk_id = TX_CORE_CLK;
|
|
|
|