summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/lpass-tx-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-tx-macro.c
parent0f907c3880f82cf9e8884c98aa70dd9e61221dfc (diff)
downloadlinux-next-9e3d83c52844f955aa2975f78cee48bf9f72f5e1.tar.gz
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-tx-macro.c')
-rw-r--r--sound/soc/codecs/lpass-tx-macro.c9
1 files changed, 9 insertions, 0 deletions
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 <linux/of_clk.h>
#include <linux/clk-provider.h>
+#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);