asoc: lpass-cdc: update logic to vote during ssr
After ADSP is up during SSR, core_hw_vote may fail and audio_hw_vote may successed in lpass_cdc_runtime_resume which is caused some timing. When getting slave device_id, as core_hw_vote is 0, it will skip reading swr registers and return 0 which causes fail to read correct device_id. Make this change to avoid calling lpass_cdc_runtime_resume when adsp_up notification doesn't reach lpass_cdc. Change-Id: I90a97e5c47bb95180a96ba1c60b462f1fa0124b7 Signed-off-by: Meng Wang <quic_mengw@quicinc.com> Signed-off-by: Kunlei Zhang <quic_kunleiz@quicinc.com>
This commit is contained in:
@@ -503,6 +503,7 @@ struct lpass_cdc_rx_macro_priv {
|
||||
bool is_fir_coeff_written[FIR_PATH_MAX][GRP_MAX];
|
||||
bool is_fir_capable;
|
||||
bool dev_up;
|
||||
bool pre_dev_up;
|
||||
bool hph_pwr_mode;
|
||||
bool hph_hd2_mode;
|
||||
struct mutex mclk_lock;
|
||||
@@ -1424,7 +1425,8 @@ static int lpass_cdc_rx_macro_mclk_enable(
|
||||
rx_priv->default_clk_id,
|
||||
rx_priv->clk_id,
|
||||
false);
|
||||
lpass_cdc_rx_macro_core_vote(rx_priv, false);
|
||||
if (!ret)
|
||||
lpass_cdc_rx_macro_core_vote(rx_priv, false);
|
||||
rx_priv->clk_id = rx_priv->default_clk_id;
|
||||
}
|
||||
}
|
||||
@@ -1517,6 +1519,7 @@ static int lpass_cdc_rx_macro_event_handler(struct snd_soc_component *component,
|
||||
break;
|
||||
case LPASS_CDC_MACRO_EVT_SSR_DOWN:
|
||||
trace_printk("%s, enter SSR down\n", __func__);
|
||||
rx_priv->pre_dev_up = false;
|
||||
rx_priv->dev_up = false;
|
||||
if (rx_priv->swr_ctrl_data) {
|
||||
swrm_wcd_notify(
|
||||
@@ -1534,6 +1537,7 @@ static int lpass_cdc_rx_macro_event_handler(struct snd_soc_component *component,
|
||||
}
|
||||
break;
|
||||
case LPASS_CDC_MACRO_EVT_PRE_SSR_UP:
|
||||
rx_priv->pre_dev_up = true;
|
||||
ret = lpass_cdc_rx_macro_core_vote(rx_priv, true);
|
||||
if (ret < 0) {
|
||||
dev_err_ratelimited(rx_priv->dev,
|
||||
@@ -4349,6 +4353,12 @@ static int lpass_cdc_rx_macro_core_vote(void *handle, bool enable)
|
||||
pr_err_ratelimited("%s: rx priv data is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!rx_priv->pre_dev_up && enable) {
|
||||
pr_debug("%s: adsp is not up\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (enable) {
|
||||
pm_runtime_get_sync(rx_priv->dev);
|
||||
if (lpass_cdc_check_core_votes(rx_priv->dev))
|
||||
@@ -4718,6 +4728,7 @@ static int lpass_cdc_rx_macro_probe(struct platform_device *pdev)
|
||||
if (!rx_priv)
|
||||
return -ENOMEM;
|
||||
|
||||
rx_priv->pre_dev_up = true;
|
||||
rx_priv->dev = &pdev->dev;
|
||||
ret = of_property_read_u32(pdev->dev.of_node, "reg",
|
||||
&rx_base_addr);
|
||||
|
مرجع در شماره جدید
Block a user