From 8e500743e58665c25a5e4916c49226c409a1c797 Mon Sep 17 00:00:00 2001 From: Sudheer Papothi Date: Sun, 8 Nov 2020 04:31:12 +0530 Subject: [PATCH] ASoC: codec: Update clock configurations to support different codec clocks Update codec clock configurations to support different codec clocks. Change-Id: I0ec41a337dbe955da6d93c3f2c31f381aea123eb Signed-off-by: Sudheer Papothi --- asoc/codecs/audio-ext-clk-up.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/asoc/codecs/audio-ext-clk-up.c b/asoc/codecs/audio-ext-clk-up.c index d3604cf27a..cabc9078dd 100644 --- a/asoc/codecs/audio-ext-clk-up.c +++ b/asoc/codecs/audio-ext-clk-up.c @@ -34,6 +34,7 @@ enum { AUDIO_EXT_CLK_LPASS_CORE_HW_VOTE, AUDIO_EXT_CLK_LPASS8, AUDIO_EXT_CLK_LPASS_AUDIO_HW_VOTE, + AUDIO_EXT_CLK_LPASS9, AUDIO_EXT_CLK_LPASS_MAX, AUDIO_EXT_CLK_EXTERNAL_PLL = AUDIO_EXT_CLK_LPASS_MAX, AUDIO_EXT_CLK_MAX, @@ -160,6 +161,16 @@ static u8 audio_ext_clk_get_parent(struct clk_hw *hw) } pr_debug("%s: parent index = %u\n", __func__, ret); return ret; + } else if ((clk_priv->clk_src >= AUDIO_EXT_CLK_LPASS6) && + (clk_priv->clk_src < AUDIO_EXT_CLK_LPASS_MAX) && + clk_priv->clk_name) { + for (i = 0; i < num_parents; i++) { + if (!strcmp(parent_names[i], + clk_priv->clk_name)) + ret = i; + } + pr_debug("%s: parent index = %u\n", __func__, ret); + return ret; } else return 0; } @@ -371,6 +382,9 @@ static struct audio_ext_clk audio_clk_array[] = { .div = 1, .hw.init = &(struct clk_init_data){ .name = "audio_lpass_mclk6", + .parent_names = (const char *[]) + { "audio_lpass_mclk5" }, + .num_parents = 1, .ops = &audio_ext_clk_ops, }, }, @@ -382,6 +396,9 @@ static struct audio_ext_clk audio_clk_array[] = { .div = 1, .hw.init = &(struct clk_init_data){ .name = "audio_lpass_mclk7", + .parent_names = (const char *[]) + { "audio_lpass_mclk5" }, + .num_parents = 1, .ops = &audio_ext_clk_ops, }, }, @@ -402,6 +419,9 @@ static struct audio_ext_clk audio_clk_array[] = { .div = 1, .hw.init = &(struct clk_init_data){ .name = "audio_lpass_mclk8", + .parent_names = (const char *[]) + { "audio_lpass_mclk5" }, + .num_parents = 1, .ops = &audio_ext_clk_ops, }, }, @@ -415,6 +435,20 @@ static struct audio_ext_clk audio_clk_array[] = { }, }, }, + { + .pnctrl_info = {NULL}, + .fact = { + .mult = 1, + .div = 1, + .hw.init = &(struct clk_init_data){ + .name = "audio_lpass_mclk9", + .parent_names = (const char *[]) + { "audio_lpass_mclk5" }, + .num_parents = 1, + .ops = &audio_ext_clk_ops, + }, + }, + }, { .pnctrl_info = {NULL}, .fact = {