Skip to content

Commit c469652

Browse files
committed
ALSA: hda - Use IS_REACHABLE() for dependency on input
The commit ffcd28d ("ALSA: hda - Select INPUT for Realtek HD-audio codec") introduced the reverse-selection of CONFIG_INPUT for Realtek codec in order to avoid the mess with dependency between built-in and modules. Later on, we obtained IS_REACHABLE() macro exactly for this kind of problems, and now we can remove th INPUT selection in Kconfig and put IS_REACHABLE(INPUT) to the appropriate places in the code, so that the driver doesn't need to select other subsystem forcibly. Fixes: ffcd28d ("ALSA: hda - Select INPUT for Realtek HD-audio codec") Reported-by: Randy Dunlap <[email protected]> Acked-by: Randy Dunlap <[email protected]> # and build-tested Signed-off-by: Takashi Iwai <[email protected]>
1 parent 671ec85 commit c469652

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

sound/pci/hda/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ config SND_HDA_PATCH_LOADER
8888
config SND_HDA_CODEC_REALTEK
8989
tristate "Build Realtek HD-audio codec support"
9090
select SND_HDA_GENERIC
91-
select INPUT
9291
help
9392
Say Y or M here to include Realtek HD-audio codec support in
9493
snd-hda-intel driver, such as ALC880.

sound/pci/hda/patch_realtek.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3810,6 +3810,7 @@ static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
38103810
}
38113811
}
38123812

3813+
#if IS_REACHABLE(INPUT)
38133814
static void gpio2_mic_hotkey_event(struct hda_codec *codec,
38143815
struct hda_jack_callback *event)
38153816
{
@@ -3942,6 +3943,10 @@ static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
39423943
spec->kb_dev = NULL;
39433944
}
39443945
}
3946+
#else /* INPUT */
3947+
#define alc280_fixup_hp_gpio2_mic_hotkey NULL
3948+
#define alc233_fixup_lenovo_line2_mic_hotkey NULL
3949+
#endif /* INPUT */
39453950

39463951
static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
39473952
const struct hda_fixup *fix, int action)

0 commit comments

Comments
 (0)