diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-15 04:11:52 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-15 04:21:50 -0500 |
commit | ffcd28d88e4f3bdb2c300e4a13e973cd2070968e (patch) | |
tree | fb80d8f071303f2b74b3ded23bd1cfea6bd49f92 /sound/pci/hda | |
parent | fd4e8dde42bb142448e3fd7dc6094cb2707d3b64 (diff) |
ALSA: hda - Select INPUT for Realtek HD-audio codec
The commit commit [33f4acd3b214: 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: 33f4acd3b214 ('ALSA: hda - Enable mic mute hotkey and LEDs for an HP machine')
Acked-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/Kconfig | 1 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 6 |
2 files changed, 1 insertions, 6 deletions
diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig index ebf4c2fb99df..7f0f2c5a4e97 100644 --- a/sound/pci/hda/Kconfig +++ b/sound/pci/hda/Kconfig | |||
@@ -107,6 +107,7 @@ config SND_HDA_PATCH_LOADER | |||
107 | config SND_HDA_CODEC_REALTEK | 107 | config SND_HDA_CODEC_REALTEK |
108 | tristate "Build Realtek HD-audio codec support" | 108 | tristate "Build Realtek HD-audio codec support" |
109 | select SND_HDA_GENERIC | 109 | select SND_HDA_GENERIC |
110 | select INPUT | ||
110 | help | 111 | help |
111 | Say Y or M here to include Realtek HD-audio codec support in | 112 | Say Y or M here to include Realtek HD-audio codec support in |
112 | snd-hda-intel driver, such as ALC880. | 113 | snd-hda-intel driver, such as ALC880. |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index a50e15e166c6..1720f8a457d1 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -121,9 +121,7 @@ struct alc_spec { | |||
121 | hda_nid_t pll_nid; | 121 | hda_nid_t pll_nid; |
122 | unsigned int pll_coef_idx, pll_coef_bit; | 122 | unsigned int pll_coef_idx, pll_coef_bit; |
123 | unsigned int coef0; | 123 | unsigned int coef0; |
124 | #if IS_ENABLED(CONFIG_INPUT) | ||
125 | struct input_dev *kb_dev; | 124 | struct input_dev *kb_dev; |
126 | #endif | ||
127 | }; | 125 | }; |
128 | 126 | ||
129 | /* | 127 | /* |
@@ -3476,7 +3474,6 @@ static void alc280_fixup_hp_gpio4(struct hda_codec *codec, | |||
3476 | } | 3474 | } |
3477 | } | 3475 | } |
3478 | 3476 | ||
3479 | #if IS_ENABLED(CONFIG_INPUT) | ||
3480 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, | 3477 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, |
3481 | struct hda_jack_callback *event) | 3478 | struct hda_jack_callback *event) |
3482 | { | 3479 | { |
@@ -3489,12 +3486,10 @@ static void gpio2_mic_hotkey_event(struct hda_codec *codec, | |||
3489 | input_report_key(spec->kb_dev, KEY_MICMUTE, 0); | 3486 | input_report_key(spec->kb_dev, KEY_MICMUTE, 0); |
3490 | input_sync(spec->kb_dev); | 3487 | input_sync(spec->kb_dev); |
3491 | } | 3488 | } |
3492 | #endif | ||
3493 | 3489 | ||
3494 | static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, | 3490 | static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, |
3495 | const struct hda_fixup *fix, int action) | 3491 | const struct hda_fixup *fix, int action) |
3496 | { | 3492 | { |
3497 | #if IS_ENABLED(CONFIG_INPUT) | ||
3498 | /* GPIO1 = set according to SKU external amp | 3493 | /* GPIO1 = set according to SKU external amp |
3499 | GPIO2 = mic mute hotkey | 3494 | GPIO2 = mic mute hotkey |
3500 | GPIO3 = mute LED | 3495 | GPIO3 = mute LED |
@@ -3550,7 +3545,6 @@ static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, | |||
3550 | input_unregister_device(spec->kb_dev); | 3545 | input_unregister_device(spec->kb_dev); |
3551 | spec->kb_dev = NULL; | 3546 | spec->kb_dev = NULL; |
3552 | } | 3547 | } |
3553 | #endif | ||
3554 | } | 3548 | } |
3555 | 3549 | ||
3556 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, | 3550 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |