From: Lukas Wunner <lukas@wunner.de>
To: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
Cc: hansg@kernel.org, ilpo.jarvinen@linux.intel.com,
linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v2] apple-gmux: preserve brightness using EFI
Date: Thu, 5 Feb 2026 09:43:48 +0100 [thread overview]
Message-ID: <aYRYRLcf5fgWimDJ@wunner.de> (raw)
In-Reply-To: <20260204182816.1179-1-atharvatiwarilinuxdev@gmail.com>
On Wed, Feb 04, 2026 at 06:28:15PM +0000, Atharva Tiwari wrote:
> > Finally, there are Macs which don't have a gmux but which do have a
> > backlight. They usually control brightness through i915 I think.
> > It would be nice to save brightness to the EFI variable on those as well.
>
> There should be something for Amdgpus aswell for mac pro, but i cant
> test i915 nor amdgpu, as i dont have these devices. so i think we should
> currently drop this idea.
The ask is not that you should implement something you can't test.
The ask is that you should implement it in a way that is extensible
to be used by i915 and other drivers once someone comes along who can
test it.
I'd suggest adding a new drivers/firmware/efi/apple-bl.c which contains
all the logic to update the variable using a delayed work item. It could
provide an API call which apple-gmux invokes. Then i915 and amdgpu can
be retrofitted later on to invoke the API call as well.
Assuming that the new .c file is gated by a new CONFIG_EFI_APPLE_BL symbol,
CONFIG_APPLE_GMUX should "select EFI_APPLE_BL if EFI".
I think there are other EFI variables to store backlight brightness
of the keyboard and so on, so if you anticipate that you or someone
else may later on support those as well, then a more generic solution
would be a drivers/firmware/efi/apple-vars.c file instead of apple-bl.c.
> This function actually writes 6 bytes, which is u32 efi_attr (first 32-bits)
> and u16 efi_data (last 16-bits), but im confused about the fact, that the
> hexdumps show that ur attr are different. the attr should be 07 00 00 00
> but its 07 00 00 80, i think we should retrieve the attr in the probe
> function and use that for writing.
That could just be done in an initcall if you pursue the architecture
outlined above.
Thanks,
Lukas
prev parent reply other threads:[~2026-02-05 8:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-03 10:06 [PATCH v2] apple-gmux: preserve brightness using EFI Atharva Tiwari
2026-02-04 15:20 ` Lukas Wunner
2026-02-04 18:28 ` Atharva Tiwari
2026-02-05 8:43 ` Lukas Wunner [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=aYRYRLcf5fgWimDJ@wunner.de \
--to=lukas@wunner.de \
--cc=atharvatiwarilinuxdev@gmail.com \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/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