diff options
| author | wangdicheng <wangdicheng@kylinos.cn> | 2025-11-07 10:40:30 +0800 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-11-08 08:54:29 +0100 |
| commit | 592d1c23afb287d1eea0c83687203bff9d7e6eb3 (patch) | |
| tree | 8557c7c684acb5a29c225d680b99443e3537c550 | |
| parent | 79d062bdefbd404e6b350d04f3099617a2b82933 (diff) | |
ALSA: hda/senary: Replace magic numbers with defined constants
Replace hardcoded GPIO node value with a defined constant for better
code readability and maintainability.
Signed-off-by: wangdicheng <wangdicheng@kylinos.cn>
Link: https://patch.msgid.link/20251107024030.36712-1-wangdich9700@163.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
| -rw-r--r-- | sound/hda/codecs/senarytech.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/hda/codecs/senarytech.c b/sound/hda/codecs/senarytech.c index 9aa1e9bcd9ec..63cda57cf786 100644 --- a/sound/hda/codecs/senarytech.c +++ b/sound/hda/codecs/senarytech.c @@ -19,6 +19,9 @@ #include "hda_jack.h" #include "generic.h" +/* GPIO node ID */ +#define SENARY_GPIO_NODE 0x01 + struct senary_spec { struct hda_gen_spec gen; @@ -120,11 +123,11 @@ static void senary_init_gpio_led(struct hda_codec *codec) unsigned int mask = spec->gpio_mute_led_mask | spec->gpio_mic_led_mask; if (mask) { - snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK, + snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_MASK, mask); - snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DIRECTION, + snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_DIRECTION, mask); - snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, + snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_DATA, spec->gpio_led); } } |
