Merge "ASoC: bolero: tx-macro: Fix clock sequence for headset SVA"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
aae17991cb
@@ -1660,6 +1660,36 @@ done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int tx_macro_clk_switch(struct snd_soc_component *component)
|
||||
{
|
||||
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, NULL);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int tx_macro_swrm_clock(void *handle, bool enable)
|
||||
{
|
||||
struct tx_macro_priv *tx_priv = (struct tx_macro_priv *) handle;
|
||||
@@ -2024,6 +2054,7 @@ static void tx_macro_init_ops(struct macro_ops *ops,
|
||||
ops->event_handler = tx_macro_event_handler;
|
||||
ops->reg_wake_irq = tx_macro_reg_wake_irq;
|
||||
ops->set_port_map = tx_macro_set_port_map;
|
||||
ops->clk_switch = tx_macro_clk_switch;
|
||||
}
|
||||
|
||||
static int tx_macro_probe(struct platform_device *pdev)
|
||||
|
Reference in New Issue
Block a user