Jump to content
EMlyDinEsH

Fn HotKey and ALS sensor driver for Asus Notebooks

Recommended Posts

P.D. I send you a PM for reporting the donation I did, but I think your inbox are full.

Thanks for reporting, It's fixed now! :-)

Share this post


Link to post
Share on other sites

Thanks for take a look on Nvidia, I´ll wait for your answer.

 

Are all the DSDT edit for enable my backlight keyboard ok? If so why it doesn´t work? Please help :D

 

The Fn+F7 in windows disable the internal screen, and the Fn+F8 enable the external screen (it keeps the internal screen working) for a presentation.

 

Thanks man!!

 

P.D. I send you a PM for reporting the donation I did, but I think your inbox are full.

 

https://osxlatitude.com/index.php?/topic/1945-dsdtssdt-patching/

 

Follow this thread and send me your dump so i can add your model to our EDP and can try to fix your keyboard/screen backlight. Did you edit the dsdt for the patches I did in the first post?

Share this post


Link to post
Share on other sites

https://osxlatitude.com/index.php?/topic/1945-dsdtssdt-patching/

 

Follow this thread and send me your dump so i can add your model to our EDP and can try to fix your keyboard/screen backlight. Did you edit the dsdt for the patches I did in the first post?

 

Yes I did all the mods in the first post, but it´s not working.

 

 I send my files to dsdtssdt@osxlatitude.comI attach all the ACPI DUMP unmodified and my DSDT with mods for backlight keyboard.

 

 

 With your driver + this moded DSDT I get:

 

 

Fn+F1=Sleep

Fn+F2=Wi-Fi ON/OFF

Fn+F3/Fn+F4= Not Working (In Windows F3 Keyboard Backlight down, F4 Keyboard Backlight Up)

Fn+F5/Fn+F6= Not Working either 

Fn+F7=Freeze I had to reboot (In windows this key disable internal screen)

Fn+F8=Freeze I had to reboot (In windows this key enables screen internal and external screens)

Fn+F9=Not working ( In windows this disables the trackpad)

Fn+F10= Mute with Animation

Fn+F11=Volume Down with Animation

Fn+F12=Volume Up with Animation

Fn+ Up= Stop

Fn+ Down=Play/Pause

Fn+Right= Forward 

Fn+Left= Rewind

 

Thanks!!!

G74SX-ACPIdump.zip

ASUSG74SXMOD.zip

Share this post


Link to post
Share on other sites

I managed to get backlight for keyboard working on my Zenbook (on newer AppleACPI) by changing the SKBL DSDT method to:

            Method (SKBL, 1, NotSerialized)
            {
                Store (Arg0, Local1)
                Store (DerefOf (Index (PWKB, Local1)), Local0)
                ^^PCI0.LPCB.EC0.WRAM (0x044B, Local0)
                Return (One)
            }

Share this post


Link to post
Share on other sites

 

I managed to get backlight for keyboard working on my Zenbook (on newer AppleACPI) by changing the SKBL DSDT method to:

            Method (SKBL, 1, NotSerialized)
            {
                Store (Arg0, Local1)
                Store (DerefOf (Index (PWKB, Local1)), Local0)
                ^^PCI0.LPCB.EC0.WRAM (0x044B, Local0)
                Return (One)
            }

I try this and it Works!!!! on my ASUS G74SX, thanks for share 68x and to EMlyDinEsH for get this to work, one issue minus to worry about just 2 remain, Screen BackLight control and Audio after sleep to have a 100% working HacbookPro

 

Good luck to everyone

Share this post


Link to post
Share on other sites

* Audio after sleep

EmlyDinesh has a thread with a fix for that

 

--

 

Note: this is only needed if you're using a non-rolled back/newer AppleACPIPlatform. I don't need this anymore.

 

Anyway, I managed to fix lid state detection (now I haz sleep on lid close again) and the Fn+F7 (display off) key combo on my N55SL with 10.8's AppleACPIPlatform.kext by taking the RPIN, SPIN and ST87 methods from ASUS' older laptops and modifying them slightly to work with more recent Asus laptops. In malformed diff form (use LPCB if you don't have SBRG in your DSDT):

--- dsdt.orig.dsl	2013-06-01 04:43:29.000000000 +0100
+++ DSDT.new.dsl	2013-06-01 14:20:10.000000000 +0100
@@ -15358,6 +15358,30 @@
             Return (Local1)
         }

        Method (ECCM, 4, Serialized)
        {
            If (ECAV ())
            {
                Acquire (MUEC, 0xFFFF)
                Store (Arg0, CDT1)
                Store (Arg1, CDT2)
                Store (Arg2, CDT3)
                Store (Arg3, CMD1)
                Store (0x7F, Local0)
                While (LAnd (Local0, CMD1))
                {
                    Sleep (One)
                    Decrement (Local0)
                }

                If (LEqual (CMD1, Zero))
                {
                    Store (CDT1, Local0)
                }
                Else
                {
                    Store (Ones, Local0)
                }

                Release (MUEC)
                Return (Local0)
            }

            Return (Ones)
        }

        Method (RPUN, 1, Serialized)
        {
            Return (ECCM (0x87, Zero, Arg0, 0xB6))
        }

        Method (SPUN, 2, Serialized)
        {
            If (Arg1)
            {
                ECCM (0x87, 0x20, Arg0, 0xB6)
            }
            Else
            {
                ECCM (0x87, 0x40, Arg0, 0xB6)
            }
        }

@@ -17620,8 +17676,9 @@
         Method (_Q10, 0, NotSerialized)  // _Qxx: EC Query
         {
             Store (One, Local0)
-            Store (RPIN (0x35), Local0)
+            Store (RPUN (0x35), Local0)
             XOr (Local0, One, Local0)
-            SPIN (0x35, Local0)
+            SPUN (0x35, Local0)
             If (ATKP)
             {
@@ -18222,7 +18279,7 @@
             Method (_LID, 0, NotSerialized)  // _LID: Lid Status
             {
                 Store (One, Local0)
-                Store (^^PCI0.SBRG.EC0.RPIN (0x46), Local0)
+                Store (^^PCI0.SBRG.EC0.RPUN (0x46), Local0)
                 If (LEqual (Local0, Ones))
                 {
                     Store (One, Local0)
@@ -19994,7 +20051,7 @@
 
         Method (GLID, 0, Serialized)
         {
-            Return (\_SB.PCI0.SBRG.EC0.RPIN (0x46))
+            Return (\_SB.PCI0.SBRG.EC0.RPUN (0x46))
         }
 
         Method (TLID, 0, Serialized)
In a nicer explanation form:

 

Inside your DSDT, search for "RPIN," and you should find the RPIN method. On the blank line between the curly brace denominating the end of the RPIN method and the line with the next Method (which is RBAT in my case), paste in the following:

 

        Method (ECCM, 4, Serialized)
        {
            If (ECAV ())
            {
                Acquire (MUEC, 0xFFFF)
                Store (Arg0, CDT1)
                Store (Arg1, CDT2)
                Store (Arg2, CDT3)
                Store (Arg3, CMD1)
                Store (0x7F, Local0)
                While (LAnd (Local0, CMD1))
                {
                    Sleep (One)
                    Decrement (Local0)
                }

                If (LEqual (CMD1, Zero))
                {
                    Store (CDT1, Local0)
                }
                Else
                {
                    Store (Ones, Local0)
                }

                Release (MUEC)
                Return (Local0)
            }

            Return (Ones)
        }

        Method (RPUN, 1, Serialized)
        {
            Return (ECCM (0x87, Zero, Arg0, 0xB6))
        }

        Method (SPUN, 2, Serialized)
        {
            If (Arg1)
            {
                ECCM (0x87, 0x20, Arg0, 0xB6)
            }
            Else
            {
                ECCM (0x87, 0x40, Arg0, 0xB6)
            }
        }
Next, search for "GLID, " and when you find the GLID method that calls RPIN, change RPIN to RPUN. Search for "_LID," and do the same there.

 

Next, to get Fn+F7 turning your display on/off, search for "_Q10," and in that function change RPIN to RPUN and SPIN to SPUN.

 

--

 

Thanks to EmlyDinesh's battery work (taken from 68x's DSDT) [EDIT: now using RehabMan's battery patch], EmlyDinesh's fix for the brightness keys and this lid fix, I now have no reason to use an older AppleACPIPlatform.kext anymore.

 

EDIT: @EmlyDinesh, is it possible to turn off the debug logging in 1.4? I'm still using 1.3 as it doesn't print each Fn key I'm pressing in my dmesg.

 

EDIT 2: After some more digging into Asus DSDTs, I found out the proper values that go to the ECCM function to get the same information as RPIN so it should now work on all Asus laptops (tested on my old Asus N55SL and 68x tested it on his much newer Zenbook).

Share this post


Link to post
Share on other sites

Yeah I know his ioaudiofamily kext for avoid audio after sleep issue but my ALC 269 has the speaker node at 1B, I tried his kext for this Node but it doesn't work. the kext for Node 14 is which is working for most people doesn't work for me. I contact Dinesh for fix the ioaudiofamily kext specially for my Speaker Node and he says he will update all the kext, so I'm watting for this.

 

Thanks for reply and Good Luck

Share this post


Link to post
Share on other sites

EmlyDinesh has a thread with a fix for that

 

--

 

Anyway, I managed to fix lid state detection (now I haz sleep on lid close again) and the Fn+F7 (display off) key combo on my N55SL with 10.8's AppleACPIPlatform.kext by using the RPIN, SPIN and ST87 methods from ASUS' older laptops:

After calling SPUN, make sure to call SPIN to make sure that the ACPI subsystem is in a sane state, as I don't think STC5 cleans up well after itself.

 

Thanks to 68x's battery work, EmlyDinesh's fix for the brightness keys and this lid fix, I now have no reason to use an older AppleACPIPlatform.kext.

 

EDIT: @EmlyDinesh, is it possible to turn off the debug logging in 1.4? I'm still using 1.3 as it doesn't print each Fn key I'm pressing in my dmesg.

 

Do you know which exact DSDT function effects Fn + F7? From the looks of it, it seems to be _Q10, but I am not sure.

Share this post


Link to post
Share on other sites

Do you know which exact DSDT function effects Fn + F7? From the looks of it, it seems to be _Q10, but I am not sure.

 

Yes, it's _Q10. I checked before starting by inserting lots of 'Store ("Method _Q{10, 11, ...}", Debug)' statements into the methods, booting with ACPI debugging on and then hitting the Fn keys to see what methods would be called. This doesn't work with the older AppleACPIPlatform.kext (I wanted to see what values were being returned under a working system) so in that case you can install Linux (I used Arch Linux on an external drive), override the DSDT and enable printing of the writes to Debug in dmesg by running "echo 1 > /sys/module/acpi/parameters/aml_debug_output", just like in OS X.

 

EDIT:

In _Q10, when RPIN fails, IANE is called with an argument of 0x134, which is not recognised by ATKD.

 

When I tried changing the method entirely to just call IANE with 0x34 it still wasn't working. I later found out by accident that nothing happens if the lid state is not set. To initially set the lid state, the DSDT calls on RPIN to retrieve it, which, of course, isn't working.

  • Like 1

Share this post


Link to post
Share on other sites

Even more progress. I got Fn + F2 working for my Zenbook, all you have to do this:

 

The wireless card is stopped at a low level (OSX does not detect any changes).

(Note: I am using an edited kext for this ... I am sure Dinesh would be able to add to the kext).

            Method (WIF1, 0, NotSerialized)
            {
                If (ATKP)
                {
                    OWLD (One)
                    OBTD (One)
                }
            }

            Method (WIF2, 0, NotSerialized)
            {
                If (ATKP)
                {
                    OWLD (Zero)
                    OBTD (Zero)
                }
            }

If you have a light sensor, take a look at the _ALI DSDT method.

 

Also qerty12, thank Dinesh for the battery edits. Please do not thank me for it.

 

Edit:

 

I found a good github project that details the ambient light sensor and how to use it.

 

https://github.com/victorenator/als#readme

 

I am currently debugging the outputs produced by the appropriate DSDT methods.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×