Linux ACPI
 help / color / mirror / Atom feed
From: Denis Benato <denis.benato@linux.dev>
To: "Daniel Dadap" <ddadap@nvidia.com>,
	"Riccardo Zanghí" <riccardo.z.dev@gmail.com>
Cc: Armin Wolf <W_Armin@gmx.de>,
	"platform-driver-x86@vger.kernel.org"
	<platform-driver-x86@vger.kernel.org>,
	"hansg@kernel.org" <hansg@kernel.org>,
	"ilpo.jarvinen@linux.intel.com" <ilpo.jarvinen@linux.intel.com>,
	"luke@ljones.dev" <luke@ljones.dev>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>
Subject: Re: [BUG] ASUS TUF Gaming A16 FA608UM: working backlight device differs between MUX modes
Date: Wed, 25 Nov 2026 23:26:07 +0100	[thread overview]
Message-ID: <94785b4d-c807-4465-84a1-25ae317df4b8@linux.dev> (raw)
In-Reply-To: <DSVPR12MB66402044074D6A8B1EDC584825BC432@DSVPR12MB664020.namprd12.prod.outlook.com>


On 11/25/26 23:14, Daniel Dadap wrote:
> On Wed, Nov 25, 2026 at 07:03:18PM +0100, Riccardo Zanghí wrote:
>> On Wed, 25 Nov 2026 at 07:13, Daniel Dadap <ddadap@nvidia.com> wrote:
>>> So, as an experiment, if you could read the LSb at physical address
>>> 0xFEDD83B8 in both iGPU and dGPU modes, and report on the value, that
>>> would help.
>> Hi Daniel,
>>
>> Thanks for the detailed analysis. I believe I received your full message by
>> mail.
> Right, I only got bounces from the lists, not the individual recipients, so
> you very likely got three copies. (Sorry.)
>
>> Result of: od -An -t x1 -j $((0xFEDD83B8)) -N 1 /dev/mem
>>
>> integrated mode:              4a  (bit 0 = 0)
>> dGPU mode (gpu_mux_mode = 0): 07  (bit 0 = 1)
>>
>> So G40C does differ between the two modes. I can try the DSDT
>> override next and report back, or test any other patch.
>>
> Yes, I think doing the DSDT override as the next experiment makes the most
> sense. The ASL should be amended to read:
>
>> If ((MODF == Zero))
>> {
>>     If ((^^SBRG.EC0.G40C == One))
>>     {
>>         Return (One)
>>     }
>>     Else
>>     {
>>         Return (0x02)
>>     }
>> } 
> which I suspect will reflect the design intent better.
>
> You could also try patching the kernel instead, maybe with something along
> these lines (completely untested; you'll need to supply your own DMI ID
> strings from your machine's SMBIOS):
>

I can ask ASUS to try fixing things that are out of spec, but we have to
prepare to the eventuality that it won't get touched.

An ACPI override means secure boot won't work on these models,
so despite being (probably) the best thing to so it has its own downside.

> --- a/drivers/acpi/video_detect.c
> +++ b/drivers/acpi/video_detect.c
> @@ -131,6 +131,44 @@ static int video_detect_portege_r100(const struct dmi_system_id *d)
>  	return 0;
>  }
>  
> +struct video_detect_runtime_dependent_data {
> +	phys_addr_t address;
> +	u8 mask;
> +	enum acpi_backlight_type backlight_type_if_true;
> +	enum acpi_backlight_type backlight_type_if_false;
> +};
> +
> +static struct video_detect_runtime_dependent_data asus_a16_dmi_drvdata = {
> +	.address = 0xfedd83b8,
> +	.mask = 1,
> +	.backlight_type_if_true = acpi_backlight_native,
> +	.backlight_type_if_false = acpi_backlight_nvidia_wmi_ec,
> +};
> +
> +static int video_detect_runtime_dependent(const struct dmi_system_id *d)
> +{
> +	const struct video_detect_runtime_dependent_data *data = d->driver_data;
> +	void __iomem *map;
> +	u8 val;
> +
> +	map = ioremap(data->address, 1);
> +	if (!map) {
> +		pr_warn("Unable to map backlight selection register at %pa; skipping quirk\n",
> +		       &data->address);
> +		return 0;
> +	}
> +
> +	val = readb(map);
> +	iounmap(map);
> +
> +	if (val & data->mask)
> +		acpi_backlight_dmi = data->backlight_type_if_true;
> +	else
> +		acpi_backlight_dmi = data->backlight_type_if_false;
> +
> +	return 0;
> +}
> +
>  static const struct dmi_system_id video_detect_dmi_table[] = {
>  	/*
>  	 * Models which should use the vendor backlight interface,
> @@ -986,6 +1024,19 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
>  		DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"),
>  		},
>  	},
> +
> +	/*
> +	 * This notebook is supposed to select the backlight control device
> +	 * based on runtime state readable from the EC's MMIO region, but
> +	 * ends up requesting the EC backlight driver regardless of the state.
> +	 */
> +	{
> +	 .callback = video_detect_runtime_dependent,
> +	 .matches = {
> +		 /* XXX supply appropriate DMI_MATCH() macros here */
> +		},
> +	 .driver_data = &asus_a16_dmi_drvdata,
> +	},
>  	{ },
>  };
>  

  reply	other threads:[~2026-11-25 22:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 23:27 [BUG] ASUS TUF Gaming A16 FA608UM: working backlight device differs between MUX modes Riccardo Zanghí
2026-11-24 18:48 ` Denis Benato
2026-11-24 20:17   ` Armin Wolf
2026-11-24 20:31     ` Denis Benato
2026-11-24 23:10     ` Riccardo Zanghí
2026-11-25 13:20       ` Daniel Dadap
2026-11-25 18:03         ` Riccardo Zanghí
2026-11-25 22:14           ` Daniel Dadap
2026-11-25 22:26             ` Denis Benato [this message]
     [not found]               ` <20A82893-B458-43A0-A3B9-0C090BAF7F00@nvidia.com>
2026-11-26  8:48                 ` Riccardo Zanghí

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=94785b4d-c807-4465-84a1-25ae317df4b8@linux.dev \
    --to=denis.benato@linux.dev \
    --cc=W_Armin@gmx.de \
    --cc=ddadap@nvidia.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=luke@ljones.dev \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=riccardo.z.dev@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox