Re: [PATCH v3] apple-gmux: preserve brightness using EFI

From: Lukas Wunner

Date: Sun Mar 15 2026 - 10:35:16 EST


On Sun, Mar 15, 2026 at 04:15:03AM +0530, Atharva Tiwari wrote:
> > This version moves the EFI handling back to the gmux driver. Why?
>
> Because the platform maintainer just NACKed the EFI backend driver, so i
> cant do anything
>
> https://lore.kernel.org/all/c2d14818-1c34-47c7-a210-1f7c737f0bc9@xxxxxxxxxx/

The NAK was only because of writing to the EFI variable in frequent
intervals. I'd assume Hans is fine if it is synced only once on
shutdown.

Splitting out the EFI handling into a separate component in
drivers/firmware/efi/ as you did in this version:

https://lore.kernel.org/all/20260206125641.12983-2-atharvatiwarilinuxdev@xxxxxxxxx/

... is much cleaner as it allows code reuse by i915 and other drivers
which may be controlling brightness on MacBooks or iMacs without a gmux.
So I'd really prefer if you went back to that, but sync only on shutdown
and only if brightness has changed, per Hans' request.

BTW, I did another test on my MacBook9,1 with brightness set to maximum
on macOS, then booting into Linux. The EFI variable as set by macOS
contains:

07 00 00 80 ff 03

... but /sys/class/backlight/gmux_backlight/brightness contains the
value 110400 (0x1af40), which obviously exceeds USHRT_MAX. So I'm not
convinced that writing that raw value to the EFI variable actually yields
correct results.

Thanks,

Lukas