Commit 91745b03 authored by Colin Ian King's avatar Colin Ian King Committed by Mark Brown

ASoC: mediatek: mt8195: make several arrays static const

Don't populate various arrays on the stack but instead make them
static const. Also makes the object code smaller by a few hundred
bytes.
Signed-off-by: default avatarColin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20211129224236.506883-1-colin.i.king@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 043c0a62
...@@ -326,7 +326,7 @@ int mt8195_afe_enable_reg_rw_clk(struct mtk_base_afe *afe) ...@@ -326,7 +326,7 @@ int mt8195_afe_enable_reg_rw_clk(struct mtk_base_afe *afe)
{ {
struct mt8195_afe_private *afe_priv = afe->platform_priv; struct mt8195_afe_private *afe_priv = afe->platform_priv;
int i; int i;
unsigned int clk_array[] = { static const unsigned int clk_array[] = {
MT8195_CLK_SCP_ADSP_AUDIODSP, /* bus clock for infra */ MT8195_CLK_SCP_ADSP_AUDIODSP, /* bus clock for infra */
MT8195_CLK_TOP_AUDIO_H_SEL, /* clock for ADSP bus */ MT8195_CLK_TOP_AUDIO_H_SEL, /* clock for ADSP bus */
MT8195_CLK_TOP_AUDIO_LOCAL_BUS_SEL, /* bus clock for DRAM access */ MT8195_CLK_TOP_AUDIO_LOCAL_BUS_SEL, /* bus clock for DRAM access */
...@@ -347,7 +347,7 @@ int mt8195_afe_disable_reg_rw_clk(struct mtk_base_afe *afe) ...@@ -347,7 +347,7 @@ int mt8195_afe_disable_reg_rw_clk(struct mtk_base_afe *afe)
{ {
struct mt8195_afe_private *afe_priv = afe->platform_priv; struct mt8195_afe_private *afe_priv = afe->platform_priv;
int i; int i;
unsigned int clk_array[] = { static const unsigned int clk_array[] = {
MT8195_CLK_AUD_A1SYS, MT8195_CLK_AUD_A1SYS,
MT8195_CLK_AUD_A1SYS_HP, MT8195_CLK_AUD_A1SYS_HP,
MT8195_CLK_AUD_AFE, MT8195_CLK_AUD_AFE,
...@@ -380,11 +380,11 @@ static int mt8195_afe_enable_timing_sys(struct mtk_base_afe *afe) ...@@ -380,11 +380,11 @@ static int mt8195_afe_enable_timing_sys(struct mtk_base_afe *afe)
{ {
struct mt8195_afe_private *afe_priv = afe->platform_priv; struct mt8195_afe_private *afe_priv = afe->platform_priv;
int i; int i;
unsigned int clk_array[] = { static const unsigned int clk_array[] = {
MT8195_CLK_AUD_A1SYS, MT8195_CLK_AUD_A1SYS,
MT8195_CLK_AUD_A2SYS, MT8195_CLK_AUD_A2SYS,
}; };
unsigned int cg_array[] = { static const unsigned int cg_array[] = {
MT8195_TOP_CG_A1SYS_TIMING, MT8195_TOP_CG_A1SYS_TIMING,
MT8195_TOP_CG_A2SYS_TIMING, MT8195_TOP_CG_A2SYS_TIMING,
MT8195_TOP_CG_26M_TIMING, MT8195_TOP_CG_26M_TIMING,
...@@ -403,11 +403,11 @@ static int mt8195_afe_disable_timing_sys(struct mtk_base_afe *afe) ...@@ -403,11 +403,11 @@ static int mt8195_afe_disable_timing_sys(struct mtk_base_afe *afe)
{ {
struct mt8195_afe_private *afe_priv = afe->platform_priv; struct mt8195_afe_private *afe_priv = afe->platform_priv;
int i; int i;
unsigned int clk_array[] = { static const unsigned int clk_array[] = {
MT8195_CLK_AUD_A2SYS, MT8195_CLK_AUD_A2SYS,
MT8195_CLK_AUD_A1SYS, MT8195_CLK_AUD_A1SYS,
}; };
unsigned int cg_array[] = { static const unsigned int cg_array[] = {
MT8195_TOP_CG_26M_TIMING, MT8195_TOP_CG_26M_TIMING,
MT8195_TOP_CG_A2SYS_TIMING, MT8195_TOP_CG_A2SYS_TIMING,
MT8195_TOP_CG_A1SYS_TIMING, MT8195_TOP_CG_A1SYS_TIMING,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment