asoc: va-macro: Update clk_div switch based on decimation rate.

Update clk_div setting for low power decimations based on
decimation rate instead of lpi flag.

Change-Id: I6e445618af4bf159f3d88a7bc5d07a403a06c1ab
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
This commit is contained in:
Ashwini Muduganti
2020-10-15 11:25:08 +05:30
parent 7c9ef4221e
commit dfe6739490

View File

@@ -173,6 +173,7 @@ struct va_macro_priv {
int dapm_tx_clk_status;
bool lpi_enable;
bool register_event_listener;
bool clk_div_switch;
int dec_mode[VA_MACRO_NUM_DECIMATORS];
u16 current_clk_id;
};
@@ -206,7 +207,7 @@ static int va_macro_clk_div_get(struct snd_soc_component *component)
return -EINVAL;
if ((va_priv->version >= BOLERO_VERSION_2_0)
&& !va_priv->lpi_enable
&& va_priv->clk_div_switch
&& (va_priv->dmic_clk_div == VA_MACRO_CLK_DIV_16))
return VA_MACRO_CLK_DIV_8;
@@ -1524,6 +1525,10 @@ static int va_macro_hw_params(struct snd_pcm_substream *substream,
params_channels(params));
sample_rate = params_rate(params);
if (sample_rate > 16000)
va_priv->clk_div_switch = true;
else
va_priv->clk_div_switch = false;
switch (sample_rate) {
case 8000:
tx_fs_rate = 0;