Skip to content

Commit 83307ae

Browse files
wangdichengtiwai
authored andcommitted
ALSA: hda/senary: Use codec->core.afg for GPIO access
Replace the hardcoded GPIO node ID (0x01) with codec->core.afg. This follows the standard HDA driver practice and makes the driver more robust against different hardware configurations. Signed-off-by: wangdicheng <wangdicheng@kylinos.cn> Link: https://patch.msgid.link/20260303054242.318062-1-wangdich9700@163.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 9399266 commit 83307ae

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

sound/hda/codecs/senarytech.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
#include "hda_jack.h"
2020
#include "generic.h"
2121

22-
/* GPIO node ID */
23-
#define SENARY_GPIO_NODE 0x01
24-
2522
struct senary_spec {
2623
struct hda_gen_spec gen;
2724

@@ -123,11 +120,11 @@ static void senary_init_gpio_led(struct hda_codec *codec)
123120
unsigned int mask = spec->gpio_mute_led_mask | spec->gpio_mic_led_mask;
124121

125122
if (mask) {
126-
snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_MASK,
123+
snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_GPIO_MASK,
127124
mask);
128-
snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_DIRECTION,
125+
snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_GPIO_DIRECTION,
129126
mask);
130-
snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_DATA,
127+
snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_GPIO_DATA,
131128
spec->gpio_led);
132129
}
133130
}

0 commit comments

Comments
 (0)