Commit 2f334f92 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Remove codec-specific pin save/restore functions

Replace the accessor to pin defaults with the common code for caching.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 330ee995
...@@ -1047,8 +1047,7 @@ static struct hda_amp_list ad1986a_loopbacks[] = { ...@@ -1047,8 +1047,7 @@ static struct hda_amp_list ad1986a_loopbacks[] = {
static int is_jack_available(struct hda_codec *codec, hda_nid_t nid) static int is_jack_available(struct hda_codec *codec, hda_nid_t nid)
{ {
unsigned int conf = snd_hda_codec_read(codec, nid, 0, unsigned int conf = snd_hda_codec_get_pincfg(codec, nid);
AC_VERB_GET_CONFIG_DEFAULT, 0);
return get_defcfg_connect(conf) != AC_JACK_PORT_NONE; return get_defcfg_connect(conf) != AC_JACK_PORT_NONE;
} }
......
...@@ -680,13 +680,13 @@ static int patch_cmi9880(struct hda_codec *codec) ...@@ -680,13 +680,13 @@ static int patch_cmi9880(struct hda_codec *codec)
struct auto_pin_cfg cfg; struct auto_pin_cfg cfg;
/* collect pin default configuration */ /* collect pin default configuration */
port_e = snd_hda_codec_read(codec, 0x0f, 0, AC_VERB_GET_CONFIG_DEFAULT, 0); port_e = snd_hda_codec_get_pincfg(codec, 0x0f);
port_f = snd_hda_codec_read(codec, 0x10, 0, AC_VERB_GET_CONFIG_DEFAULT, 0); port_f = snd_hda_codec_get_pincfg(codec, 0x10);
spec->front_panel = 1; spec->front_panel = 1;
if (get_defcfg_connect(port_e) == AC_JACK_PORT_NONE || if (get_defcfg_connect(port_e) == AC_JACK_PORT_NONE ||
get_defcfg_connect(port_f) == AC_JACK_PORT_NONE) { get_defcfg_connect(port_f) == AC_JACK_PORT_NONE) {
port_g = snd_hda_codec_read(codec, 0x1f, 0, AC_VERB_GET_CONFIG_DEFAULT, 0); port_g = snd_hda_codec_get_pincfg(codec, 0x1f);
port_h = snd_hda_codec_read(codec, 0x20, 0, AC_VERB_GET_CONFIG_DEFAULT, 0); port_h = snd_hda_codec_get_pincfg(codec, 0x20);
spec->channel_modes = cmi9880_channel_modes; spec->channel_modes = cmi9880_channel_modes;
/* no front panel */ /* no front panel */
if (get_defcfg_connect(port_g) == AC_JACK_PORT_NONE || if (get_defcfg_connect(port_g) == AC_JACK_PORT_NONE ||
...@@ -703,8 +703,8 @@ static int patch_cmi9880(struct hda_codec *codec) ...@@ -703,8 +703,8 @@ static int patch_cmi9880(struct hda_codec *codec)
spec->multiout.max_channels = cmi9880_channel_modes[0].channels; spec->multiout.max_channels = cmi9880_channel_modes[0].channels;
} else { } else {
spec->input_mux = &cmi9880_basic_mux; spec->input_mux = &cmi9880_basic_mux;
port_spdifi = snd_hda_codec_read(codec, 0x13, 0, AC_VERB_GET_CONFIG_DEFAULT, 0); port_spdifi = snd_hda_codec_get_pincfg(codec, 0x13);
port_spdifo = snd_hda_codec_read(codec, 0x12, 0, AC_VERB_GET_CONFIG_DEFAULT, 0); port_spdifo = snd_hda_codec_get_pincfg(codec, 0x12);
if (get_defcfg_connect(port_spdifo) != AC_JACK_PORT_NONE) if (get_defcfg_connect(port_spdifo) != AC_JACK_PORT_NONE)
spec->multiout.dig_out_nid = CMI_DIG_OUT_NID; spec->multiout.dig_out_nid = CMI_DIG_OUT_NID;
if (get_defcfg_connect(port_spdifi) != AC_JACK_PORT_NONE) if (get_defcfg_connect(port_spdifi) != AC_JACK_PORT_NONE)
......
...@@ -1308,16 +1308,13 @@ static void vt1708_set_pinconfig_connect(struct hda_codec *codec, hda_nid_t nid) ...@@ -1308,16 +1308,13 @@ static void vt1708_set_pinconfig_connect(struct hda_codec *codec, hda_nid_t nid)
unsigned int def_conf; unsigned int def_conf;
unsigned char seqassoc; unsigned char seqassoc;
def_conf = snd_hda_codec_read(codec, nid, 0, def_conf = snd_hda_codec_get_pincfg(codec, nid);
AC_VERB_GET_CONFIG_DEFAULT, 0);
seqassoc = (unsigned char) get_defcfg_association(def_conf); seqassoc = (unsigned char) get_defcfg_association(def_conf);
seqassoc = (seqassoc << 4) | get_defcfg_sequence(def_conf); seqassoc = (seqassoc << 4) | get_defcfg_sequence(def_conf);
if (get_defcfg_connect(def_conf) == AC_JACK_PORT_NONE) { if (get_defcfg_connect(def_conf) == AC_JACK_PORT_NONE) {
if (seqassoc == 0xff) { if (seqassoc == 0xff) {
def_conf = def_conf & (~(AC_JACK_PORT_BOTH << 30)); def_conf = def_conf & (~(AC_JACK_PORT_BOTH << 30));
snd_hda_codec_write(codec, nid, 0, snd_hda_codec_set_pincfg(codec, nid, def_conf);
AC_VERB_SET_CONFIG_DEFAULT_BYTES_3,
def_conf >> 24);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment