# Patch by EMlyDinEsH (OSXLatitude) # Patch for Asus Ambient Light Sensor device to work with my AsusNBFnKeys driver # Modifying method RALS of ALS device # to work with keyboard backlight and report its value to my driver into Method label RALS replace_content begin If (ALAE)\n {\n Store (RRAM (0x02A3), Local0)\n Store (RRAM (0x02A4), Local1)\n ShiftLeft (Local0, 0x08, Local0)\n Add (Local0, Local1, Local0)\n Multiply (Local0, 0x03E8, Local1)\n Divide (Local1, ALSA, Local2, Local3)\n }\n Else\n {\n Return (0x012C)\n }\n If (LLessEqual (Local3, 0x3C))\n {\n ^^^^ATKD.SKBL (0x03)\n Store (One, Local4)\n }\n Else\n {\n If (LLessEqual (Local3, 0x82))\n {\n ^^^^ATKD.SKBL (0x02)\n Store (0x02, Local4)\n }\n Else\n {\n If (LLessEqual (Local3, 0xFF))\n {\n ^^^^ATKD.SKBL (One)\n Store (0x03, Local4)\n }\n Else\n {\n ^^^^ATKD.SKBL (Zero)\n Store (0x04, Local4)\n }\n }\n }\n Return (Local4)\n end; # Modifying ALS notifier methods _QDD and _QCD methods to notify event into Method label _QDD replace_content begin Notify (ALS, 0x80)\n If (ATKP)\n {\n ^^^^ATKD.IANE (0xC6)\n } end; into Method label _QCD replace_content begin Notify (ALS, 0x80)\n If (ATKP)\n {\n ^^^^ATKD.IANE (0xC7)\n } end; # Inserting method ALSS into ATKD # for reading ambient illuminance values from my AsusNBFnKeys driver into method label ALSS parent_label ATKD remove_entry; into device label ATKD insert begin Method (ALSS, 0, NotSerialized)\n {\n Return (^^PCI0.LPCB.EC0.RALS ())\n } end;