I did some research to get readings from the ambient light sensor on my ASUS Zenbook Prime. Unfortunately, I didn't manage to find them, but hopefully this can be a starting point for someone more knowledgeable to make this work.
I first tried to find a WMI device whose status changes depending on the
ambient light. I used the /sys/kernel/debug/asus-nb-wmi
interface for
this:
$ echo 0x60023 > dev_id
$ cat dsts
DSTS(0x60023) = 0x5
So there is a device with id 0x60023
and its status is 0x5
. I
checked drivers/platform/x86/asus-wmi.c
in de kernel source for
plausible values for device ids.
Then, I tried to obtain backlight values directly from ACPI using
acpi-call
. The right method
should be \_SB.ALS._ALI
but I always obtain the same value 0x32
.
# cd /proc/acpi
# echo '\_SB.ALS._ALI' > call && cat call && echo
0x32
You can look at the ACPI source code as follows (also see this article by Matthew Garrett):
$ cp /sys/firmware/acpi/tables/DSDT DSDT
$ iasl -d DSDT
$ view DSDT.dsl
It shows that the value for _ALI
is determined (in a method RALS
) by
some sort of switch statement on the value of RRAM(0x04C9)
. This
latter value is always 0
, as you can check by
# echo '\_SB.PCI0.LPCB.EC0.RRAM 0x04c9' > call && cat call && echo
0x0
That doesn't seem like a valid sensor value. Maybe this is a bug in the ACPI firmware? Unfortunately, I uninstalled Windows, so I can't really check what happens there.