mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: da7219: scope AAD suspend and resume helpers to CONFIG_PM
@ 2026-03-10  8:23 Pengpeng Hou
  2026-03-11 10:47 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-03-10  8:23 UTC (permalink / raw)
  To: Support Opensource, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-sound, linux-kernel, Pengpeng Hou

In current linux.git, da7219_aad_suspend() and
da7219_aad_resume() are defined and declared unconditionally. However,
their only in-tree callers are the component PM callbacks in da7219.c,
which are already guarded by #ifdef CONFIG_PM.

This inconsistency leads to unnecessary code inclusion and potential
compiler warnings when CONFIG_PM is disabled. Match the helper
declarations and definitions to the callers' scope and provide no-op
!CONFIG_PM stubs in the header.

Signed-off-by: Pengpeng Hou <pengpeng.hou@isrc.iscas.ac.cn>
---

Hi Mark, 
I have rebased this patch against the current tree. The previous version 
failed to apply likely due to context shifts in the AAD header/source file.

Changes in v2:
- Rebased on top of the latest tree to fix application failure.
- No functional changes from v1.

 sound/soc/codecs/da7219-aad.c | 3 ++-
 sound/soc/codecs/da7219-aad.h | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/da7219-aad.c b/sound/soc/codecs/da7219-aad.c
index d9d932a78b710..0b3b108aaeee5 100644
--- a/sound/soc/codecs/da7219-aad.c
+++ b/sound/soc/codecs/da7219-aad.c
@@ -924,6 +924,7 @@ static void da7219_aad_handle_gnd_switch_time(struct snd_soc_component *componen
  * Suspend/Resume
  */
 
+#ifdef CONFIG_PM
 void da7219_aad_suspend(struct snd_soc_component *component)
 {
 	struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
@@ -981,7 +982,7 @@ void da7219_aad_resume(struct snd_soc_component *component)
 
 	enable_irq(da7219_aad->irq);
 }
-
+#endif
 
 /*
  * Init/Exit
diff --git a/sound/soc/codecs/da7219-aad.h b/sound/soc/codecs/da7219-aad.h
index fbfbf3e67918d..ea5b818192477 100644
--- a/sound/soc/codecs/da7219-aad.h
+++ b/sound/soc/codecs/da7219-aad.h
@@ -209,8 +209,13 @@ struct da7219_aad_priv {
 void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jack *jack);
 
 /* Suspend/Resume */
+#ifdef CONFIG_PM
 void da7219_aad_suspend(struct snd_soc_component *component);
 void da7219_aad_resume(struct snd_soc_component *component);
+#else
+static inline void da7219_aad_suspend(struct snd_soc_component *component) { }
+static inline void da7219_aad_resume(struct snd_soc_component *component) { }
+#endif
 
 /* Init/Exit */
 int da7219_aad_init(struct snd_soc_component *component);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-11 10:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-10  8:23 [PATCH v2] ASoC: da7219: scope AAD suspend and resume helpers to CONFIG_PM Pengpeng Hou
2026-03-11 10:47 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®