Loading drivers/soundwire/swr-wcd-ctrl.c +22 −4 Original line number Diff line number Diff line Loading @@ -457,12 +457,16 @@ static int swrm_read(struct swr_master *master, u8 dev_num, u32 reg_addr, { struct swr_mstr_ctrl *swrm = swr_get_ctrl_data(master); if (!swrm) { dev_err(&master->dev, "%s: swrm is NULL\n", __func__); return -EINVAL; } if (pm_runtime_suspended(&swrm->pdev->dev)) { dev_dbg(swrm->dev, "%s: suspended state, enable pm_runtime\n", __func__); pm_runtime_get_sync(&swrm->pdev->dev); pm_runtime_mark_last_busy(&swrm->pdev->dev); pm_runtime_put_autosuspend(&swrm->pdev->dev); swrm->is_suspend = true; } if (dev_num) { Loading @@ -477,6 +481,11 @@ static int swrm_read(struct swr_master *master, u8 dev_num, u32 reg_addr, return -EINVAL; } } pm_runtime_mark_last_busy(&swrm->pdev->dev); if (swrm->is_suspend) { pm_runtime_put_autosuspend(&swrm->pdev->dev); swrm->is_suspend = false; } return 0; } Loading @@ -486,12 +495,16 @@ static int swrm_write(struct swr_master *master, u8 dev_num, u32 reg_addr, struct swr_mstr_ctrl *swrm = swr_get_ctrl_data(master); int ret = 0; if (!swrm) { dev_err(&master->dev, "%s: swrm is NULL\n", __func__); return -EINVAL; } if (pm_runtime_suspended(&swrm->pdev->dev)) { dev_dbg(swrm->dev, "%s: suspended state, enable pm_runtime\n", __func__); pm_runtime_get_sync(&swrm->pdev->dev); pm_runtime_mark_last_busy(&swrm->pdev->dev); pm_runtime_put_autosuspend(&swrm->pdev->dev); swrm->is_suspend = true; } if (dev_num) { Loading @@ -505,6 +518,11 @@ static int swrm_write(struct swr_master *master, u8 dev_num, u32 reg_addr, return -EINVAL; } } pm_runtime_mark_last_busy(&swrm->pdev->dev); if (swrm->is_suspend) { pm_runtime_put_autosuspend(&swrm->pdev->dev); swrm->is_suspend = false; } return ret; } Loading drivers/soundwire/swr-wcd-ctrl.h +1 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ struct swr_mstr_ctrl { struct list_head mport_list; int state; struct platform_device *pdev; bool is_suspend; }; #endif /* _SWR_WCD_CTRL_H */ Loading
drivers/soundwire/swr-wcd-ctrl.c +22 −4 Original line number Diff line number Diff line Loading @@ -457,12 +457,16 @@ static int swrm_read(struct swr_master *master, u8 dev_num, u32 reg_addr, { struct swr_mstr_ctrl *swrm = swr_get_ctrl_data(master); if (!swrm) { dev_err(&master->dev, "%s: swrm is NULL\n", __func__); return -EINVAL; } if (pm_runtime_suspended(&swrm->pdev->dev)) { dev_dbg(swrm->dev, "%s: suspended state, enable pm_runtime\n", __func__); pm_runtime_get_sync(&swrm->pdev->dev); pm_runtime_mark_last_busy(&swrm->pdev->dev); pm_runtime_put_autosuspend(&swrm->pdev->dev); swrm->is_suspend = true; } if (dev_num) { Loading @@ -477,6 +481,11 @@ static int swrm_read(struct swr_master *master, u8 dev_num, u32 reg_addr, return -EINVAL; } } pm_runtime_mark_last_busy(&swrm->pdev->dev); if (swrm->is_suspend) { pm_runtime_put_autosuspend(&swrm->pdev->dev); swrm->is_suspend = false; } return 0; } Loading @@ -486,12 +495,16 @@ static int swrm_write(struct swr_master *master, u8 dev_num, u32 reg_addr, struct swr_mstr_ctrl *swrm = swr_get_ctrl_data(master); int ret = 0; if (!swrm) { dev_err(&master->dev, "%s: swrm is NULL\n", __func__); return -EINVAL; } if (pm_runtime_suspended(&swrm->pdev->dev)) { dev_dbg(swrm->dev, "%s: suspended state, enable pm_runtime\n", __func__); pm_runtime_get_sync(&swrm->pdev->dev); pm_runtime_mark_last_busy(&swrm->pdev->dev); pm_runtime_put_autosuspend(&swrm->pdev->dev); swrm->is_suspend = true; } if (dev_num) { Loading @@ -505,6 +518,11 @@ static int swrm_write(struct swr_master *master, u8 dev_num, u32 reg_addr, return -EINVAL; } } pm_runtime_mark_last_busy(&swrm->pdev->dev); if (swrm->is_suspend) { pm_runtime_put_autosuspend(&swrm->pdev->dev); swrm->is_suspend = false; } return ret; } Loading
drivers/soundwire/swr-wcd-ctrl.h +1 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ struct swr_mstr_ctrl { struct list_head mport_list; int state; struct platform_device *pdev; bool is_suspend; }; #endif /* _SWR_WCD_CTRL_H */