]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: hda/senarytech: Clean up with the new GPIO helper
authorTakashi Iwai <tiwai@suse.de>
Thu, 9 Apr 2026 09:38:23 +0000 (11:38 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 9 Apr 2026 10:05:55 +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-11-tiwai@suse.de
sound/hda/codecs/senarytech.c

index 29b554cdd81d48337a84da9a93865b9a5a3096e0..3ee8bc0ea3ab5555a1ee4787d950d2b318980adf 100644 (file)
@@ -159,14 +159,8 @@ static void senary_init_gpio_led(struct hda_codec *codec)
        struct senary_spec *spec = codec->spec;
        unsigned int mask = spec->gpio_mute_led_mask | spec->gpio_mic_led_mask;
 
-       if (mask) {
-               snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_GPIO_MASK,
-                                   mask);
-               snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_GPIO_DIRECTION,
-                                   mask);
-               snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_GPIO_DATA,
-                                   spec->gpio_led);
-       }
+       if (mask)
+               snd_hda_codec_set_gpio(codec, mask, mask, spec->gpio_led, 0);
 }
 
 static int senary_init(struct hda_codec *codec)