|
@@ -2458,6 +2458,8 @@ static int swrm_probe(struct platform_device *pdev)
|
|
|
ret = -EINVAL;
|
|
|
goto err_pdata_fail;
|
|
|
}
|
|
|
+ swrm->pinctrl_setup = pdata->pinctrl_setup;
|
|
|
+
|
|
|
if (of_property_read_u32(pdev->dev.of_node,
|
|
|
"qcom,swr-clock-stop-mode0",
|
|
|
&swrm->clk_stop_mode0_supp)) {
|
|
@@ -2779,7 +2781,6 @@ static int swrm_runtime_resume(struct device *dev)
|
|
|
int ret = 0;
|
|
|
bool swrm_clk_req_err = false;
|
|
|
bool hw_core_err = false;
|
|
|
- bool aud_core_err = false;
|
|
|
struct swr_master *mstr = &swrm->master;
|
|
|
struct swr_device *swr_dev;
|
|
|
u32 temp = 0;
|
|
@@ -2798,7 +2799,7 @@ static int swrm_runtime_resume(struct device *dev)
|
|
|
if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true)) {
|
|
|
dev_err(dev, "%s:lpass audio hw enable failed\n",
|
|
|
__func__);
|
|
|
- aud_core_err = true;
|
|
|
+ swrm->aud_core_err = true;
|
|
|
}
|
|
|
|
|
|
if ((swrm->state == SWR_MSTR_DOWN) ||
|
|
@@ -2817,6 +2818,9 @@ static int swrm_runtime_resume(struct device *dev)
|
|
|
irq_get_irq_data(swrm->wake_irq)))
|
|
|
disable_irq_nosync(swrm->wake_irq);
|
|
|
mutex_unlock(&swrm->irq_lock);
|
|
|
+ if (swrm->dmic_sva && swrm->pinctrl_setup)
|
|
|
+ swrm->pinctrl_setup(swrm->handle,
|
|
|
+ false);
|
|
|
}
|
|
|
if (swrm->ipc_wakeup)
|
|
|
msm_aud_evt_blocking_notifier_call_chain(
|
|
@@ -2890,7 +2894,7 @@ static int swrm_runtime_resume(struct device *dev)
|
|
|
swrm->state = SWR_MSTR_UP;
|
|
|
}
|
|
|
exit:
|
|
|
- if (!aud_core_err)
|
|
|
+ if (ret && !swrm->aud_core_err)
|
|
|
swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, false);
|
|
|
if (!hw_core_err)
|
|
|
swrm_request_hw_vote(swrm, LPASS_HW_CORE, false);
|
|
@@ -2913,7 +2917,6 @@ static int swrm_runtime_suspend(struct device *dev)
|
|
|
struct swr_mstr_ctrl *swrm = platform_get_drvdata(pdev);
|
|
|
int ret = 0;
|
|
|
bool hw_core_err = false;
|
|
|
- bool aud_core_err = false;
|
|
|
struct swr_master *mstr = &swrm->master;
|
|
|
struct swr_device *swr_dev;
|
|
|
int current_state = 0;
|
|
@@ -2932,11 +2935,6 @@ static int swrm_runtime_suspend(struct device *dev)
|
|
|
__func__);
|
|
|
hw_core_err = true;
|
|
|
}
|
|
|
- if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true)) {
|
|
|
- dev_err(dev, "%s:lpass audio hw enable failed\n",
|
|
|
- __func__);
|
|
|
- aud_core_err = true;
|
|
|
- }
|
|
|
|
|
|
if ((current_state == SWR_MSTR_UP) ||
|
|
|
(current_state == SWR_MSTR_SSR)) {
|
|
@@ -3005,6 +3003,8 @@ static int swrm_runtime_suspend(struct device *dev)
|
|
|
|
|
|
if (swrm->clk_stop_mode0_supp) {
|
|
|
if (swrm->wake_irq > 0) {
|
|
|
+ if (swrm->dmic_sva && swrm->pinctrl_setup)
|
|
|
+ swrm->pinctrl_setup(swrm->handle, true);
|
|
|
enable_irq(swrm->wake_irq);
|
|
|
} else if (swrm->ipc_wakeup) {
|
|
|
msm_aud_evt_blocking_notifier_call_chain(
|
|
@@ -3018,10 +3018,11 @@ static int swrm_runtime_suspend(struct device *dev)
|
|
|
if (current_state != SWR_MSTR_SSR)
|
|
|
swrm->state = SWR_MSTR_DOWN;
|
|
|
exit:
|
|
|
- if (!aud_core_err)
|
|
|
+ if (!swrm->aud_core_err)
|
|
|
swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, false);
|
|
|
if (!hw_core_err)
|
|
|
swrm_request_hw_vote(swrm, LPASS_HW_CORE, false);
|
|
|
+ swrm->aud_core_err = false;
|
|
|
mutex_unlock(&swrm->reslock);
|
|
|
trace_printk("%s: pm_runtime: suspend done state: %d\n",
|
|
|
__func__, swrm->state);
|
|
@@ -3353,10 +3354,12 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
|
case SWR_REGISTER_WAKEUP:
|
|
|
msm_aud_evt_blocking_notifier_call_chain(
|
|
|
SWR_WAKE_IRQ_REGISTER, (void *)swrm);
|
|
|
+ swrm->dmic_sva = *(u32 *)data;
|
|
|
break;
|
|
|
case SWR_DEREGISTER_WAKEUP:
|
|
|
msm_aud_evt_blocking_notifier_call_chain(
|
|
|
SWR_WAKE_IRQ_DEREGISTER, (void *)swrm);
|
|
|
+ swrm->dmic_sva = 0;
|
|
|
break;
|
|
|
case SWR_SET_PORT_MAP:
|
|
|
if (!data) {
|