]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: hda/ca0132: Clean up with the new GPIO helper
authorTakashi Iwai <tiwai@suse.de>
Thu, 9 Apr 2026 09:38:20 +0000 (11:38 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 9 Apr 2026 10:05:54 +0000 (12:05 +0200)
Use the new GPIO helper function to clean up the open code.

Merely a code refactoring, and no behavior change.

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

index a0677d7da8e2d801a1add1fee52656bcdf654512..ad533b04ab29cf277ef86b8a9129beefde39b4ed 100644 (file)
@@ -3755,22 +3755,12 @@ static void ca0132_gpio_setup(struct hda_codec *codec)
 
        switch (ca0132_quirk(spec)) {
        case QUIRK_SBZ:
-               snd_hda_codec_write(codec, 0x01, 0,
-                               AC_VERB_SET_GPIO_DIRECTION, 0x07);
-               snd_hda_codec_write(codec, 0x01, 0,
-                               AC_VERB_SET_GPIO_MASK, 0x07);
-               snd_hda_codec_write(codec, 0x01, 0,
-                               AC_VERB_SET_GPIO_DATA, 0x04);
+               snd_hda_codec_set_gpio(codec, 0x07, 0x07, 0x04, 0);
                snd_hda_codec_write(codec, 0x01, 0,
                                AC_VERB_SET_GPIO_DATA, 0x06);
                break;
        case QUIRK_R3DI:
-               snd_hda_codec_write(codec, 0x01, 0,
-                               AC_VERB_SET_GPIO_DIRECTION, 0x1E);
-               snd_hda_codec_write(codec, 0x01, 0,
-                               AC_VERB_SET_GPIO_MASK, 0x1F);
-               snd_hda_codec_write(codec, 0x01, 0,
-                               AC_VERB_SET_GPIO_DATA, 0x0C);
+               snd_hda_codec_set_gpio(codec, 0x1F, 0x1E, 0x0C, 0);
                break;
        default:
                break;