* [PATCH] ALSA: hda - Select INPUT for Realtek HD-audio codec
@ 2015-01-15 9:19 Takashi Iwai
2015-01-15 9:20 ` David Henningsson
0 siblings, 1 reply; 2+ messages in thread
From: Takashi Iwai @ 2015-01-15 9:19 UTC (permalink / raw)
To: alsa-devel; +Cc: David Henningsson
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/pci/hda/Kconfig | 1 +
sound/pci/hda/patch_realtek.c | 6 ------
2 files changed, 1 insertion(+), 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
config SND_HDA_CODEC_REALTEK
tristate "Build Realtek HD-audio codec support"
select SND_HDA_GENERIC
+ select INPUT
help
Say Y or M here to include Realtek HD-audio codec support in
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 {
hda_nid_t pll_nid;
unsigned int pll_coef_idx, pll_coef_bit;
unsigned int coef0;
-#if IS_ENABLED(CONFIG_INPUT)
struct input_dev *kb_dev;
-#endif
};
/*
@@ -3476,7 +3474,6 @@ static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
}
}
-#if IS_ENABLED(CONFIG_INPUT)
static void gpio2_mic_hotkey_event(struct hda_codec *codec,
struct hda_jack_callback *event)
{
@@ -3489,12 +3486,10 @@ static void gpio2_mic_hotkey_event(struct hda_codec *codec,
input_report_key(spec->kb_dev, KEY_MICMUTE, 0);
input_sync(spec->kb_dev);
}
-#endif
static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
-#if IS_ENABLED(CONFIG_INPUT)
/* GPIO1 = set according to SKU external amp
GPIO2 = mic mute hotkey
GPIO3 = mute LED
@@ -3550,7 +3545,6 @@ static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
input_unregister_device(spec->kb_dev);
spec->kb_dev = NULL;
}
-#endif
}
static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
--
2.2.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: hda - Select INPUT for Realtek HD-audio codec
2015-01-15 9:19 [PATCH] ALSA: hda - Select INPUT for Realtek HD-audio codec Takashi Iwai
@ 2015-01-15 9:20 ` David Henningsson
0 siblings, 0 replies; 2+ messages in thread
From: David Henningsson @ 2015-01-15 9:20 UTC (permalink / raw)
To: Takashi Iwai, alsa-devel
Acked-by: David Henningsson <david.henningsson@canonical.com>
Sorry for not writing up a patch yesterday.
On 2015-01-15 10:19, Takashi Iwai wrote:
> 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.
>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
> sound/pci/hda/Kconfig | 1 +
> sound/pci/hda/patch_realtek.c | 6 ------
> 2 files changed, 1 insertion(+), 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
> config SND_HDA_CODEC_REALTEK
> tristate "Build Realtek HD-audio codec support"
> select SND_HDA_GENERIC
> + select INPUT
> help
> Say Y or M here to include Realtek HD-audio codec support in
> 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 {
> hda_nid_t pll_nid;
> unsigned int pll_coef_idx, pll_coef_bit;
> unsigned int coef0;
> -#if IS_ENABLED(CONFIG_INPUT)
> struct input_dev *kb_dev;
> -#endif
> };
>
> /*
> @@ -3476,7 +3474,6 @@ static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
> }
> }
>
> -#if IS_ENABLED(CONFIG_INPUT)
> static void gpio2_mic_hotkey_event(struct hda_codec *codec,
> struct hda_jack_callback *event)
> {
> @@ -3489,12 +3486,10 @@ static void gpio2_mic_hotkey_event(struct hda_codec *codec,
> input_report_key(spec->kb_dev, KEY_MICMUTE, 0);
> input_sync(spec->kb_dev);
> }
> -#endif
>
> static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
> const struct hda_fixup *fix, int action)
> {
> -#if IS_ENABLED(CONFIG_INPUT)
> /* GPIO1 = set according to SKU external amp
> GPIO2 = mic mute hotkey
> GPIO3 = mute LED
> @@ -3550,7 +3545,6 @@ static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
> input_unregister_device(spec->kb_dev);
> spec->kb_dev = NULL;
> }
> -#endif
> }
>
> static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
>
--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-15 9:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-15 9:19 [PATCH] ALSA: hda - Select INPUT for Realtek HD-audio codec Takashi Iwai
2015-01-15 9:20 ` David Henningsson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.