Commit 401caff7 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Kill snd_hda_codec_update_cache()

snd_hda_codec_update_cache() used to serve for a slightly different
purpose from snd_hdac_write_cache(), but now both of them became
identical.

Let's unify and replace with the latter one consistently.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 772c2917
...@@ -3842,7 +3842,7 @@ EXPORT_SYMBOL_GPL(snd_hda_correct_pin_ctl); ...@@ -3842,7 +3842,7 @@ EXPORT_SYMBOL_GPL(snd_hda_correct_pin_ctl);
* This function is a helper to set a pin ctl value more safely. * This function is a helper to set a pin ctl value more safely.
* It corrects the pin ctl value via snd_hda_correct_pin_ctl(), stores the * It corrects the pin ctl value via snd_hda_correct_pin_ctl(), stores the
* value in pin target array via snd_hda_codec_set_pin_target(), then * value in pin target array via snd_hda_codec_set_pin_target(), then
* actually writes the value via either snd_hda_codec_update_cache() or * actually writes the value via either snd_hda_codec_write_cache() or
* snd_hda_codec_write() depending on @cached flag. * snd_hda_codec_write() depending on @cached flag.
*/ */
int _snd_hda_set_pin_ctl(struct hda_codec *codec, hda_nid_t pin, int _snd_hda_set_pin_ctl(struct hda_codec *codec, hda_nid_t pin,
...@@ -3851,7 +3851,7 @@ int _snd_hda_set_pin_ctl(struct hda_codec *codec, hda_nid_t pin, ...@@ -3851,7 +3851,7 @@ int _snd_hda_set_pin_ctl(struct hda_codec *codec, hda_nid_t pin,
val = snd_hda_correct_pin_ctl(codec, pin, val); val = snd_hda_correct_pin_ctl(codec, pin, val);
snd_hda_codec_set_pin_target(codec, pin, val); snd_hda_codec_set_pin_target(codec, pin, val);
if (cached) if (cached)
return snd_hda_codec_update_cache(codec, pin, 0, return snd_hda_codec_write_cache(codec, pin, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, val); AC_VERB_SET_PIN_WIDGET_CONTROL, val);
else else
return snd_hda_codec_write(codec, pin, 0, return snd_hda_codec_write(codec, pin, 0,
......
...@@ -381,9 +381,6 @@ snd_hda_codec_write_cache(struct hda_codec *codec, hda_nid_t nid, ...@@ -381,9 +381,6 @@ snd_hda_codec_write_cache(struct hda_codec *codec, hda_nid_t nid,
return snd_hdac_regmap_write(&codec->core, nid, verb, parm); return snd_hdac_regmap_write(&codec->core, nid, verb, parm);
} }
#define snd_hda_codec_update_cache(codec, nid, flags, verb, parm) \
snd_hda_codec_write_cache(codec, nid, flags, verb, parm)
/* the struct for codec->pin_configs */ /* the struct for codec->pin_configs */
struct hda_pincfg { struct hda_pincfg {
hda_nid_t nid; hda_nid_t nid;
......
...@@ -209,7 +209,7 @@ static void parse_user_hints(struct hda_codec *codec) ...@@ -209,7 +209,7 @@ static void parse_user_hints(struct hda_codec *codec)
*/ */
#define update_pin_ctl(codec, pin, val) \ #define update_pin_ctl(codec, pin, val) \
snd_hda_codec_update_cache(codec, pin, 0, \ snd_hda_codec_write_cache(codec, pin, 0, \
AC_VERB_SET_PIN_WIDGET_CONTROL, val) AC_VERB_SET_PIN_WIDGET_CONTROL, val)
/* restore the pinctl based on the cached value */ /* restore the pinctl based on the cached value */
...@@ -898,7 +898,7 @@ void snd_hda_activate_path(struct hda_codec *codec, struct nid_path *path, ...@@ -898,7 +898,7 @@ void snd_hda_activate_path(struct hda_codec *codec, struct nid_path *path,
hda_nid_t nid = path->path[i]; hda_nid_t nid = path->path[i];
if (enable && path->multi[i]) if (enable && path->multi[i])
snd_hda_codec_update_cache(codec, nid, 0, snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_CONNECT_SEL, AC_VERB_SET_CONNECT_SEL,
path->idx[i]); path->idx[i]);
if (has_amp_in(codec, path, i)) if (has_amp_in(codec, path, i))
...@@ -930,7 +930,7 @@ static void set_pin_eapd(struct hda_codec *codec, hda_nid_t pin, bool enable) ...@@ -930,7 +930,7 @@ static void set_pin_eapd(struct hda_codec *codec, hda_nid_t pin, bool enable)
return; return;
if (codec->inv_eapd) if (codec->inv_eapd)
enable = !enable; enable = !enable;
snd_hda_codec_update_cache(codec, pin, 0, snd_hda_codec_write_cache(codec, pin, 0,
AC_VERB_SET_EAPD_BTLENABLE, AC_VERB_SET_EAPD_BTLENABLE,
enable ? 0x02 : 0x00); enable ? 0x02 : 0x00);
} }
...@@ -5973,7 +5973,7 @@ static void clear_unsol_on_unused_pins(struct hda_codec *codec) ...@@ -5973,7 +5973,7 @@ static void clear_unsol_on_unused_pins(struct hda_codec *codec)
hda_nid_t nid = pin->nid; hda_nid_t nid = pin->nid;
if (is_jack_detectable(codec, nid) && if (is_jack_detectable(codec, nid) &&
!snd_hda_jack_tbl_get(codec, nid)) !snd_hda_jack_tbl_get(codec, nid))
snd_hda_codec_update_cache(codec, nid, 0, snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_UNSOLICITED_ENABLE, 0); AC_VERB_SET_UNSOLICITED_ENABLE, 0);
} }
} }
......
...@@ -148,7 +148,7 @@ static void ad_vmaster_eapd_hook(void *private_data, int enabled) ...@@ -148,7 +148,7 @@ static void ad_vmaster_eapd_hook(void *private_data, int enabled)
return; return;
if (codec->inv_eapd) if (codec->inv_eapd)
enabled = !enabled; enabled = !enabled;
snd_hda_codec_update_cache(codec, spec->eapd_nid, 0, snd_hda_codec_write_cache(codec, spec->eapd_nid, 0,
AC_VERB_SET_EAPD_BTLENABLE, AC_VERB_SET_EAPD_BTLENABLE,
enabled ? 0x02 : 0x00); enabled ? 0x02 : 0x00);
} }
...@@ -991,7 +991,7 @@ static void ad1884_vmaster_hp_gpio_hook(void *private_data, int enabled) ...@@ -991,7 +991,7 @@ static void ad1884_vmaster_hp_gpio_hook(void *private_data, int enabled)
if (spec->eapd_nid) if (spec->eapd_nid)
ad_vmaster_eapd_hook(private_data, enabled); ad_vmaster_eapd_hook(private_data, enabled);
snd_hda_codec_update_cache(codec, 0x01, 0, snd_hda_codec_write_cache(codec, 0x01, 0,
AC_VERB_SET_GPIO_DATA, AC_VERB_SET_GPIO_DATA,
enabled ? 0x00 : 0x02); enabled ? 0x00 : 0x02);
} }
......
...@@ -341,7 +341,7 @@ static void cxt_fixup_headset_mic(struct hda_codec *codec, ...@@ -341,7 +341,7 @@ static void cxt_fixup_headset_mic(struct hda_codec *codec,
* control. */ * control. */
#define update_mic_pin(codec, nid, val) \ #define update_mic_pin(codec, nid, val) \
snd_hda_codec_update_cache(codec, nid, 0, \ snd_hda_codec_write_cache(codec, nid, 0, \
AC_VERB_SET_PIN_WIDGET_CONTROL, val) AC_VERB_SET_PIN_WIDGET_CONTROL, val)
static const struct hda_input_mux olpc_xo_dc_bias = { static const struct hda_input_mux olpc_xo_dc_bias = {
......
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