aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/codecs/lpass-va-macro.c
diff options
context:
space:
mode:
authorSrinivasa Rao Mandadapu <quic_srivasam@quicinc.com>2022-02-26 23:39:18 +0530
committerMark Brown <broonie@kernel.org>2022-02-28 13:30:37 +0000
commit9e3d83c52844f955aa2975f78cee48bf9f72f5e1 (patch)
treef63b833a6f6b608d9b27dcd0507473ae305179c1 /sound/soc/codecs/lpass-va-macro.c
parentASoC: codecs: add pm runtime support for Qualcomm codecs (diff)
downloadwireguard-linux-9e3d83c52844f955aa2975f78cee48bf9f72f5e1.tar.xz
wireguard-linux-9e3d83c52844f955aa2975f78cee48bf9f72f5e1.zip
ASoC: codecs: Add power domains support in digital macro codecs
Add support for enabling required power domains in digital macro codecs. macro and dcodec power domains are being requested as clocks by HLOS in ADSP based architectures and ADSP internally handling as powerdomains. In ADSP bypass case need to handle them as power domains explicitly. Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com> Co-developed-by: Venkata Prasad Potturu <quic_potturu@quicinc.com> Signed-off-by: Venkata Prasad Potturu <quic_potturu@quicinc.com> Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/1645898959-11231-2-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/lpass-va-macro.c')
-rw-r--r--sound/soc/codecs/lpass-va-macro.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c
index 4687319303da..275f2cd78c9c 100644
--- a/sound/soc/codecs/lpass-va-macro.c
+++ b/sound/soc/codecs/lpass-va-macro.c
@@ -16,6 +16,8 @@
#include <sound/soc-dapm.h>
#include <sound/tlv.h>
+#include "lpass-macro-common.h"
+
/* VA macro registers */
#define CDC_VA_CLK_RST_CTRL_MCLK_CONTROL (0x0000)
#define CDC_VA_MCLK_CONTROL_EN BIT(0)
@@ -198,6 +200,7 @@ struct va_macro {
struct clk *macro;
struct clk *dcodec;
struct clk_hw hw;
+ struct lpass_macro *pds;
s32 dmic_0_1_clk_cnt;
s32 dmic_2_3_clk_cnt;
@@ -1420,6 +1423,10 @@ static int va_macro_probe(struct platform_device *pdev)
if (IS_ERR(va->mclk))
return PTR_ERR(va->mclk);
+ va->pds = lpass_macro_pds_init(dev);
+ if (IS_ERR(va->pds))
+ return PTR_ERR(va->pds);
+
ret = of_property_read_u32(dev->of_node, "qcom,dmic-sample-rate",
&sample_rate);
if (ret) {
@@ -1524,6 +1531,9 @@ static int __maybe_unused va_macro_runtime_resume(struct device *dev)
regcache_cache_only(va->regmap, false);
regcache_sync(va->regmap);
+
+ lpass_macro_pds_exit(va->pds);
+
return 0;
}