ASoC: codecs: lpass: do not reset soundwire block on clk enable

resetting soundwire block will put the slaves out of sync and result
in re-enumeration during fsgen disable/enable path this is totally
unnecessary and resulting fifo overflows.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230209122806.18923-8-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Srinivas Kandagatla 2023-02-09 12:28:05 +00:00 committed by Mark Brown
parent e762143437
commit ddffe3b828
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
4 changed files with 44 additions and 29 deletions

View File

@ -3441,16 +3441,10 @@ static int swclk_gate_enable(struct clk_hw *hw)
} }
rx_macro_mclk_enable(rx, true); rx_macro_mclk_enable(rx, true);
regmap_update_bits(rx->regmap, CDC_RX_CLK_RST_CTRL_SWR_CONTROL,
CDC_RX_SWR_RESET_MASK,
CDC_RX_SWR_RESET);
regmap_update_bits(rx->regmap, CDC_RX_CLK_RST_CTRL_SWR_CONTROL, regmap_update_bits(rx->regmap, CDC_RX_CLK_RST_CTRL_SWR_CONTROL,
CDC_RX_SWR_CLK_EN_MASK, 1); CDC_RX_SWR_CLK_EN_MASK, 1);
regmap_update_bits(rx->regmap, CDC_RX_CLK_RST_CTRL_SWR_CONTROL,
CDC_RX_SWR_RESET_MASK, 0);
return 0; return 0;
} }
@ -3601,6 +3595,17 @@ static int rx_macro_probe(struct platform_device *pdev)
if (ret) if (ret)
goto err_fsgen; goto err_fsgen;
/* reset swr block */
regmap_update_bits(rx->regmap, CDC_RX_CLK_RST_CTRL_SWR_CONTROL,
CDC_RX_SWR_RESET_MASK,
CDC_RX_SWR_RESET);
regmap_update_bits(rx->regmap, CDC_RX_CLK_RST_CTRL_SWR_CONTROL,
CDC_RX_SWR_CLK_EN_MASK, 1);
regmap_update_bits(rx->regmap, CDC_RX_CLK_RST_CTRL_SWR_CONTROL,
CDC_RX_SWR_RESET_MASK, 0);
ret = devm_snd_soc_register_component(dev, &rx_macro_component_drv, ret = devm_snd_soc_register_component(dev, &rx_macro_component_drv,
rx_macro_dai, rx_macro_dai,
ARRAY_SIZE(rx_macro_dai)); ARRAY_SIZE(rx_macro_dai));

View File

@ -1861,15 +1861,10 @@ static int swclk_gate_enable(struct clk_hw *hw)
} }
tx_macro_mclk_enable(tx, true); tx_macro_mclk_enable(tx, true);
regmap_update_bits(regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL,
CDC_TX_SWR_RESET_MASK, CDC_TX_SWR_RESET_ENABLE);
regmap_update_bits(regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, regmap_update_bits(regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL,
CDC_TX_SWR_CLK_EN_MASK, CDC_TX_SWR_CLK_EN_MASK,
CDC_TX_SWR_CLK_ENABLE); CDC_TX_SWR_CLK_ENABLE);
regmap_update_bits(regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL,
CDC_TX_SWR_RESET_MASK, 0x0);
return 0; return 0;
} }
@ -2036,6 +2031,16 @@ static int tx_macro_probe(struct platform_device *pdev)
if (ret) if (ret)
goto err_fsgen; goto err_fsgen;
/* reset soundwire block */
regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL,
CDC_TX_SWR_RESET_MASK, CDC_TX_SWR_RESET_ENABLE);
regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL,
CDC_TX_SWR_CLK_EN_MASK,
CDC_TX_SWR_CLK_ENABLE);
regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL,
CDC_TX_SWR_RESET_MASK, 0x0);
ret = devm_snd_soc_register_component(dev, &tx_macro_component_drv, ret = devm_snd_soc_register_component(dev, &tx_macro_component_drv,
tx_macro_dai, tx_macro_dai,
ARRAY_SIZE(tx_macro_dai)); ARRAY_SIZE(tx_macro_dai));

View File

@ -1333,17 +1333,9 @@ static int fsgen_gate_enable(struct clk_hw *hw)
int ret; int ret;
ret = va_macro_mclk_enable(va, true); ret = va_macro_mclk_enable(va, true);
if (!va->has_swr_master) if (va->has_swr_master)
return ret;
regmap_update_bits(regmap, CDC_VA_CLK_RST_CTRL_SWR_CONTROL, regmap_update_bits(regmap, CDC_VA_CLK_RST_CTRL_SWR_CONTROL,
CDC_VA_SWR_RESET_MASK, CDC_VA_SWR_RESET_ENABLE); CDC_VA_SWR_CLK_EN_MASK, CDC_VA_SWR_CLK_ENABLE);
regmap_update_bits(regmap, CDC_VA_CLK_RST_CTRL_SWR_CONTROL,
CDC_VA_SWR_CLK_EN_MASK,
CDC_VA_SWR_CLK_ENABLE);
regmap_update_bits(regmap, CDC_VA_CLK_RST_CTRL_SWR_CONTROL,
CDC_VA_SWR_RESET_MASK, 0x0);
return ret; return ret;
} }
@ -1538,6 +1530,15 @@ static int va_macro_probe(struct platform_device *pdev)
} }
if (va->has_swr_master) {
regmap_update_bits(va->regmap, CDC_VA_CLK_RST_CTRL_SWR_CONTROL,
CDC_VA_SWR_RESET_MASK, CDC_VA_SWR_RESET_ENABLE);
regmap_update_bits(va->regmap, CDC_VA_CLK_RST_CTRL_SWR_CONTROL,
CDC_VA_SWR_CLK_EN_MASK, CDC_VA_SWR_CLK_ENABLE);
regmap_update_bits(va->regmap, CDC_VA_CLK_RST_CTRL_SWR_CONTROL,
CDC_VA_SWR_RESET_MASK, 0x0);
}
ret = devm_snd_soc_register_component(dev, &va_macro_component_drv, ret = devm_snd_soc_register_component(dev, &va_macro_component_drv,
va_macro_dais, va_macro_dais,
ARRAY_SIZE(va_macro_dais)); ARRAY_SIZE(va_macro_dais));

View File

@ -2270,17 +2270,10 @@ static int wsa_swrm_clock(struct wsa_macro *wsa, bool enable)
} }
wsa_macro_mclk_enable(wsa, true); wsa_macro_mclk_enable(wsa, true);
/* reset swr ip */
regmap_update_bits(regmap, CDC_WSA_CLK_RST_CTRL_SWR_CONTROL,
CDC_WSA_SWR_RST_EN_MASK, CDC_WSA_SWR_RST_ENABLE);
regmap_update_bits(regmap, CDC_WSA_CLK_RST_CTRL_SWR_CONTROL, regmap_update_bits(regmap, CDC_WSA_CLK_RST_CTRL_SWR_CONTROL,
CDC_WSA_SWR_CLK_EN_MASK, CDC_WSA_SWR_CLK_EN_MASK,
CDC_WSA_SWR_CLK_ENABLE); CDC_WSA_SWR_CLK_ENABLE);
/* Bring out of reset */
regmap_update_bits(regmap, CDC_WSA_CLK_RST_CTRL_SWR_CONTROL,
CDC_WSA_SWR_RST_EN_MASK, CDC_WSA_SWR_RST_DISABLE);
} else { } else {
regmap_update_bits(regmap, CDC_WSA_CLK_RST_CTRL_SWR_CONTROL, regmap_update_bits(regmap, CDC_WSA_CLK_RST_CTRL_SWR_CONTROL,
CDC_WSA_SWR_CLK_EN_MASK, 0); CDC_WSA_SWR_CLK_EN_MASK, 0);
@ -2451,6 +2444,17 @@ static int wsa_macro_probe(struct platform_device *pdev)
if (ret) if (ret)
goto err_fsgen; goto err_fsgen;
/* reset swr ip */
regmap_update_bits(wsa->regmap, CDC_WSA_CLK_RST_CTRL_SWR_CONTROL,
CDC_WSA_SWR_RST_EN_MASK, CDC_WSA_SWR_RST_ENABLE);
regmap_update_bits(wsa->regmap, CDC_WSA_CLK_RST_CTRL_SWR_CONTROL,
CDC_WSA_SWR_CLK_EN_MASK, CDC_WSA_SWR_CLK_ENABLE);
/* Bring out of reset */
regmap_update_bits(wsa->regmap, CDC_WSA_CLK_RST_CTRL_SWR_CONTROL,
CDC_WSA_SWR_RST_EN_MASK, CDC_WSA_SWR_RST_DISABLE);
ret = devm_snd_soc_register_component(dev, &wsa_macro_component_drv, ret = devm_snd_soc_register_component(dev, &wsa_macro_component_drv,
wsa_macro_dai, wsa_macro_dai,
ARRAY_SIZE(wsa_macro_dai)); ARRAY_SIZE(wsa_macro_dai));