From f40ecc2743652c0b0f19935f81baf57c601eb7f0 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 11 Jul 2025 02:26:39 +0000 Subject: [PATCH 1/5] ASoC: soc-dapm: set bias_level if snd_soc_dapm_set_bias_level() was successed ASoC has 2 functions to set bias level. (A) snd_soc_dapm_force_bias_level() (B) snd_soc_dapm_set_bias_level() snd_soc_dapm_force_bias_level() (A) will set dapm->bias_level (a) if successed. (A) int snd_soc_dapm_force_bias_level(...) { ... if (ret == 0) (a) dapm->bias_level = level; ... } snd_soc_dapm_set_bias_level() (B) is also a function that sets bias_level. It will call snd_soc_dapm_force_bias_level() (A) inside, but doesn't set dapm->bias_level by itself. One note is that (A) might not be called. (B) static int snd_soc_dapm_set_bias_level(...) { ... ret = snd_soc_card_set_bias_level(...); ... if (dapm != &card->dapm) (A) ret = snd_soc_dapm_force_bias_level(...); ... ret = snd_soc_card_set_bias_level_post(...); ... } dapm->bias_level will be set if (A) was called, but might not be set if (B) was called, even though it calles set_bias_level() function. We should set dapm->bias_level if we calls snd_soc_dapm_set_bias_level() (B), too. Signed-off-by: Kuninori Morimoto Link: https://patch.msgid.link/87qzyn4g4h.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- sound/soc/soc-dapm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index b8a5875378c8..a37d44cd04c6 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1030,6 +1030,10 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm, out: trace_snd_soc_bias_level_done(dapm, level); + /* success */ + if (ret == 0) + snd_soc_dapm_init_bias_level(dapm, level); + return ret; } From 88f60cb4b8c96241d86a68da57dc5b52488240cf Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 11 Jul 2025 02:26:54 +0000 Subject: [PATCH 2/5] ASoC: samsung: bell: don't set dapm->bias_level directly snd_soc_dapm_set_bias_level() (A) will set dapm->bias_level (a) inside. No need to set it by each callback function. Remove it. (A) static int snd_soc_dapm_set_bias_level(...) { ... /* success */ if (ret == 0) (a) snd_soc_dapm_init_bias_level(dapm, level); ... } Signed-off-by: Kuninori Morimoto Link: https://patch.msgid.link/87ple74g47.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- sound/soc/samsung/bells.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sound/soc/samsung/bells.c b/sound/soc/samsung/bells.c index 8dc3b2da4c8f..61ed5e69391a 100644 --- a/sound/soc/samsung/bells.c +++ b/sound/soc/samsung/bells.c @@ -133,8 +133,6 @@ static int bells_set_bias_level_post(struct snd_soc_card *card, break; } - dapm->bias_level = level; - return 0; } From d2f423a4f4ecabd852c5ee5076596399488d4b75 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 11 Jul 2025 02:27:04 +0000 Subject: [PATCH 3/5] ASoC: samsung: speyside: don't set dapm->bias_level directly snd_soc_dapm_set_bias_level() (A) will set dapm->bias_level (a) inside. No need to set it by each callback function. Remove it. (A) static int snd_soc_dapm_set_bias_level(...) { ... /* success */ if (ret == 0) (a) snd_soc_dapm_init_bias_level(dapm, level); ... } Signed-off-by: Kuninori Morimoto Link: https://patch.msgid.link/87o6tr4g3r.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- sound/soc/samsung/speyside.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c index 9262e5626584..f4cc5684ef0a 100644 --- a/sound/soc/samsung/speyside.c +++ b/sound/soc/samsung/speyside.c @@ -90,8 +90,6 @@ static int speyside_set_bias_level_post(struct snd_soc_card *card, break; } - card->dapm.bias_level = level; - return 0; } From 4421e455d2c33a86cdb19f3a0854a59de1542321 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 11 Jul 2025 02:27:12 +0000 Subject: [PATCH 4/5] ASoC: samsung: tobermory: don't set dapm->bias_level directly snd_soc_dapm_set_bias_level() (A) will set dapm->bias_level (a) inside. No need to set it by each callback function. Remove it. (A) static int snd_soc_dapm_set_bias_level(...) { ... /* success */ if (ret == 0) (a) snd_soc_dapm_init_bias_level(dapm, level); ... } Signed-off-by: Kuninori Morimoto Link: https://patch.msgid.link/87ms9b4g3j.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- sound/soc/samsung/tobermory.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sound/soc/samsung/tobermory.c b/sound/soc/samsung/tobermory.c index d0f0c01365aa..1d0a782402f0 100644 --- a/sound/soc/samsung/tobermory.c +++ b/sound/soc/samsung/tobermory.c @@ -91,8 +91,6 @@ static int tobermory_set_bias_level_post(struct snd_soc_card *card, break; } - dapm->bias_level = level; - return 0; } From f00e06296ba3f0d8440030afe8cc2258758b7af7 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 11 Jul 2025 02:27:19 +0000 Subject: [PATCH 5/5] ASoC: samsung: littlemill: don't set dapm->bias_level directly snd_soc_dapm_set_bias_level() (A) will set dapm->bias_level (a) inside. No need to set it by each callback function. Remove it. (A) static int snd_soc_dapm_set_bias_level(...) { ... /* success */ if (ret == 0) (a) snd_soc_dapm_init_bias_level(dapm, level); ... } Signed-off-by: Kuninori Morimoto Link: https://patch.msgid.link/87ldov4g3c.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- sound/soc/samsung/littlemill.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sound/soc/samsung/littlemill.c b/sound/soc/samsung/littlemill.c index 5a02aac9b423..c8b06894ac88 100644 --- a/sound/soc/samsung/littlemill.c +++ b/sound/soc/samsung/littlemill.c @@ -95,8 +95,6 @@ static int littlemill_set_bias_level_post(struct snd_soc_card *card, break; } - dapm->bias_level = level; - return 0; }