|
@@ -2474,6 +2474,8 @@ static int swrm_runtime_resume(struct device *dev)
|
|
|
swr_master_write(swrm, SWRM_COMP_SW_RESET, 0x01);
|
|
|
swr_master_write(swrm, SWRM_COMP_SW_RESET, 0x01);
|
|
|
swrm_master_init(swrm);
|
|
|
+ /* wait for hw enumeration to complete */
|
|
|
+ usleep_range(100, 105);
|
|
|
swrm_cmd_fifo_wr_cmd(swrm, 0x4, 0xF, 0x0,
|
|
|
SWRS_SCP_INT_STATUS_MASK_1);
|
|
|
if (swrm->state == SWR_MSTR_SSR) {
|
|
@@ -2614,22 +2616,14 @@ static int swrm_device_down(struct device *dev)
|
|
|
{
|
|
|
struct platform_device *pdev = to_platform_device(dev);
|
|
|
struct swr_mstr_ctrl *swrm = platform_get_drvdata(pdev);
|
|
|
- int ret = 0;
|
|
|
|
|
|
dev_dbg(dev, "%s: swrm state: %d\n", __func__, swrm->state);
|
|
|
|
|
|
mutex_lock(&swrm->force_down_lock);
|
|
|
swrm->state = SWR_MSTR_SSR;
|
|
|
mutex_unlock(&swrm->force_down_lock);
|
|
|
- if (!pm_runtime_enabled(dev) || !pm_runtime_suspended(dev)) {
|
|
|
- ret = swrm_runtime_suspend(dev);
|
|
|
- if (!ret) {
|
|
|
- pm_runtime_disable(dev);
|
|
|
- pm_runtime_set_suspended(dev);
|
|
|
- pm_runtime_enable(dev);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
+ swrm_device_suspend(dev);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -2763,6 +2757,14 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
|
ret = -EINVAL;
|
|
|
} else {
|
|
|
mutex_lock(&swrm->mlock);
|
|
|
+ if (swrm->mclk_freq != *(int *)data) {
|
|
|
+ dev_dbg(swrm->dev, "%s: freq change: force mstr down\n", __func__);
|
|
|
+ if (swrm->state == SWR_MSTR_DOWN)
|
|
|
+ dev_dbg(swrm->dev, "%s:SWR master is already Down:%d\n",
|
|
|
+ __func__, swrm->state);
|
|
|
+ else
|
|
|
+ swrm_device_suspend(&pdev->dev);
|
|
|
+ }
|
|
|
swrm->mclk_freq = *(int *)data;
|
|
|
mutex_unlock(&swrm->mlock);
|
|
|
}
|