Revert "Revert "ASoC: bolero: check clock source before clock switch""
This reverts commit 68cbba47d0
as this
causes AMIC SVA issue.
Change-Id: I0e66c97dfc9499c30942ce2e3a123be58833eac8
Signed-off-by: Meng Wang <mengw@codeaurora.org>
This commit is contained in:
@@ -2848,6 +2848,36 @@ static int tx_macro_clk_div_get(struct snd_soc_component *component)
|
||||
return tx_priv->dmic_clk_div;
|
||||
}
|
||||
|
||||
static int tx_macro_clk_switch(struct snd_soc_component *component, int clk_src)
|
||||
{
|
||||
struct device *tx_dev = NULL;
|
||||
struct tx_macro_priv *tx_priv = NULL;
|
||||
int ret = 0;
|
||||
|
||||
if (!component)
|
||||
return -EINVAL;
|
||||
|
||||
tx_dev = bolero_get_device_ptr(component->dev, TX_MACRO);
|
||||
if (!tx_dev) {
|
||||
dev_err(component->dev,
|
||||
"%s: null device for macro!\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
tx_priv = dev_get_drvdata(tx_dev);
|
||||
if (!tx_priv) {
|
||||
dev_err(component->dev,
|
||||
"%s: priv is null for macro!\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (tx_priv->swr_ctrl_data) {
|
||||
ret = swrm_wcd_notify(
|
||||
tx_priv->swr_ctrl_data[0].tx_swr_pdev,
|
||||
SWR_REQ_CLK_SWITCH, &clk_src);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int tx_macro_core_vote(void *handle, bool enable)
|
||||
{
|
||||
struct tx_macro_priv *tx_priv = (struct tx_macro_priv *) handle;
|
||||
@@ -3331,6 +3361,7 @@ static void tx_macro_init_ops(struct macro_ops *ops,
|
||||
ops->reg_wake_irq = tx_macro_reg_wake_irq;
|
||||
ops->set_port_map = tx_macro_set_port_map;
|
||||
ops->clk_div_get = tx_macro_clk_div_get;
|
||||
ops->clk_switch = tx_macro_clk_switch;
|
||||
ops->reg_evt_listener = tx_macro_register_event_listener;
|
||||
ops->clk_enable = __tx_macro_mclk_enable;
|
||||
}
|
||||
|
Reference in New Issue
Block a user