]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: hda/alc269: Drop superfluous GPIO write at resume
authorTakashi Iwai <tiwai@suse.de>
Thu, 9 Apr 2026 14:37:29 +0000 (16:37 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 9 Apr 2026 14:39:10 +0000 (16:39 +0200)
alc269_resume() has an extra code to write GPIO data, but this is
basically already done in the standard alc_init(), hence it's
superfluous.  Let's drop the code.

Since all external callers of alc_write_gpio_data() are gone after
this, fold the only usage of alc_write_gpio_data() into the caller and
drop the export as well.

Link: https://patch.msgid.link/20260409143735.1412134-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/hda/codecs/realtek/alc269.c
sound/hda/codecs/realtek/realtek.c
sound/hda/codecs/realtek/realtek.h

index 9a799919e0c82c4f598a59d3b8b67c6e3f23a2f2..0a5eadec3ef6f7dcc2189b46dc8cd9775bcf3ccf 100644 (file)
@@ -1004,13 +1004,6 @@ static int alc269_resume(struct hda_codec *codec)
        snd_hda_regmap_sync(codec);
        hda_call_check_power_status(codec, 0x01);
 
-       /* on some machine, the BIOS will clear the codec gpio data when enter
-        * suspend, and won't restore the data after resume, so we restore it
-        * in the driver.
-        */
-       if (spec->gpio_data)
-               alc_write_gpio_data(codec);
-
        if (spec->has_alc5505_dsp)
                alc5505_dsp_resume(codec);
 
index d9b2f1993eaf73c80dccd636c78f244e93042976..db365a746b1adc9b60513976e8f36feb3fcdebdc 100644 (file)
@@ -99,15 +99,6 @@ void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
 }
 EXPORT_SYMBOL_NS_GPL(alc_setup_gpio, "SND_HDA_CODEC_REALTEK");
 
-void alc_write_gpio_data(struct hda_codec *codec)
-{
-       struct alc_spec *spec = codec->spec;
-
-       snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
-                           spec->gpio_data);
-}
-EXPORT_SYMBOL_NS_GPL(alc_write_gpio_data, "SND_HDA_CODEC_REALTEK");
-
 void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
                          bool on)
 {
@@ -119,7 +110,8 @@ void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
        else
                spec->gpio_data &= ~mask;
        if (oldval != spec->gpio_data)
-               alc_write_gpio_data(codec);
+               snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
+                                   spec->gpio_data);
 }
 EXPORT_SYMBOL_NS_GPL(alc_update_gpio_data, "SND_HDA_CODEC_REALTEK");
 
index 2ca15a6c2a0840601179a7e002887b186a697eaa..de95642bb6484ed915e8c33b5bd21f0ef43862c0 100644 (file)
@@ -168,7 +168,6 @@ void alc_process_coef_fw(struct hda_codec *codec, const struct coef_fw *fw);
  * GPIO helpers
  */
 void alc_setup_gpio(struct hda_codec *codec, unsigned int mask);
-void alc_write_gpio_data(struct hda_codec *codec);
 void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
                          bool on);