ALSA: hda/realtek: Fix build error without CONFIG_PM

The alc_spec.power_hook is defined only with CONFIG_PM, and the recent
fix overlooked it, resulting in a build error without CONFIG_PM.
Fix it with the simple ifdef and set __maybe_unused for the function.

We may drop the whole CONFIG_PM dependency there, but it should be
done in a separate cleanup patch later.

Fixes: 1e707769df ("ALSA: hda/realtek - Set GPIO3 to default at S4 state for Thinkpad with ALC1318")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202405012104.Dr7h318W-lkp@intel.com/
Message-ID: <20240502062442.30545-1-tiwai@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2024-05-02 08:24:42 +02:00
parent a30a7a29c3
commit fdb3f29dfe
1 changed files with 3 additions and 1 deletions

View File

@ -7204,7 +7204,7 @@ static void alc287_alc1318_playback_pcm_hook(struct hda_pcm_stream *hinfo,
} }
} }
static void alc287_s4_power_gpio3_default(struct hda_codec *codec) static void __maybe_unused alc287_s4_power_gpio3_default(struct hda_codec *codec)
{ {
if (is_s4_suspend(codec)) { if (is_s4_suspend(codec)) {
alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */ alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */
@ -7219,7 +7219,9 @@ static void alc287_fixup_lenovo_thinkpad_with_alc1318(struct hda_codec *codec,
if (action != HDA_FIXUP_ACT_PRE_PROBE) if (action != HDA_FIXUP_ACT_PRE_PROBE)
return; return;
#ifdef CONFIG_PM
spec->power_hook = alc287_s4_power_gpio3_default; spec->power_hook = alc287_s4_power_gpio3_default;
#endif
spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook; spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook;
} }