Merge commit 'd9fa9d435ba1b92cf0f0361a0749107b7abc45a5' into audio-kernel-5-4.lnx.1.0

Change-Id: Iaf98532030ee4ef5fe6a70df083a685733dd5670
This commit is contained in:
Phani Kumar Uppalapati
2020-11-05 18:35:53 -08:00
34 changed files with 618 additions and 227 deletions

View File

@@ -180,6 +180,7 @@ struct tx_macro_priv {
bool lpi_enable;
bool register_event_listener;
u16 current_clk_id;
int disable_afe_wakeup_event_listener;
};
static bool tx_macro_get_data(struct snd_soc_component *component,
@@ -2643,17 +2644,15 @@ static int tx_macro_register_event_listener(struct snd_soc_component *component,
if (tx_priv->swr_ctrl_data &&
(!tx_priv->tx_swr_clk_cnt || !tx_priv->va_swr_clk_cnt)) {
if (enable) {
ret = swrm_wcd_notify(
tx_priv->swr_ctrl_data[0].tx_swr_pdev,
SWR_REGISTER_WAKEUP, NULL);
msm_cdc_pinctrl_set_wakeup_capable(
tx_priv->tx_swr_gpio_p, false);
if (!tx_priv->disable_afe_wakeup_event_listener)
ret = swrm_wcd_notify(
tx_priv->swr_ctrl_data[0].tx_swr_pdev,
SWR_REGISTER_WAKEUP, NULL);
} else {
msm_cdc_pinctrl_set_wakeup_capable(
tx_priv->tx_swr_gpio_p, true);
ret = swrm_wcd_notify(
tx_priv->swr_ctrl_data[0].tx_swr_pdev,
SWR_DEREGISTER_WAKEUP, NULL);
if (!tx_priv->disable_afe_wakeup_event_listener)
ret = swrm_wcd_notify(
tx_priv->swr_ctrl_data[0].tx_swr_pdev,
SWR_DEREGISTER_WAKEUP, NULL);
}
}
@@ -2685,6 +2684,8 @@ static int tx_macro_tx_va_mclk_enable(struct tx_macro_priv *tx_priv,
__func__);
goto exit;
}
msm_cdc_pinctrl_set_wakeup_capable(
tx_priv->tx_swr_gpio_p, false);
}
clk_tx_ret = bolero_clk_rsc_request_clock(tx_priv->dev,
@@ -2813,6 +2814,8 @@ tx_clk:
TX_CORE_CLK,
false);
if (tx_priv->swr_clk_users == 0) {
msm_cdc_pinctrl_set_wakeup_capable(
tx_priv->tx_swr_gpio_p, true);
ret = msm_cdc_pinctrl_select_sleep_state(
tx_priv->tx_swr_gpio_p);
if (ret < 0) {
@@ -3409,6 +3412,9 @@ static int tx_macro_probe(struct platform_device *pdev)
const char *dmic_sample_rate = "qcom,tx-dmic-sample-rate";
u32 is_used_tx_swr_gpio = 1;
const char *is_used_tx_swr_gpio_dt = "qcom,is-used-swr-gpio";
u32 disable_afe_wakeup_event_listener = 0;
const char *disable_afe_wakeup_event_listener_dt =
"qcom,disable-afe-wakeup-event-listener";
if (!bolero_is_va_macro_registered(&pdev->dev)) {
dev_err(&pdev->dev,
@@ -3475,6 +3481,19 @@ static int tx_macro_probe(struct platform_device *pdev)
sample_rate, tx_priv) == TX_MACRO_DMIC_SAMPLE_RATE_UNDEFINED)
return -EINVAL;
}
if (of_find_property(pdev->dev.of_node,
disable_afe_wakeup_event_listener_dt, NULL)) {
ret = of_property_read_u32(pdev->dev.of_node,
disable_afe_wakeup_event_listener_dt,
&disable_afe_wakeup_event_listener);
if (ret)
dev_dbg(&pdev->dev, "%s: error reading %s in dt\n",
__func__, disable_afe_wakeup_event_listener_dt);
}
tx_priv->disable_afe_wakeup_event_listener =
disable_afe_wakeup_event_listener;
if (is_used_tx_swr_gpio) {
tx_priv->reset_swr = true;
INIT_WORK(&tx_priv->tx_macro_add_child_devices_work,