Skip to content

Commit ffcd28d

Browse files
committed
ALSA: hda - Select INPUT for Realtek HD-audio codec
The commit commit [33f4acd: ALSA: hda - Enable mic mute hotkey and LEDs for an HP machine] introduced a quirk for a HP machine involving with the input event handling. Although the relevant code is protected via IS_ENABLED(CONFIG_INPUT), this doesn't suffice when the audio driver is built in while the input is module. As an easy workaround, this patch forcibly selects CONFIG_INPUT in Kconfig. This shouldn't be a practical problem since CONFIG_INPUT is almost mandatory for all systems. Also, this allows to remove the ugly ifdefs in the code. Fixes: 33f4acd ('ALSA: hda - Enable mic mute hotkey and LEDs for an HP machine') Acked-by: David Henningsson <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent fd4e8dd commit ffcd28d

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

sound/pci/hda/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ config SND_HDA_PATCH_LOADER
107107
config SND_HDA_CODEC_REALTEK
108108
tristate "Build Realtek HD-audio codec support"
109109
select SND_HDA_GENERIC
110+
select INPUT
110111
help
111112
Say Y or M here to include Realtek HD-audio codec support in
112113
snd-hda-intel driver, such as ALC880.

sound/pci/hda/patch_realtek.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,7 @@ struct alc_spec {
121121
hda_nid_t pll_nid;
122122
unsigned int pll_coef_idx, pll_coef_bit;
123123
unsigned int coef0;
124-
#if IS_ENABLED(CONFIG_INPUT)
125124
struct input_dev *kb_dev;
126-
#endif
127125
};
128126

129127
/*
@@ -3476,7 +3474,6 @@ static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
34763474
}
34773475
}
34783476

3479-
#if IS_ENABLED(CONFIG_INPUT)
34803477
static void gpio2_mic_hotkey_event(struct hda_codec *codec,
34813478
struct hda_jack_callback *event)
34823479
{
@@ -3489,12 +3486,10 @@ static void gpio2_mic_hotkey_event(struct hda_codec *codec,
34893486
input_report_key(spec->kb_dev, KEY_MICMUTE, 0);
34903487
input_sync(spec->kb_dev);
34913488
}
3492-
#endif
34933489

34943490
static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
34953491
const struct hda_fixup *fix, int action)
34963492
{
3497-
#if IS_ENABLED(CONFIG_INPUT)
34983493
/* GPIO1 = set according to SKU external amp
34993494
GPIO2 = mic mute hotkey
35003495
GPIO3 = mute LED
@@ -3550,7 +3545,6 @@ static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
35503545
input_unregister_device(spec->kb_dev);
35513546
spec->kb_dev = NULL;
35523547
}
3553-
#endif
35543548
}
35553549

35563550
static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,

0 commit comments

Comments
 (0)