From 9e3d83c52844f955aa2975f78cee48bf9f72f5e1 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Mandadapu Date: Sat, 26 Feb 2022 23:39:18 +0530 Subject: 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 Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reported-by: kernel test robot Link: https://lore.kernel.org/r/1645898959-11231-2-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown --- sound/soc/codecs/lpass-tx-macro.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sound/soc/codecs/lpass-tx-macro.c') diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c index f2f0d1c4c438..b492d5984819 100644 --- a/sound/soc/codecs/lpass-tx-macro.c +++ b/sound/soc/codecs/lpass-tx-macro.c @@ -14,6 +14,8 @@ #include #include +#include "lpass-macro-common.h" + #define CDC_TX_CLK_RST_CTRL_MCLK_CONTROL (0x0000) #define CDC_TX_MCLK_EN_MASK BIT(0) #define CDC_TX_MCLK_ENABLE BIT(0) @@ -271,6 +273,7 @@ struct tx_macro { u16 dmic_clk_div; bool bcs_enable; int dec_mode[NUM_DECIMATORS]; + struct lpass_macro *pds; bool bcs_clk_en; }; #define to_tx_macro(_hw) container_of(_hw, struct tx_macro, hw) @@ -1820,6 +1823,10 @@ static int tx_macro_probe(struct platform_device *pdev) if (IS_ERR(tx->fsgen)) return PTR_ERR(tx->fsgen); + tx->pds = lpass_macro_pds_init(dev); + if (IS_ERR(tx->pds)) + return PTR_ERR(tx->pds); + base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(base)) return PTR_ERR(base); @@ -1957,6 +1964,8 @@ static int __maybe_unused tx_macro_runtime_resume(struct device *dev) regcache_sync(tx->regmap); tx->reset_swr = true; + lpass_macro_pds_exit(tx->pds); + return 0; err_fsgen: clk_disable_unprepare(tx->npl); -- cgit