soc: soundwire: Check for clock source before clock switch
Check for soundwire clock source before clock switch to avoid redundant clock switch for the same clock source. Change-Id: I8a7a116cc956f427af677b413928dace5a39a23d Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
f34687bd3a
commit
fd25834b84
@@ -3101,9 +3101,18 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|||||||
* next activity on soundwire will request clock from new clock
|
* next activity on soundwire will request clock from new clock
|
||||||
* source.
|
* source.
|
||||||
*/
|
*/
|
||||||
|
if (!data) {
|
||||||
|
dev_err(swrm->dev, "%s: data is NULL for id:%d\n",
|
||||||
|
__func__, id);
|
||||||
|
ret = -EINVAL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
mutex_lock(&swrm->mlock);
|
mutex_lock(&swrm->mlock);
|
||||||
if (swrm->state == SWR_MSTR_UP)
|
if (swrm->clk_src != *(int *)data) {
|
||||||
swrm_device_suspend(&pdev->dev);
|
if (swrm->state == SWR_MSTR_UP)
|
||||||
|
swrm_device_suspend(&pdev->dev);
|
||||||
|
swrm->clk_src = *(int *)data;
|
||||||
|
}
|
||||||
mutex_unlock(&swrm->mlock);
|
mutex_unlock(&swrm->mlock);
|
||||||
break;
|
break;
|
||||||
case SWR_CLK_FREQ:
|
case SWR_CLK_FREQ:
|
||||||
|
@@ -187,6 +187,7 @@ struct swr_mstr_ctrl {
|
|||||||
u32 swr_irq_wakeup_capable;
|
u32 swr_irq_wakeup_capable;
|
||||||
int hw_core_clk_en;
|
int hw_core_clk_en;
|
||||||
int aud_core_clk_en;
|
int aud_core_clk_en;
|
||||||
|
int clk_src;
|
||||||
#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