[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251106053902.98614-1-wangdich9700@163.com>
Date: Thu, 6 Nov 2025 13:39:02 +0800
From: wangdich9700@....com
To: lgirdwood@...il.com,
broonie@...nel.org,
perex@...ex.cz,
tiwai@...e.com,
cezary.rojewski@...el.com
Cc: linux-kernel@...r.kernel.org,
alsa-devel@...a-project.org,
linux-arm-kernel@...ts.infradead.org,
wangdicheng <wangdich9700@....com>,
wangdicheng <wangdicheng@...inos.cn>
Subject: [PATCH] ALSA: hda/senary: Replace magic numbers with defined constants
From: wangdicheng <wangdich9700@....com>
Replace hardcoded GPIO node value with a defined constant for better
code readability and maintainability.
Signed-off-by: wangdicheng <wangdicheng@...inos.cn>
---
sound/hda/codecs/senarytech.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/sound/hda/codecs/senarytech.c b/sound/hda/codecs/senarytech.c
index 99af8d5e51db..d61d57538bc9 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;
@@ -131,11 +134,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);
}
}
--
2.25.1
Powered by blists - more mailing lists