All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Devajith Jijush <devajuice@zohomail.in>
Cc: linux-sound@vger.kernel.org, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>
Subject: Re: [PATCH] ALSA: hda/conexant: Add quirk for Acer TravelLite TL05-41M
Date: Fri, 06 Nov 2026 15:34:04 +0100	[thread overview]
Message-ID: <87h5huowpv.wl-tiwai@suse.de> (raw)
In-Reply-To: <179396062556.127350.15308705935335598574@zohomail.in>

On Fri, 06 Nov 2026 11:23:45 +0100,
Devajith Jijush wrote:
> 
> The Acer TravelLite TL05-41M (subsystem 0x1558a600) uses a Conexant
> CX11880 codec whose analog output amplifier is enabled by codec GPIO
> bit 1.  The driver has no quirk for this machine, so the line is never
> raised and both the internal speakers and the 3.5 mm combo jack stay
> silent, while the microphone on the same jack, USB and Bluetooth audio
> work normally.
> 
> Add a fixup that sets GPIO bit 1 on this subsystem ID.  It is applied
> from the HDA_FIXUP_ACT_INIT hook, since the codec loses the GPIO state
> on a power transition and the line would otherwise stay off after the
> first runtime power save.
> 
> Note that the existing CXT_FIXUP_GPIO1 fixup raises GPIO bit 0, which
> has no effect on this board.
> 
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=222238
> Signed-off-by: Devajith Jijush <devajuice@zohomail.in>
> ---
> Note for reviewers: the GPIO behaviour was verified on the affected
> machine with hda-verb; I have not built a kernel with this patch, so the
> code path itself is untested.  Setting the same three GPIO bits from
> userspace makes both the internal speakers and the headphone jack work.
> 
>  sound/hda/codecs/conexant.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/sound/hda/codecs/conexant.c b/sound/hda/codecs/conexant.c
> index a141c94..623e466 100644
> --- a/sound/hda/codecs/conexant.c
> +++ b/sound/hda/codecs/conexant.c
> @@ -289,6 +289,7 @@ enum {
>  	CXT_FIXUP_HEADPHONE_MIC_PIN,
>  	CXT_FIXUP_HEADPHONE_MIC,
>  	CXT_FIXUP_GPIO1,
> +	CXT_FIXUP_AMP_GPIO1,
>  	CXT_FIXUP_ASPIRE_DMIC,
>  	CXT_FIXUP_THINKPAD_ACPI,
>  	CXT_FIXUP_LENOVO_XPAD_ACPI,
> @@ -826,6 +827,17 @@ static void cxt_fixup_hp_a_u(struct hda_codec *codec,
>  		cxt_setup_gpio_unmute(codec, 0x2);
>  }
>  
> +/* Acer TravelLite TL05-41M: the analog output amplifier is enabled by
> + * codec GPIO bit 1.  The codec loses the GPIO state on a power
> + * transition, so this must be applied on every init, not only at probe.
> + */
> +static void cxt_fixup_amp_gpio1(struct hda_codec *codec,
> +				const struct hda_fixup *fix, int action)
> +{
> +	if (action == HDA_FIXUP_ACT_INIT)
> +		snd_hda_codec_set_gpio(codec, 0x02, 0x02, 0x02, 0);
> +}
> +
>  /* Huawei MateBook 14 (SN6140): the speaker output follows the headphone
>   * pin's connection select in hardware.  Both pins must be routed to the
>   * shared DAC 0x10, which carries the playback stream; the generic
> @@ -1001,6 +1013,10 @@ static const struct hda_fixup cxt_fixups[] = {
>  			{ }
>  		},
>  	},
> +	[CXT_FIXUP_AMP_GPIO1] = {
> +		.type = HDA_FIXUP_FUNC,
> +		.v.func = cxt_fixup_amp_gpio1,
> +	},

There is already a GPIO bit 0 setup (called gpio1)

	[CXT_FIXUP_GPIO1] = {
		.type = HDA_FIXUP_VERBS,
		.v.verbs = (const struct hda_verb[]) {
			{ 0x01, AC_VERB_SET_GPIO_MASK, 0x01 },
			{ 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01 },
			{ 0x01, AC_VERB_SET_GPIO_DATA, 0x01 },
			{ }
		},
	},

so you can implement similarly,

	[CXT_FIXUP_GPIO2] = {
		.type = HDA_FIXUP_VERBS,
		.v.verbs = (const struct hda_verb[]) {
			{ 0x01, AC_VERB_SET_GPIO_MASK, 0x02 },
			{ 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x02 },
			{ 0x01, AC_VERB_SET_GPIO_DATA, 0x02 },
			{ }
		},
	},

and use this in the quirk, instead.  Then you don't need to create a
function.

> @@ -1255,6 +1273,7 @@ static const struct hda_quirk cxt5066_fixups[] = {
>  static const struct hda_model_fixup cxt5066_fixup_models[] = {
>  	{ .id = CXT_FIXUP_STEREO_DMIC, .name = "stereo-dmic" },
>  	{ .id = CXT_FIXUP_GPIO1, .name = "gpio1" },
> +	{ .id = CXT_FIXUP_AMP_GPIO1, .name = "amp-gpio1" },
>  	{ .id = CXT_FIXUP_HEADPHONE_MIC_PIN, .name = "headphone-mic-pin" },
>  	{ .id = CXT_PINCFG_LENOVO_TP410, .name = "tp410" },
>  	{ .id = CXT_FIXUP_THINKPAD_ACPI, .name = "thinkpad" },

Please avoid adding a new model string unless needed inevitably.
We can apply the existing quirk with the alias (xxxx:yyyy), too.


thanks,

Takashi

  reply	other threads:[~2026-11-06 14:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 10:23 [PATCH] ALSA: hda/conexant: Add quirk for Acer TravelLite TL05-41M Devajith Jijush
2026-11-06 14:34 ` Takashi Iwai [this message]
2026-11-06 15:08 ` [PATCH v2] " Devajith Jijush
2026-11-07  9:01   ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h5huowpv.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=devajuice@zohomail.in \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.