soc: fix HS LPI issue for holi target
- Skip audio hm voting during bootup. - Vote and unvote audio hm vote during swrm_runtime_suspend and swrm_runtime_resume Change-Id: I7a9c20f62ba0d87779b26da218bfe7373132b565
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
69fffecae6
commit
4015ed0c54
@@ -2751,6 +2751,11 @@ static int swrm_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
devm_kfree(&pdev->dev, temp);
|
devm_kfree(&pdev->dev, temp);
|
||||||
|
|
||||||
|
ret = of_property_read_u32(pdev->dev.of_node, "qcom,is-always-on",
|
||||||
|
&swrm->is_always_on);
|
||||||
|
if (ret)
|
||||||
|
dev_dbg(&pdev->dev, "%s: failed to get is_always_on flag\n", __func__);
|
||||||
|
|
||||||
swrm->reg_irq = pdata->reg_irq;
|
swrm->reg_irq = pdata->reg_irq;
|
||||||
swrm->master.read = swrm_read;
|
swrm->master.read = swrm_read;
|
||||||
swrm->master.write = swrm_write;
|
swrm->master.write = swrm_write;
|
||||||
@@ -2873,7 +2878,7 @@ static int swrm_probe(struct platform_device *pdev)
|
|||||||
* controller will be up now
|
* controller will be up now
|
||||||
*/
|
*/
|
||||||
swr_master_add_boarddevices(&swrm->master);
|
swr_master_add_boarddevices(&swrm->master);
|
||||||
if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true))
|
if (!swrm->is_always_on && swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true))
|
||||||
dev_dbg(&pdev->dev, "%s: Audio HW Vote is failed\n", __func__);
|
dev_dbg(&pdev->dev, "%s: Audio HW Vote is failed\n", __func__);
|
||||||
mutex_lock(&swrm->mlock);
|
mutex_lock(&swrm->mlock);
|
||||||
swrm_clk_request(swrm, true);
|
swrm_clk_request(swrm, true);
|
||||||
@@ -3021,7 +3026,7 @@ static int swrm_runtime_resume(struct device *dev)
|
|||||||
struct swr_mstr_ctrl *swrm = platform_get_drvdata(pdev);
|
struct swr_mstr_ctrl *swrm = platform_get_drvdata(pdev);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
bool swrm_clk_req_err = false;
|
bool swrm_clk_req_err = false;
|
||||||
bool hw_core_err = false;
|
bool hw_core_err = false, aud_core_err = false;
|
||||||
struct swr_master *mstr = &swrm->master;
|
struct swr_master *mstr = &swrm->master;
|
||||||
struct swr_device *swr_dev;
|
struct swr_device *swr_dev;
|
||||||
u32 temp = 0;
|
u32 temp = 0;
|
||||||
@@ -3037,9 +3042,11 @@ static int swrm_runtime_resume(struct device *dev)
|
|||||||
__func__);
|
__func__);
|
||||||
hw_core_err = true;
|
hw_core_err = true;
|
||||||
}
|
}
|
||||||
if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true))
|
if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true)) {
|
||||||
dev_err(dev, "%s:lpass audio hw enable failed\n",
|
dev_err(dev, "%s:lpass audio hw enable failed\n",
|
||||||
__func__);
|
__func__);
|
||||||
|
aud_core_err = true;
|
||||||
|
}
|
||||||
|
|
||||||
if ((swrm->state == SWR_MSTR_DOWN) ||
|
if ((swrm->state == SWR_MSTR_DOWN) ||
|
||||||
(swrm->state == SWR_MSTR_SSR && swrm->dev_up)) {
|
(swrm->state == SWR_MSTR_SSR && swrm->dev_up)) {
|
||||||
@@ -3130,6 +3137,9 @@ static int swrm_runtime_resume(struct device *dev)
|
|||||||
swrm->state = SWR_MSTR_UP;
|
swrm->state = SWR_MSTR_UP;
|
||||||
}
|
}
|
||||||
exit:
|
exit:
|
||||||
|
if (swrm->is_always_on && !aud_core_err)
|
||||||
|
swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, false);
|
||||||
|
|
||||||
if (!hw_core_err)
|
if (!hw_core_err)
|
||||||
swrm_request_hw_vote(swrm, LPASS_HW_CORE, false);
|
swrm_request_hw_vote(swrm, LPASS_HW_CORE, false);
|
||||||
if (swrm_clk_req_err)
|
if (swrm_clk_req_err)
|
||||||
@@ -3152,7 +3162,7 @@ static int swrm_runtime_suspend(struct device *dev)
|
|||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
struct swr_mstr_ctrl *swrm = platform_get_drvdata(pdev);
|
struct swr_mstr_ctrl *swrm = platform_get_drvdata(pdev);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
bool hw_core_err = false;
|
bool hw_core_err = false, aud_core_err = false;
|
||||||
struct swr_master *mstr = &swrm->master;
|
struct swr_master *mstr = &swrm->master;
|
||||||
struct swr_device *swr_dev;
|
struct swr_device *swr_dev;
|
||||||
int current_state = 0;
|
int current_state = 0;
|
||||||
@@ -3172,6 +3182,8 @@ static int swrm_runtime_suspend(struct device *dev)
|
|||||||
hw_core_err = true;
|
hw_core_err = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (swrm->is_always_on && swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true))
|
||||||
|
aud_core_err = true;
|
||||||
if ((current_state == SWR_MSTR_UP) ||
|
if ((current_state == SWR_MSTR_UP) ||
|
||||||
(current_state == SWR_MSTR_SSR)) {
|
(current_state == SWR_MSTR_SSR)) {
|
||||||
|
|
||||||
@@ -3253,11 +3265,12 @@ static int swrm_runtime_suspend(struct device *dev)
|
|||||||
swrm->state = SWR_MSTR_DOWN;
|
swrm->state = SWR_MSTR_DOWN;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if (swrm->state != SWR_MSTR_UP) {
|
if (!swrm->is_always_on && swrm->state != SWR_MSTR_UP) {
|
||||||
if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, false))
|
if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, false))
|
||||||
dev_dbg(dev, "%s:lpass audio hw enable failed\n",
|
dev_dbg(dev, "%s:lpass audio hw enable failed\n",
|
||||||
__func__);
|
__func__);
|
||||||
}
|
} else if (swrm->is_always_on && !aud_core_err)
|
||||||
|
swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, false);
|
||||||
|
|
||||||
if (!hw_core_err)
|
if (!hw_core_err)
|
||||||
swrm_request_hw_vote(swrm, LPASS_HW_CORE, false);
|
swrm_request_hw_vote(swrm, LPASS_HW_CORE, false);
|
||||||
|
@@ -194,6 +194,7 @@ struct swr_mstr_ctrl {
|
|||||||
u32 wr_fifo_depth;
|
u32 wr_fifo_depth;
|
||||||
bool enable_slave_irq;
|
bool enable_slave_irq;
|
||||||
u64 logical_dev[SWRM_NUM_AUTO_ENUM_SLAVES];
|
u64 logical_dev[SWRM_NUM_AUTO_ENUM_SLAVES];
|
||||||
|
u32 is_always_on;
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
struct dentry *debugfs_swrm_dent;
|
struct dentry *debugfs_swrm_dent;
|
||||||
struct dentry *debugfs_peek;
|
struct dentry *debugfs_peek;
|
||||||
|
Reference in New Issue
Block a user