Loading soc/swr-mstr-ctrl.c +15 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/irq.h> Loading Loading @@ -1738,6 +1738,8 @@ static int swrm_slvdev_datapath_control(struct swr_master *master, bool enable) dev_dbg(&master->dev, "%s: pm_runtime auto suspend triggered\n", __func__); pm_runtime_mark_last_busy(swrm->dev); if (!enable) pm_runtime_set_autosuspend_delay(swrm->dev, 80); pm_runtime_put_autosuspend(swrm->dev); } exit: Loading Loading @@ -2848,6 +2850,7 @@ static int swrm_probe(struct platform_device *pdev) mutex_init(&swrm->clklock); mutex_init(&swrm->devlock); mutex_init(&swrm->pm_lock); mutex_init(&swrm->runtime_lock); swrm->wlock_holders = 0; swrm->pm_state = SWRM_PM_SLEEPABLE; init_waitqueue_head(&swrm->pm_wq); Loading Loading @@ -3020,6 +3023,7 @@ static int swrm_probe(struct platform_device *pdev) mutex_destroy(&swrm->clklock); mutex_destroy(&swrm->pm_lock); pm_qos_remove_request(&swrm->pm_qos_req); mutex_destroy(&swrm->runtime_lock); err_pdata_fail: err_memory_fail: Loading Loading @@ -3059,6 +3063,7 @@ static int swrm_remove(struct platform_device *pdev) mutex_destroy(&swrm->force_down_lock); mutex_destroy(&swrm->pm_lock); pm_qos_remove_request(&swrm->pm_qos_req); mutex_destroy(&swrm->runtime_lock); devm_kfree(&pdev->dev, swrm); return 0; } Loading Loading @@ -3090,6 +3095,7 @@ static int swrm_runtime_resume(struct device *dev) dev_dbg(dev, "%s: pm_runtime: resume, state:%d\n", __func__, swrm->state); mutex_lock(&swrm->runtime_lock); mutex_lock(&swrm->reslock); if (swrm_request_hw_vote(swrm, LPASS_HW_CORE, true)) { Loading @@ -3101,6 +3107,7 @@ static int swrm_runtime_resume(struct device *dev) if (swrm->req_clk_switch) swrm->req_clk_switch = false; mutex_unlock(&swrm->reslock); mutex_unlock(&swrm->runtime_lock); return 0; } if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true)) { Loading @@ -3118,6 +3125,7 @@ static int swrm_runtime_resume(struct device *dev) pr_err("%s: irq data is NULL\n", __func__); mutex_unlock(&swrm->reslock); mutex_unlock(&swrm->runtime_lock); return IRQ_NONE; } mutex_lock(&swrm->irq_lock); Loading Loading @@ -3209,6 +3217,7 @@ static int swrm_runtime_resume(struct device *dev) if (swrm->req_clk_switch) swrm->req_clk_switch = false; mutex_unlock(&swrm->reslock); mutex_unlock(&swrm->runtime_lock); return ret; } Loading @@ -3230,6 +3239,7 @@ static int swrm_runtime_suspend(struct device *dev) swrm->state = SWR_MSTR_SSR; return 0; } mutex_lock(&swrm->runtime_lock); mutex_lock(&swrm->reslock); mutex_lock(&swrm->force_down_lock); current_state = swrm->state; Loading Loading @@ -3327,6 +3337,10 @@ static int swrm_runtime_suspend(struct device *dev) if (!hw_core_err) swrm_request_hw_vote(swrm, LPASS_HW_CORE, false); mutex_unlock(&swrm->reslock); mutex_unlock(&swrm->runtime_lock); dev_dbg(dev, "%s: pm_runtime: suspend done state: %d\n", __func__, swrm->state); pm_runtime_set_autosuspend_delay(dev, auto_suspend_timer); return ret; } #endif /* CONFIG_PM */ Loading soc/swr-mstr-ctrl.h +2 −0 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef _SWR_WCD_CTRL_H Loading Loading @@ -134,6 +135,7 @@ struct swr_mstr_ctrl { struct mutex reslock; struct mutex pm_lock; struct mutex irq_lock; struct mutex runtime_lock; u32 swrm_base_reg; char __iomem *swrm_dig_base; char __iomem *swrm_hctl_reg; Loading Loading
soc/swr-mstr-ctrl.c +15 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/irq.h> Loading Loading @@ -1738,6 +1738,8 @@ static int swrm_slvdev_datapath_control(struct swr_master *master, bool enable) dev_dbg(&master->dev, "%s: pm_runtime auto suspend triggered\n", __func__); pm_runtime_mark_last_busy(swrm->dev); if (!enable) pm_runtime_set_autosuspend_delay(swrm->dev, 80); pm_runtime_put_autosuspend(swrm->dev); } exit: Loading Loading @@ -2848,6 +2850,7 @@ static int swrm_probe(struct platform_device *pdev) mutex_init(&swrm->clklock); mutex_init(&swrm->devlock); mutex_init(&swrm->pm_lock); mutex_init(&swrm->runtime_lock); swrm->wlock_holders = 0; swrm->pm_state = SWRM_PM_SLEEPABLE; init_waitqueue_head(&swrm->pm_wq); Loading Loading @@ -3020,6 +3023,7 @@ static int swrm_probe(struct platform_device *pdev) mutex_destroy(&swrm->clklock); mutex_destroy(&swrm->pm_lock); pm_qos_remove_request(&swrm->pm_qos_req); mutex_destroy(&swrm->runtime_lock); err_pdata_fail: err_memory_fail: Loading Loading @@ -3059,6 +3063,7 @@ static int swrm_remove(struct platform_device *pdev) mutex_destroy(&swrm->force_down_lock); mutex_destroy(&swrm->pm_lock); pm_qos_remove_request(&swrm->pm_qos_req); mutex_destroy(&swrm->runtime_lock); devm_kfree(&pdev->dev, swrm); return 0; } Loading Loading @@ -3090,6 +3095,7 @@ static int swrm_runtime_resume(struct device *dev) dev_dbg(dev, "%s: pm_runtime: resume, state:%d\n", __func__, swrm->state); mutex_lock(&swrm->runtime_lock); mutex_lock(&swrm->reslock); if (swrm_request_hw_vote(swrm, LPASS_HW_CORE, true)) { Loading @@ -3101,6 +3107,7 @@ static int swrm_runtime_resume(struct device *dev) if (swrm->req_clk_switch) swrm->req_clk_switch = false; mutex_unlock(&swrm->reslock); mutex_unlock(&swrm->runtime_lock); return 0; } if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true)) { Loading @@ -3118,6 +3125,7 @@ static int swrm_runtime_resume(struct device *dev) pr_err("%s: irq data is NULL\n", __func__); mutex_unlock(&swrm->reslock); mutex_unlock(&swrm->runtime_lock); return IRQ_NONE; } mutex_lock(&swrm->irq_lock); Loading Loading @@ -3209,6 +3217,7 @@ static int swrm_runtime_resume(struct device *dev) if (swrm->req_clk_switch) swrm->req_clk_switch = false; mutex_unlock(&swrm->reslock); mutex_unlock(&swrm->runtime_lock); return ret; } Loading @@ -3230,6 +3239,7 @@ static int swrm_runtime_suspend(struct device *dev) swrm->state = SWR_MSTR_SSR; return 0; } mutex_lock(&swrm->runtime_lock); mutex_lock(&swrm->reslock); mutex_lock(&swrm->force_down_lock); current_state = swrm->state; Loading Loading @@ -3327,6 +3337,10 @@ static int swrm_runtime_suspend(struct device *dev) if (!hw_core_err) swrm_request_hw_vote(swrm, LPASS_HW_CORE, false); mutex_unlock(&swrm->reslock); mutex_unlock(&swrm->runtime_lock); dev_dbg(dev, "%s: pm_runtime: suspend done state: %d\n", __func__, swrm->state); pm_runtime_set_autosuspend_delay(dev, auto_suspend_timer); return ret; } #endif /* CONFIG_PM */ Loading
soc/swr-mstr-ctrl.h +2 −0 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef _SWR_WCD_CTRL_H Loading Loading @@ -134,6 +135,7 @@ struct swr_mstr_ctrl { struct mutex reslock; struct mutex pm_lock; struct mutex irq_lock; struct mutex runtime_lock; u32 swrm_base_reg; char __iomem *swrm_dig_base; char __iomem *swrm_hctl_reg; Loading