[Bug 214899] ideapad-laptop: brightness hotkeys not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=214899

--- Comment #29 from Hans de Goede (jwrdegoede@xxxxxxxxxxxxxxxxx) ---
(In reply to Johannes Penßel from comment #28)
> Finally, I have managed to get the keys working. 
> 
> Using ec-dump.exe, I figured out which EC registers hold different values on
> Windows compared to Linux. After writing 0x86 to offset 0xA3, (which is 0x80
> on Linux by default) the keys started working instantly, with proper ACPI
> events and everything.

That is some good detective work on your side!

May I ask how you are writing 0x86 to offset 0xA3 under Linux ?

I think this part of the DSDT is interesting:

        Device (EC0)
        {
            ...

            OperationRegion (ERAX, SystemMemory, 0xFE0B0400, 0xFF)
            Field (ERAX, ByteAcc, Lock, Preserve)
            {
                ...
                Offset (0xA3), 
                OSTY,   3, 
                    ,   1, 
                ADPI,   2, 
                    ,   1, 
                ADPT,   1, 
                ...
            }
            ...

            Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If ((Arg0 == 0x03))
                {
                    ECAV = Arg1
                }

                If (((Arg0 == 0x03) && (Arg1 == One)))
                {
                    ...
                    If ((OSYS == 0x07DF))
                    {
                        Local0 = 0x06
                    }

                    If ((Acquire (LFCM, 0xA000) == Zero))
                    {
                        OSTY = Local0


Under Linux OSYS should be 0x06. So this in essence writes 0x06 to the lower 4
bits of the byte at offset 0xA3 of the MMIO region at 0xFE0B0400...

So maybe this is the path which we need to hit, but which for some reason is
not being hit under Linux ... ?

We could try to confirm this with a DSDT override. where we add an extra
unconditional (sow without all the if-s):


                       OSTY = 0x06 

To the top of the _REG method above and then build a new DSDT and use the
initrd override method to inject this. See:

https://docs.kernel.org/admin-guide/acpi/initrd_table_override.html

If you can give this a try that would be great. If the issue turns out to be
that the _REG code is somehow not hitting the desired code-path then that
likely is a generic issue caused by subtle differences between how Linux runs
ACPI code vs how Windows does it. And figuring that out and fixing it will
likely also help on other devices.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux