diff options
author | Meng Wang <quic_mengw@quicinc.com> | 2021-12-21 09:12:31 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2022-05-06 10:50:36 -0700 |
commit | 95c95b2d67ee05309f31fb5d55399c97b6c84c74 (patch) | |
tree | 9daa48d207edab8079de03558de7fe5572b2f10c /dsp | |
parent | 42e49611b046e6f24fc0a06d7c723fc7ab313f0c (diff) | |
download | msm-extra-95c95b2d67ee05309f31fb5d55399c97b6c84c74.tar.gz |
asoc: update digital_cdc_rsc_mgr_hw_vote API
Update digital_cdc_rsc_mgr_hw_vote_enable/disable API with device
info for easy debug. Also, add swrm clock enable checks during SSR.
When SSR happens, swrm->hw_core_clk_en and swrm->aud_core_clk_en will
be reset without resetting audio_vote and core_vote clk. This would
cause clk mismatch in audio driver and adsp and device fails suspending
when there's no audio usecase. Make this change to reset audio_vote
and core_vote clk when receiving SWR_DEVICE_SSR_DOWN.
Change-Id: I9875aac9f6faf8b6481457a70f31b005073369e0
Signed-off-by: Meng Wang <quic_mengw@quicinc.com>
Diffstat (limited to 'dsp')
-rw-r--r-- | dsp/digital-cdc-rsc-mgr.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/dsp/digital-cdc-rsc-mgr.c b/dsp/digital-cdc-rsc-mgr.c index be5d5cad..c69fea55 100644 --- a/dsp/digital-cdc-rsc-mgr.c +++ b/dsp/digital-cdc-rsc-mgr.c @@ -1,12 +1,14 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/clk.h> #include <linux/clk-provider.h> #include <linux/ratelimit.h> #include <dsp/digital-cdc-rsc-mgr.h> +#include <linux/dev_printk.h> struct mutex hw_vote_lock; static bool is_init_done; @@ -15,10 +17,11 @@ static bool is_init_done; * digital_cdc_rsc_mgr_hw_vote_enable - Enables hw vote in DSP * * @vote_handle: vote handle for which voting needs to be done + * @dev: indicate which device votes * * Returns 0 on success or -EINVAL/error code on failure */ -int digital_cdc_rsc_mgr_hw_vote_enable(struct clk* vote_handle) +int digital_cdc_rsc_mgr_hw_vote_enable(struct clk *vote_handle, struct device *dev) { int ret = 0; @@ -32,7 +35,7 @@ int digital_cdc_rsc_mgr_hw_vote_enable(struct clk* vote_handle) ret = clk_prepare_enable(vote_handle); mutex_unlock(&hw_vote_lock); - pr_debug("%s: return %d\n", __func__, ret); + dev_dbg(dev, "%s: return %d\n", __func__, ret); trace_printk("%s: return %d\n", __func__, ret); return ret; } @@ -42,9 +45,10 @@ EXPORT_SYMBOL(digital_cdc_rsc_mgr_hw_vote_enable); * digital_cdc_rsc_mgr_hw_vote_disable - Disables hw vote in DSP * * @vote_handle: vote handle for which voting needs to be disabled + * @dev: indicate which device unvotes * */ -void digital_cdc_rsc_mgr_hw_vote_disable(struct clk* vote_handle) +void digital_cdc_rsc_mgr_hw_vote_disable(struct clk *vote_handle, struct device *dev) { if (!is_init_done || vote_handle == NULL) { pr_err_ratelimited("%s: init failed or vote handle NULL\n", @@ -55,6 +59,7 @@ void digital_cdc_rsc_mgr_hw_vote_disable(struct clk* vote_handle) mutex_lock(&hw_vote_lock); clk_disable_unprepare(vote_handle); mutex_unlock(&hw_vote_lock); + dev_dbg(dev, "%s: leave\n", __func__); trace_printk("%s\n", __func__); } EXPORT_SYMBOL(digital_cdc_rsc_mgr_hw_vote_disable); |