From e47706295843730c815dbc98f47ed2f75e051109 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 8 Jul 2011 11:11:35 +0200 Subject: ALSA: hda - Provide the standard auto_init for Realtek codecs Remove redundant definitions. Ideally, all init functions should be identical in future. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 105 +++++++++--------------------------------- 1 file changed, 21 insertions(+), 84 deletions(-) (limited to 'sound/pci/hda/patch_realtek.c') diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index f82333b11e4..e230947cd3f 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3468,6 +3468,21 @@ static void set_capture_mixer(struct hda_codec *codec) } } +/* + * standard auto-parser initializations + */ +static void alc_auto_init_std(struct hda_codec *codec) +{ + struct alc_spec *spec = codec->spec; + alc_auto_init_multi_out(codec); + alc_auto_init_extra_out(codec); + alc_auto_init_analog_input(codec); + alc_auto_init_input_src(codec); + alc_auto_init_digital(codec); + if (spec->unsol_event) + alc_inithook(codec); +} + /* * Digital-beep handlers */ @@ -3549,19 +3564,6 @@ static int alc880_parse_auto_config(struct hda_codec *codec) return 1; } -/* additional initialization for auto-configuration model */ -static void alc880_auto_init(struct hda_codec *codec) -{ - struct alc_spec *spec = codec->spec; - alc_auto_init_multi_out(codec); - alc_auto_init_extra_out(codec); - alc_auto_init_analog_input(codec); - alc_auto_init_input_src(codec); - alc_auto_init_digital(codec); - if (spec->unsol_event) - alc_inithook(codec); -} - #ifdef CONFIG_SND_HDA_POWER_SAVE static const struct hda_amp_list alc880_loopbacks[] = { { 0x0b, HDA_INPUT, 0 }, @@ -3655,7 +3657,7 @@ static int patch_alc880(struct hda_codec *codec) codec->patch_ops = alc_patch_ops; if (board_config == ALC_MODEL_AUTO) - spec->init_hook = alc880_auto_init; + spec->init_hook = alc_auto_init_std; #ifdef CONFIG_SND_HDA_POWER_SAVE if (!spec->loopback.amplist) spec->loopback.amplist = alc880_loopbacks; @@ -4075,19 +4077,6 @@ static int alc882_parse_auto_config(struct hda_codec *codec) return 1; /* config found */ } -/* additional initialization for auto-configuration model */ -static void alc882_auto_init(struct hda_codec *codec) -{ - struct alc_spec *spec = codec->spec; - alc_auto_init_multi_out(codec); - alc_auto_init_extra_out(codec); - alc_auto_init_analog_input(codec); - alc_auto_init_input_src(codec); - alc_auto_init_digital(codec); - if (spec->unsol_event) - alc_inithook(codec); -} - /* */ #ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS @@ -4182,7 +4171,7 @@ static int patch_alc882(struct hda_codec *codec) codec->patch_ops = alc_patch_ops; if (board_config == ALC_MODEL_AUTO) - spec->init_hook = alc882_auto_init; + spec->init_hook = alc_auto_init_std; alc_init_jacks(codec); #ifdef CONFIG_SND_HDA_POWER_SAVE @@ -4393,19 +4382,6 @@ static const struct snd_pci_quirk alc262_fixup_tbl[] = { #define alc262_loopbacks alc880_loopbacks #endif -/* init callback for auto-configuration model -- overriding the default init */ -static void alc262_auto_init(struct hda_codec *codec) -{ - struct alc_spec *spec = codec->spec; - alc_auto_init_multi_out(codec); - alc_auto_init_extra_out(codec); - alc_auto_init_analog_input(codec); - alc_auto_init_input_src(codec); - alc_auto_init_digital(codec); - if (spec->unsol_event) - alc_inithook(codec); -} - /* */ #ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS @@ -4500,7 +4476,7 @@ static int patch_alc262(struct hda_codec *codec) codec->patch_ops = alc_patch_ops; if (board_config == ALC_MODEL_AUTO) - spec->init_hook = alc262_auto_init; + spec->init_hook = alc_auto_init_std; spec->shutup = alc_eapd_shutup; alc_init_jacks(codec); @@ -5924,19 +5900,6 @@ static int alc861vd_parse_auto_config(struct hda_codec *codec) return 1; } -/* additional initialization for auto-configuration model */ -static void alc861vd_auto_init(struct hda_codec *codec) -{ - struct alc_spec *spec = codec->spec; - alc_auto_init_multi_out(codec); - alc_auto_init_extra_out(codec); - alc_auto_init_analog_input(codec); - alc_auto_init_input_src(codec); - alc_auto_init_digital(codec); - if (spec->unsol_event) - alc_inithook(codec); -} - enum { ALC660VD_FIX_ASUS_GPIO1 }; @@ -6045,7 +6008,7 @@ static int patch_alc861vd(struct hda_codec *codec) codec->patch_ops = alc_patch_ops; if (board_config == ALC_MODEL_AUTO) - spec->init_hook = alc861vd_auto_init; + spec->init_hook = alc_auto_init_std; spec->shutup = alc_eapd_shutup; #ifdef CONFIG_SND_HDA_POWER_SAVE if (!spec->loopback.amplist) @@ -6134,19 +6097,6 @@ static int alc662_parse_auto_config(struct hda_codec *codec) return 1; } -/* additional initialization for auto-configuration model */ -static void alc662_auto_init(struct hda_codec *codec) -{ - struct alc_spec *spec = codec->spec; - alc_auto_init_multi_out(codec); - alc_auto_init_extra_out(codec); - alc_auto_init_analog_input(codec); - alc_auto_init_input_src(codec); - alc_auto_init_digital(codec); - if (spec->unsol_event) - alc_inithook(codec); -} - static void alc272_fixup_mario(struct hda_codec *codec, const struct alc_fixup *fix, int action) { @@ -6332,7 +6282,7 @@ static int patch_alc662(struct hda_codec *codec) codec->patch_ops = alc_patch_ops; if (board_config == ALC_MODEL_AUTO) - spec->init_hook = alc662_auto_init; + spec->init_hook = alc_auto_init_std; spec->shutup = alc_eapd_shutup; alc_init_jacks(codec); @@ -6434,19 +6384,6 @@ static int alc680_parse_auto_config(struct hda_codec *codec) return 1; } -/* init callback for auto-configuration model -- overriding the default init */ -static void alc680_auto_init(struct hda_codec *codec) -{ - struct alc_spec *spec = codec->spec; - alc_auto_init_multi_out(codec); - alc_auto_init_extra_out(codec); - alc_auto_init_analog_input(codec); - alc_auto_init_input_src(codec); - alc_auto_init_digital(codec); - if (spec->unsol_event) - alc_inithook(codec); -} - /* */ #ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS @@ -6513,7 +6450,7 @@ static int patch_alc680(struct hda_codec *codec) codec->patch_ops = alc_patch_ops; if (board_config == ALC_MODEL_AUTO) - spec->init_hook = alc680_auto_init; + spec->init_hook = alc_auto_init_std; return 0; } -- cgit v1.2.3