All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Pannarat Wiriyaarritham <pannarat.wiriyaarritham@danielcorp.dev>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: typec: ucsi: acpi: Assume UCSI 1.2 on Acer Nitro ANV15-41
Date: Fri, 11 Sep 2026 13:12:03 +0200	[thread overview]
Message-ID: <aqPiAwbVWQ1Owwdy@black.igk.intel.com> (raw)
In-Reply-To: <20260910023338.31816-1-pannarat.wiriyaarritham@danielcorp.dev>

On Thu, Sep 10, 2026 at 09:33:37AM +0700, Pannarat Wiriyaarritham wrote:
> The Acer Nitro ANV15-41 exposes a functional UCSI ACPI PPM but
> reports a UCSI VERSION value of zero.
> 
> ucsi_register() rejects a zero version with -ENODEV, leaving the
> system without registered USB Type-C connectors.
> 
> The PPM works correctly when using the UCSI 1.2 layout. With UCSI
> 1.2 assumed, both Type-C connectors register correctly and USB Power
> Delivery negotiation works.
> 
> Add a DMI-specific UCSI operation for the Acer Nitro ANV15-41 that
> substitutes UCSI 1.2 only when firmware reports a zero version.
> Preserve any valid non-zero firmware version.
> 
> Tested on an Acer Nitro ANV15-41 with BIOS V1.51.
> 
> Fixes: c1b0bc2dabfa ("usb: typec: Add support for UCSI interface")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Pannarat Wiriyaarritham <pannarat.wiriyaarritham@danielcorp.dev>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/ucsi/ucsi_acpi.c | 34 ++++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c
> index 18286d3e9..5697ccc24 100644
> --- a/drivers/usb/typec/ucsi/ucsi_acpi.c
> +++ b/drivers/usb/typec/ucsi/ucsi_acpi.c
> @@ -121,6 +121,33 @@ static const struct ucsi_operations ucsi_acpi_ops = {
>  	.async_control = ucsi_acpi_async_control
>  };
>  
> +static int ucsi_acer_read_version(struct ucsi *ucsi, u16 *version)
> +{
> +	struct ucsi_acpi *ua = ucsi_get_drvdata(ucsi);
> +	int ret;
> +
> +	ret = ucsi_acpi_read_version(ucsi, version);
> +	if (ret)
> +		return ret;
> +
> +	if (!*version) {
> +		dev_warn(ua->dev, "UCSI version is zero, assuming 1.2\n");
> +		*version = UCSI_VERSION_1_2;
> +	}
> +
> +	return 0;
> +}
> +
> +static const struct ucsi_operations ucsi_acer_ops = {
> +	.read_version = ucsi_acer_read_version,
> +	.read_cci = ucsi_acpi_read_cci,
> +	.poll_cci = ucsi_acpi_poll_cci,
> +	.read_message_in = ucsi_acpi_read_message_in,
> +	.write_message_out = ucsi_acpi_write_message_out,
> +	.sync_control = ucsi_sync_control_common,
> +	.async_control = ucsi_acpi_async_control
> +};
> +
>  static int ucsi_gram_sync_control(struct ucsi *ucsi, u64 command, u32 *cci,
>  				  void *val, size_t len, void *msg_out,
>  				  size_t msg_out_size)
> @@ -162,6 +189,13 @@ static const struct ucsi_operations ucsi_gram_ops = {
>  };
>  
>  static const struct dmi_system_id ucsi_acpi_quirks[] = {
> +	{
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "Nitro ANV15-41"),
> +		},
> +		.driver_data = (void *)&ucsi_acer_ops,
> +	},
>  	{
>  		.matches = {
>  			DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
> -- 
> 2.55.0

-- 
heikki

      reply	other threads:[~2026-09-11 11:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10  2:33 [PATCH] usb: typec: ucsi: acpi: Assume UCSI 1.2 on Acer Nitro ANV15-41 Pannarat Wiriyaarritham
2026-09-11 11:12 ` Heikki Krogerus [this message]

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=aqPiAwbVWQ1Owwdy@black.igk.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=pannarat.wiriyaarritham@danielcorp.dev \
    /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.