diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-02-20 08:37:42 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-02-20 10:48:40 -0500 |
commit | 2f334f92cfb44d17b9f24a43f8998cca03f9a3dd (patch) | |
tree | dfc6c07b4de91da28607503f641aa60d2bfec9ec /sound | |
parent | 330ee9957910826a072c2ad5d4045182335f9963 (diff) |
ALSA: hda - Remove codec-specific pin save/restore functions
Replace the accessor to pin defaults with the common code for caching.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 3 | ||||
-rw-r--r-- | sound/pci/hda/patch_cmedia.c | 12 | ||||
-rw-r--r-- | sound/pci/hda/patch_via.c | 7 |
3 files changed, 9 insertions, 13 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 2c58d7b05aba..53d0edaf04c7 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -1047,8 +1047,7 @@ static struct hda_amp_list ad1986a_loopbacks[] = { | |||
1047 | 1047 | ||
1048 | static int is_jack_available(struct hda_codec *codec, hda_nid_t nid) | 1048 | static int is_jack_available(struct hda_codec *codec, hda_nid_t nid) |
1049 | { | 1049 | { |
1050 | unsigned int conf = snd_hda_codec_read(codec, nid, 0, | 1050 | unsigned int conf = snd_hda_codec_get_pincfg(codec, nid); |
1051 | AC_VERB_GET_CONFIG_DEFAULT, 0); | ||
1052 | return get_defcfg_connect(conf) != AC_JACK_PORT_NONE; | 1051 | return get_defcfg_connect(conf) != AC_JACK_PORT_NONE; |
1053 | } | 1052 | } |
1054 | 1053 | ||
diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c index f3ebe837f2d5..c921264bbd71 100644 --- a/sound/pci/hda/patch_cmedia.c +++ b/sound/pci/hda/patch_cmedia.c | |||
@@ -680,13 +680,13 @@ static int patch_cmi9880(struct hda_codec *codec) | |||
680 | struct auto_pin_cfg cfg; | 680 | struct auto_pin_cfg cfg; |
681 | 681 | ||
682 | /* collect pin default configuration */ | 682 | /* collect pin default configuration */ |
683 | port_e = snd_hda_codec_read(codec, 0x0f, 0, AC_VERB_GET_CONFIG_DEFAULT, 0); | 683 | port_e = snd_hda_codec_get_pincfg(codec, 0x0f); |
684 | port_f = snd_hda_codec_read(codec, 0x10, 0, AC_VERB_GET_CONFIG_DEFAULT, 0); | 684 | port_f = snd_hda_codec_get_pincfg(codec, 0x10); |
685 | spec->front_panel = 1; | 685 | spec->front_panel = 1; |
686 | if (get_defcfg_connect(port_e) == AC_JACK_PORT_NONE || | 686 | if (get_defcfg_connect(port_e) == AC_JACK_PORT_NONE || |
687 | get_defcfg_connect(port_f) == AC_JACK_PORT_NONE) { | 687 | get_defcfg_connect(port_f) == AC_JACK_PORT_NONE) { |
688 | port_g = snd_hda_codec_read(codec, 0x1f, 0, AC_VERB_GET_CONFIG_DEFAULT, 0); | 688 | port_g = snd_hda_codec_get_pincfg(codec, 0x1f); |
689 | port_h = snd_hda_codec_read(codec, 0x20, 0, AC_VERB_GET_CONFIG_DEFAULT, 0); | 689 | port_h = snd_hda_codec_get_pincfg(codec, 0x20); |
690 | spec->channel_modes = cmi9880_channel_modes; | 690 | spec->channel_modes = cmi9880_channel_modes; |
691 | /* no front panel */ | 691 | /* no front panel */ |
692 | if (get_defcfg_connect(port_g) == AC_JACK_PORT_NONE || | 692 | if (get_defcfg_connect(port_g) == AC_JACK_PORT_NONE || |
@@ -703,8 +703,8 @@ static int patch_cmi9880(struct hda_codec *codec) | |||
703 | spec->multiout.max_channels = cmi9880_channel_modes[0].channels; | 703 | spec->multiout.max_channels = cmi9880_channel_modes[0].channels; |
704 | } else { | 704 | } else { |
705 | spec->input_mux = &cmi9880_basic_mux; | 705 | spec->input_mux = &cmi9880_basic_mux; |
706 | port_spdifi = snd_hda_codec_read(codec, 0x13, 0, AC_VERB_GET_CONFIG_DEFAULT, 0); | 706 | port_spdifi = snd_hda_codec_get_pincfg(codec, 0x13); |
707 | port_spdifo = snd_hda_codec_read(codec, 0x12, 0, AC_VERB_GET_CONFIG_DEFAULT, 0); | 707 | port_spdifo = snd_hda_codec_get_pincfg(codec, 0x12); |
708 | if (get_defcfg_connect(port_spdifo) != AC_JACK_PORT_NONE) | 708 | if (get_defcfg_connect(port_spdifo) != AC_JACK_PORT_NONE) |
709 | spec->multiout.dig_out_nid = CMI_DIG_OUT_NID; | 709 | spec->multiout.dig_out_nid = CMI_DIG_OUT_NID; |
710 | if (get_defcfg_connect(port_spdifi) != AC_JACK_PORT_NONE) | 710 | if (get_defcfg_connect(port_spdifi) != AC_JACK_PORT_NONE) |
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 639b2ff510a6..b25a5cc637d6 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -1308,16 +1308,13 @@ static void vt1708_set_pinconfig_connect(struct hda_codec *codec, hda_nid_t nid) | |||
1308 | unsigned int def_conf; | 1308 | unsigned int def_conf; |
1309 | unsigned char seqassoc; | 1309 | unsigned char seqassoc; |
1310 | 1310 | ||
1311 | def_conf = snd_hda_codec_read(codec, nid, 0, | 1311 | def_conf = snd_hda_codec_get_pincfg(codec, nid); |
1312 | AC_VERB_GET_CONFIG_DEFAULT, 0); | ||
1313 | seqassoc = (unsigned char) get_defcfg_association(def_conf); | 1312 | seqassoc = (unsigned char) get_defcfg_association(def_conf); |
1314 | seqassoc = (seqassoc << 4) | get_defcfg_sequence(def_conf); | 1313 | seqassoc = (seqassoc << 4) | get_defcfg_sequence(def_conf); |
1315 | if (get_defcfg_connect(def_conf) == AC_JACK_PORT_NONE) { | 1314 | if (get_defcfg_connect(def_conf) == AC_JACK_PORT_NONE) { |
1316 | if (seqassoc == 0xff) { | 1315 | if (seqassoc == 0xff) { |
1317 | def_conf = def_conf & (~(AC_JACK_PORT_BOTH << 30)); | 1316 | def_conf = def_conf & (~(AC_JACK_PORT_BOTH << 30)); |
1318 | snd_hda_codec_write(codec, nid, 0, | 1317 | snd_hda_codec_set_pincfg(codec, nid, def_conf); |
1319 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, | ||
1320 | def_conf >> 24); | ||
1321 | } | 1318 | } |
1322 | } | 1319 | } |
1323 | 1320 | ||