From: Takashi Iwai Date: Thu, 9 Apr 2026 09:38:17 +0000 (+0200) Subject: ALSA: hda/alc662: Simplify the quirk for CSL Unity BF24B X-Git-Tag: v7.1-rc1~166^2~9^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef27d8ce0a3b55744b86e1866c62dc7537749180;p=thirdparty%2Fkernel%2Flinux.git ALSA: hda/alc662: Simplify the quirk for CSL Unity BF24B 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 Link: https://patch.msgid.link/20260409093826.1317626-5-tiwai@suse.de --- diff --git a/sound/hda/codecs/realtek/alc662.c b/sound/hda/codecs/realtek/alc662.c index 3abe41c7315c4..2cf3664a35ff0 100644 --- a/sound/hda/codecs/realtek/alc662.c +++ b/sound/hda/codecs/realtek/alc662.c @@ -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); } }