2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-24 13:13:57 +08:00

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 <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2011-07-08 11:11:35 +02:00
parent afcd551508
commit e477062958

View File

@ -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;
}