Re: [PATCH] ALSA: hda/realtek: Add quirk for CSL Unity BF24B

From: Takashi Iwai

Date: Thu Apr 09 2026 - 01:10:56 EST


On Thu, 09 Apr 2026 04:40:28 +0200,
Zhang Heng wrote:
>
> The CSL Unity BF24B all-in-one PC uses a Realtek ALC662 rev3 audio
> codec and requires the correct GPIO configuration to enable sound
> output from both the speakers and the headphone.
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=221258
> Signed-off-by: Zhang Heng <zhangheng@xxxxxxxxxx>
> ---
> sound/hda/codecs/realtek/alc662.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/sound/hda/codecs/realtek/alc662.c b/sound/hda/codecs/realtek/alc662.c
> index 5073165d1f3c..3abe41c7315c 100644
> --- a/sound/hda/codecs/realtek/alc662.c
> +++ b/sound/hda/codecs/realtek/alc662.c
> @@ -255,6 +255,25 @@ static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
> alc_fixup_headset_mode(codec, fix, action);
> }
>
> +static void alc662_fixup_csl_amp(struct hda_codec *codec,
> + const struct hda_fixup *fix, int action)
> +{
> + struct alc_spec *spec = codec->spec;
> +
> + switch (action) {
> + case HDA_FIXUP_ACT_PRE_PROBE:
> + spec->gpio_mask |= 0x03;
> + spec->gpio_dir |= 0x03;
> + break;

Do we need to set gpio_mask and gpio_dir explicitly for this bit?
Looking at the rest of the patch...

> + case HDA_FIXUP_ACT_INIT:
> + /* need to toggle GPIO to enable the amp */
> + alc_update_gpio_data(codec, 0x03, true);
> + msleep(100);
> + alc_update_gpio_data(codec, 0x03, false);
> + break;

... here is the only place to fiddle with this GPIO bit, and it's used
for gating. OTOH, spec->gpio_mask, gpio_dir and gpio_data are used at
alc_write_gpio() that is called from alc_init(), and IIUC, this bit
doesn't have to be initialized there.


thanks,

Takashi