aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-08-11 11:16:13 -0400
committerTakashi Iwai <tiwai@suse.de>2009-08-11 11:16:13 -0400
commite9c364c04f59f7fb250f9689198eaa59872cf8af (patch)
treeb50d996ebbc28babc35f2912bc783a135dd643b4 /sound/pci/hda
parent4d8e22e0f6aacb365db2cb9bf69e38310b37f418 (diff)
ALSA: hda - Add setup hook to ALC preset struct
Added setup hook to ALC preset struct to be called at in the parser but not at each init callback. This can be used for setting up the static pins, etc, while the init hook should be used for updating the status again. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/patch_realtek.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 5156c4f14f80..b2e097bdc59c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -379,6 +379,7 @@ struct alc_config_preset {
379 unsigned int num_mux_defs; 379 unsigned int num_mux_defs;
380 const struct hda_input_mux *input_mux; 380 const struct hda_input_mux *input_mux;
381 void (*unsol_event)(struct hda_codec *, unsigned int); 381 void (*unsol_event)(struct hda_codec *, unsigned int);
382 void (*setup)(struct hda_codec *);
382 void (*init_hook)(struct hda_codec *); 383 void (*init_hook)(struct hda_codec *);
383#ifdef CONFIG_SND_HDA_POWER_SAVE 384#ifdef CONFIG_SND_HDA_POWER_SAVE
384 struct hda_amp_list *loopbacks; 385 struct hda_amp_list *loopbacks;
@@ -851,9 +852,10 @@ static void print_realtek_coef(struct snd_info_buffer *buffer,
851/* 852/*
852 * set up from the preset table 853 * set up from the preset table
853 */ 854 */
854static void setup_preset(struct alc_spec *spec, 855static void setup_preset(struct hda_codec *codec,
855 const struct alc_config_preset *preset) 856 const struct alc_config_preset *preset)
856{ 857{
858 struct alc_spec *spec = codec->spec;
857 int i; 859 int i;
858 860
859 for (i = 0; i < ARRAY_SIZE(preset->mixers) && preset->mixers[i]; i++) 861 for (i = 0; i < ARRAY_SIZE(preset->mixers) && preset->mixers[i]; i++)
@@ -895,6 +897,9 @@ static void setup_preset(struct alc_spec *spec,
895#ifdef CONFIG_SND_HDA_POWER_SAVE 897#ifdef CONFIG_SND_HDA_POWER_SAVE
896 spec->loopback.amplist = preset->loopbacks; 898 spec->loopback.amplist = preset->loopbacks;
897#endif 899#endif
900
901 if (preset->setup)
902 preset->setup(codec);
898} 903}
899 904
900/* Enable GPIO mask and set output */ 905/* Enable GPIO mask and set output */
@@ -4762,7 +4767,7 @@ static int patch_alc880(struct hda_codec *codec)
4762 } 4767 }
4763 4768
4764 if (board_config != ALC880_AUTO) 4769 if (board_config != ALC880_AUTO)
4765 setup_preset(spec, &alc880_presets[board_config]); 4770 setup_preset(codec, &alc880_presets[board_config]);
4766 4771
4767 spec->stream_analog_playback = &alc880_pcm_analog_playback; 4772 spec->stream_analog_playback = &alc880_pcm_analog_playback;
4768 spec->stream_analog_capture = &alc880_pcm_analog_capture; 4773 spec->stream_analog_capture = &alc880_pcm_analog_capture;
@@ -6406,7 +6411,7 @@ static int patch_alc260(struct hda_codec *codec)
6406 } 6411 }
6407 6412
6408 if (board_config != ALC260_AUTO) 6413 if (board_config != ALC260_AUTO)
6409 setup_preset(spec, &alc260_presets[board_config]); 6414 setup_preset(codec, &alc260_presets[board_config]);
6410 6415
6411 spec->stream_analog_playback = &alc260_pcm_analog_playback; 6416 spec->stream_analog_playback = &alc260_pcm_analog_playback;
6412 spec->stream_analog_capture = &alc260_pcm_analog_capture; 6417 spec->stream_analog_capture = &alc260_pcm_analog_capture;
@@ -9720,7 +9725,7 @@ static int patch_alc882(struct hda_codec *codec)
9720 } 9725 }
9721 9726
9722 if (board_config != ALC882_AUTO) 9727 if (board_config != ALC882_AUTO)
9723 setup_preset(spec, &alc882_presets[board_config]); 9728 setup_preset(codec, &alc882_presets[board_config]);
9724 9729
9725 spec->stream_analog_playback = &alc882_pcm_analog_playback; 9730 spec->stream_analog_playback = &alc882_pcm_analog_playback;
9726 spec->stream_analog_capture = &alc882_pcm_analog_capture; 9731 spec->stream_analog_capture = &alc882_pcm_analog_capture;
@@ -11594,7 +11599,7 @@ static int patch_alc262(struct hda_codec *codec)
11594 } 11599 }
11595 11600
11596 if (board_config != ALC262_AUTO) 11601 if (board_config != ALC262_AUTO)
11597 setup_preset(spec, &alc262_presets[board_config]); 11602 setup_preset(codec, &alc262_presets[board_config]);
11598 11603
11599 spec->stream_analog_playback = &alc262_pcm_analog_playback; 11604 spec->stream_analog_playback = &alc262_pcm_analog_playback;
11600 spec->stream_analog_capture = &alc262_pcm_analog_capture; 11605 spec->stream_analog_capture = &alc262_pcm_analog_capture;
@@ -12659,7 +12664,7 @@ static int patch_alc268(struct hda_codec *codec)
12659 } 12664 }
12660 12665
12661 if (board_config != ALC268_AUTO) 12666 if (board_config != ALC268_AUTO)
12662 setup_preset(spec, &alc268_presets[board_config]); 12667 setup_preset(codec, &alc268_presets[board_config]);
12663 12668
12664 spec->stream_analog_playback = &alc268_pcm_analog_playback; 12669 spec->stream_analog_playback = &alc268_pcm_analog_playback;
12665 spec->stream_analog_capture = &alc268_pcm_analog_capture; 12670 spec->stream_analog_capture = &alc268_pcm_analog_capture;
@@ -13483,7 +13488,7 @@ static int patch_alc269(struct hda_codec *codec)
13483 } 13488 }
13484 13489
13485 if (board_config != ALC269_AUTO) 13490 if (board_config != ALC269_AUTO)
13486 setup_preset(spec, &alc269_presets[board_config]); 13491 setup_preset(codec, &alc269_presets[board_config]);
13487 13492
13488 if (codec->subsystem_id == 0x17aa3bf8) { 13493 if (codec->subsystem_id == 0x17aa3bf8) {
13489 /* Due to a hardware problem on Lenovo Ideadpad, we need to 13494 /* Due to a hardware problem on Lenovo Ideadpad, we need to
@@ -14636,7 +14641,7 @@ static int patch_alc861(struct hda_codec *codec)
14636 } 14641 }
14637 14642
14638 if (board_config != ALC861_AUTO) 14643 if (board_config != ALC861_AUTO)
14639 setup_preset(spec, &alc861_presets[board_config]); 14644 setup_preset(codec, &alc861_presets[board_config]);
14640 14645
14641 spec->stream_analog_playback = &alc861_pcm_analog_playback; 14646 spec->stream_analog_playback = &alc861_pcm_analog_playback;
14642 spec->stream_analog_capture = &alc861_pcm_analog_capture; 14647 spec->stream_analog_capture = &alc861_pcm_analog_capture;
@@ -15560,7 +15565,7 @@ static int patch_alc861vd(struct hda_codec *codec)
15560 } 15565 }
15561 15566
15562 if (board_config != ALC861VD_AUTO) 15567 if (board_config != ALC861VD_AUTO)
15563 setup_preset(spec, &alc861vd_presets[board_config]); 15568 setup_preset(codec, &alc861vd_presets[board_config]);
15564 15569
15565 if (codec->vendor_id == 0x10ec0660) { 15570 if (codec->vendor_id == 0x10ec0660) {
15566 /* always turn on EAPD */ 15571 /* always turn on EAPD */
@@ -17468,7 +17473,7 @@ static int patch_alc662(struct hda_codec *codec)
17468 } 17473 }
17469 17474
17470 if (board_config != ALC662_AUTO) 17475 if (board_config != ALC662_AUTO)
17471 setup_preset(spec, &alc662_presets[board_config]); 17476 setup_preset(codec, &alc662_presets[board_config]);
17472 17477
17473 spec->stream_analog_playback = &alc662_pcm_analog_playback; 17478 spec->stream_analog_playback = &alc662_pcm_analog_playback;
17474 spec->stream_analog_capture = &alc662_pcm_analog_capture; 17479 spec->stream_analog_capture = &alc662_pcm_analog_capture;