]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: hda/alc662: Simplify the quirk for CSL Unity BF24B
authorTakashi Iwai <tiwai@suse.de>
Thu, 9 Apr 2026 09:38:17 +0000 (11:38 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 9 Apr 2026 10:05:54 +0000 (12:05 +0200)
The previous implementation of the quirk for CSL Unity BF24B in commit
de65275fc94e ("ALSA: hda/realtek: Add quirk for CSL Unity BF24B")
introduced the unnecessary GPIO caching which leads to a superfluous
write at each init/resume.

Use the new helper to write GPIO bits directly for optimization.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260409093826.1317626-5-tiwai@suse.de
sound/hda/codecs/realtek/alc662.c

index 3abe41c7315c4646d703ea626cf8d2aa13206caf..2cf3664a35ff099b0bd4907f569ca63435342e7b 100644 (file)
@@ -258,19 +258,11 @@ static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
 static void alc662_fixup_csl_amp(struct hda_codec *codec,
                                 const struct hda_fixup *fix, int action)
 {
-       struct alc_spec *spec = codec->spec;
-
-       switch (action) {
-       case HDA_FIXUP_ACT_PRE_PROBE:
-               spec->gpio_mask |= 0x03;
-               spec->gpio_dir |= 0x03;
-               break;
-       case HDA_FIXUP_ACT_INIT:
+       if (action == HDA_FIXUP_ACT_INIT) {
                /* need to toggle GPIO to enable the amp */
-               alc_update_gpio_data(codec, 0x03, true);
+               snd_hda_codec_set_gpio(codec, 0x03, 0x03, 0x03, 0);
                msleep(100);
-               alc_update_gpio_data(codec, 0x03, false);
-               break;
+               snd_hda_codec_set_gpio(codec, 0x03, 0x03, 0x00, 0);
        }
 }