aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-07-08 05:11:35 -0400
committerTakashi Iwai <tiwai@suse.de>2011-07-08 05:12:09 -0400
commite47706295843730c815dbc98f47ed2f75e051109 (patch)
tree66561360956d84921c0083e673589f62a2bf3ff1 /sound
parentafcd551508dcdb38e80728137c1c166d19bd47dd (diff)
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>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_realtek.c105
1 files changed, 21 insertions, 84 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index f82333b11e41..e230947cd3fe 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3469,6 +3469,21 @@ static void set_capture_mixer(struct hda_codec *codec)
3469} 3469}
3470 3470
3471/* 3471/*
3472 * standard auto-parser initializations
3473 */
3474static void alc_auto_init_std(struct hda_codec *codec)
3475{
3476 struct alc_spec *spec = codec->spec;
3477 alc_auto_init_multi_out(codec);
3478 alc_auto_init_extra_out(codec);
3479 alc_auto_init_analog_input(codec);
3480 alc_auto_init_input_src(codec);
3481 alc_auto_init_digital(codec);
3482 if (spec->unsol_event)
3483 alc_inithook(codec);
3484}
3485
3486/*
3472 * Digital-beep handlers 3487 * Digital-beep handlers
3473 */ 3488 */
3474#ifdef CONFIG_SND_HDA_INPUT_BEEP 3489#ifdef CONFIG_SND_HDA_INPUT_BEEP
@@ -3549,19 +3564,6 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
3549 return 1; 3564 return 1;
3550} 3565}
3551 3566
3552/* additional initialization for auto-configuration model */
3553static void alc880_auto_init(struct hda_codec *codec)
3554{
3555 struct alc_spec *spec = codec->spec;
3556 alc_auto_init_multi_out(codec);
3557 alc_auto_init_extra_out(codec);
3558 alc_auto_init_analog_input(codec);
3559 alc_auto_init_input_src(codec);
3560 alc_auto_init_digital(codec);
3561 if (spec->unsol_event)
3562 alc_inithook(codec);
3563}
3564
3565#ifdef CONFIG_SND_HDA_POWER_SAVE 3567#ifdef CONFIG_SND_HDA_POWER_SAVE
3566static const struct hda_amp_list alc880_loopbacks[] = { 3568static const struct hda_amp_list alc880_loopbacks[] = {
3567 { 0x0b, HDA_INPUT, 0 }, 3569 { 0x0b, HDA_INPUT, 0 },
@@ -3655,7 +3657,7 @@ static int patch_alc880(struct hda_codec *codec)
3655 3657
3656 codec->patch_ops = alc_patch_ops; 3658 codec->patch_ops = alc_patch_ops;
3657 if (board_config == ALC_MODEL_AUTO) 3659 if (board_config == ALC_MODEL_AUTO)
3658 spec->init_hook = alc880_auto_init; 3660 spec->init_hook = alc_auto_init_std;
3659#ifdef CONFIG_SND_HDA_POWER_SAVE 3661#ifdef CONFIG_SND_HDA_POWER_SAVE
3660 if (!spec->loopback.amplist) 3662 if (!spec->loopback.amplist)
3661 spec->loopback.amplist = alc880_loopbacks; 3663 spec->loopback.amplist = alc880_loopbacks;
@@ -4075,19 +4077,6 @@ static int alc882_parse_auto_config(struct hda_codec *codec)
4075 return 1; /* config found */ 4077 return 1; /* config found */
4076} 4078}
4077 4079
4078/* additional initialization for auto-configuration model */
4079static void alc882_auto_init(struct hda_codec *codec)
4080{
4081 struct alc_spec *spec = codec->spec;
4082 alc_auto_init_multi_out(codec);
4083 alc_auto_init_extra_out(codec);
4084 alc_auto_init_analog_input(codec);
4085 alc_auto_init_input_src(codec);
4086 alc_auto_init_digital(codec);
4087 if (spec->unsol_event)
4088 alc_inithook(codec);
4089}
4090
4091/* 4080/*
4092 */ 4081 */
4093#ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS 4082#ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS
@@ -4182,7 +4171,7 @@ static int patch_alc882(struct hda_codec *codec)
4182 4171
4183 codec->patch_ops = alc_patch_ops; 4172 codec->patch_ops = alc_patch_ops;
4184 if (board_config == ALC_MODEL_AUTO) 4173 if (board_config == ALC_MODEL_AUTO)
4185 spec->init_hook = alc882_auto_init; 4174 spec->init_hook = alc_auto_init_std;
4186 4175
4187 alc_init_jacks(codec); 4176 alc_init_jacks(codec);
4188#ifdef CONFIG_SND_HDA_POWER_SAVE 4177#ifdef CONFIG_SND_HDA_POWER_SAVE
@@ -4393,19 +4382,6 @@ static const struct snd_pci_quirk alc262_fixup_tbl[] = {
4393#define alc262_loopbacks alc880_loopbacks 4382#define alc262_loopbacks alc880_loopbacks
4394#endif 4383#endif
4395 4384
4396/* init callback for auto-configuration model -- overriding the default init */
4397static void alc262_auto_init(struct hda_codec *codec)
4398{
4399 struct alc_spec *spec = codec->spec;
4400 alc_auto_init_multi_out(codec);
4401 alc_auto_init_extra_out(codec);
4402 alc_auto_init_analog_input(codec);
4403 alc_auto_init_input_src(codec);
4404 alc_auto_init_digital(codec);
4405 if (spec->unsol_event)
4406 alc_inithook(codec);
4407}
4408
4409/* 4385/*
4410 */ 4386 */
4411#ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS 4387#ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS
@@ -4500,7 +4476,7 @@ static int patch_alc262(struct hda_codec *codec)
4500 4476
4501 codec->patch_ops = alc_patch_ops; 4477 codec->patch_ops = alc_patch_ops;
4502 if (board_config == ALC_MODEL_AUTO) 4478 if (board_config == ALC_MODEL_AUTO)
4503 spec->init_hook = alc262_auto_init; 4479 spec->init_hook = alc_auto_init_std;
4504 spec->shutup = alc_eapd_shutup; 4480 spec->shutup = alc_eapd_shutup;
4505 4481
4506 alc_init_jacks(codec); 4482 alc_init_jacks(codec);
@@ -5924,19 +5900,6 @@ static int alc861vd_parse_auto_config(struct hda_codec *codec)
5924 return 1; 5900 return 1;
5925} 5901}
5926 5902
5927/* additional initialization for auto-configuration model */
5928static void alc861vd_auto_init(struct hda_codec *codec)
5929{
5930 struct alc_spec *spec = codec->spec;
5931 alc_auto_init_multi_out(codec);
5932 alc_auto_init_extra_out(codec);
5933 alc_auto_init_analog_input(codec);
5934 alc_auto_init_input_src(codec);
5935 alc_auto_init_digital(codec);
5936 if (spec->unsol_event)
5937 alc_inithook(codec);
5938}
5939
5940enum { 5903enum {
5941 ALC660VD_FIX_ASUS_GPIO1 5904 ALC660VD_FIX_ASUS_GPIO1
5942}; 5905};
@@ -6045,7 +6008,7 @@ static int patch_alc861vd(struct hda_codec *codec)
6045 codec->patch_ops = alc_patch_ops; 6008 codec->patch_ops = alc_patch_ops;
6046 6009
6047 if (board_config == ALC_MODEL_AUTO) 6010 if (board_config == ALC_MODEL_AUTO)
6048 spec->init_hook = alc861vd_auto_init; 6011 spec->init_hook = alc_auto_init_std;
6049 spec->shutup = alc_eapd_shutup; 6012 spec->shutup = alc_eapd_shutup;
6050#ifdef CONFIG_SND_HDA_POWER_SAVE 6013#ifdef CONFIG_SND_HDA_POWER_SAVE
6051 if (!spec->loopback.amplist) 6014 if (!spec->loopback.amplist)
@@ -6134,19 +6097,6 @@ static int alc662_parse_auto_config(struct hda_codec *codec)
6134 return 1; 6097 return 1;
6135} 6098}
6136 6099
6137/* additional initialization for auto-configuration model */
6138static void alc662_auto_init(struct hda_codec *codec)
6139{
6140 struct alc_spec *spec = codec->spec;
6141 alc_auto_init_multi_out(codec);
6142 alc_auto_init_extra_out(codec);
6143 alc_auto_init_analog_input(codec);
6144 alc_auto_init_input_src(codec);
6145 alc_auto_init_digital(codec);
6146 if (spec->unsol_event)
6147 alc_inithook(codec);
6148}
6149
6150static void alc272_fixup_mario(struct hda_codec *codec, 6100static void alc272_fixup_mario(struct hda_codec *codec,
6151 const struct alc_fixup *fix, int action) 6101 const struct alc_fixup *fix, int action)
6152{ 6102{
@@ -6332,7 +6282,7 @@ static int patch_alc662(struct hda_codec *codec)
6332 6282
6333 codec->patch_ops = alc_patch_ops; 6283 codec->patch_ops = alc_patch_ops;
6334 if (board_config == ALC_MODEL_AUTO) 6284 if (board_config == ALC_MODEL_AUTO)
6335 spec->init_hook = alc662_auto_init; 6285 spec->init_hook = alc_auto_init_std;
6336 spec->shutup = alc_eapd_shutup; 6286 spec->shutup = alc_eapd_shutup;
6337 6287
6338 alc_init_jacks(codec); 6288 alc_init_jacks(codec);
@@ -6434,19 +6384,6 @@ static int alc680_parse_auto_config(struct hda_codec *codec)
6434 return 1; 6384 return 1;
6435} 6385}
6436 6386
6437/* init callback for auto-configuration model -- overriding the default init */
6438static void alc680_auto_init(struct hda_codec *codec)
6439{
6440 struct alc_spec *spec = codec->spec;
6441 alc_auto_init_multi_out(codec);
6442 alc_auto_init_extra_out(codec);
6443 alc_auto_init_analog_input(codec);
6444 alc_auto_init_input_src(codec);
6445 alc_auto_init_digital(codec);
6446 if (spec->unsol_event)
6447 alc_inithook(codec);
6448}
6449
6450/* 6387/*
6451 */ 6388 */
6452#ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS 6389#ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS
@@ -6513,7 +6450,7 @@ static int patch_alc680(struct hda_codec *codec)
6513 6450
6514 codec->patch_ops = alc_patch_ops; 6451 codec->patch_ops = alc_patch_ops;
6515 if (board_config == ALC_MODEL_AUTO) 6452 if (board_config == ALC_MODEL_AUTO)
6516 spec->init_hook = alc680_auto_init; 6453 spec->init_hook = alc_auto_init_std;
6517 6454
6518 return 0; 6455 return 0;
6519} 6456}