diff options
| author | Takashi Iwai <tiwai@suse.de> | 2026-04-09 12:38:16 +0300 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2026-04-09 13:05:54 +0300 |
| commit | d19ecd85a245a2052a502f72bee83982f535c2e6 (patch) | |
| tree | 1f30d5c7a503bd7f0d7881a2a17cf07aff9a1235 | |
| parent | cd8fd5a0566e0d93fbd408e6b06ca484a78b5ccd (diff) | |
| download | linux-d19ecd85a245a2052a502f72bee83982f535c2e6.tar.xz | |
ALSA: hda/realtek: Clean up with snd_hda_codec_set_gpio()
Use a new helper function to clean up the code.
Along with it, make alc_write_gpio() static as well, which is used
only locally in realtek.c.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260409093826.1317626-4-tiwai@suse.de
| -rw-r--r-- | sound/hda/codecs/realtek/realtek.c | 13 | ||||
| -rw-r--r-- | sound/hda/codecs/realtek/realtek.h | 1 |
2 files changed, 4 insertions, 10 deletions
diff --git a/sound/hda/codecs/realtek/realtek.c b/sound/hda/codecs/realtek/realtek.c index 39a1ead3b743..d9b2f1993eaf 100644 --- a/sound/hda/codecs/realtek/realtek.c +++ b/sound/hda/codecs/realtek/realtek.c @@ -123,22 +123,17 @@ void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, } EXPORT_SYMBOL_NS_GPL(alc_update_gpio_data, "SND_HDA_CODEC_REALTEK"); -void alc_write_gpio(struct hda_codec *codec) +static void alc_write_gpio(struct hda_codec *codec) { struct alc_spec *spec = codec->spec; if (!spec->gpio_mask) return; - snd_hda_codec_write(codec, codec->core.afg, 0, - AC_VERB_SET_GPIO_MASK, spec->gpio_mask); - snd_hda_codec_write(codec, codec->core.afg, 0, - AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir); - if (spec->gpio_write_delay) - msleep(1); - alc_write_gpio_data(codec); + snd_hda_codec_set_gpio(codec, spec->gpio_mask, spec->gpio_dir, + spec->gpio_data, + spec->gpio_write_delay ? 1 : 0); } -EXPORT_SYMBOL_NS_GPL(alc_write_gpio, "SND_HDA_CODEC_REALTEK"); void alc_fixup_gpio(struct hda_codec *codec, int action, unsigned int mask) { diff --git a/sound/hda/codecs/realtek/realtek.h b/sound/hda/codecs/realtek/realtek.h index b2a919904c4c..2ca15a6c2a08 100644 --- a/sound/hda/codecs/realtek/realtek.h +++ b/sound/hda/codecs/realtek/realtek.h @@ -171,7 +171,6 @@ void alc_setup_gpio(struct hda_codec *codec, unsigned int mask); void alc_write_gpio_data(struct hda_codec *codec); void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, bool on); -void alc_write_gpio(struct hda_codec *codec); /* common GPIO fixups */ void alc_fixup_gpio(struct hda_codec *codec, int action, unsigned int mask); |
