• Oleksij Rempel's avatar
    platform/x86: asus-wmi: try to set als by default · e9b61518
    Oleksij Rempel authored
    some laptops, for example ASUS UX330UAK, have brocken als_get function
    but working als_set funktion. In this case, ALS will stay turned off.
    
                 Method (WMNB, 3, Serialized)
                {
    	    ...
                   If (Local0 == 0x53545344)
                    {
    		...
                        If (IIA0 == 0x00050001)
                        {
                            If (!ALSP)
                            {
                                Return (0x02)
                            }
    
                            Local0 = (GALS & 0x10)    <<<---- bug,
                                                        should be: (GALS () & 0x10)
                            If (Local0)
                            {
                                Return (0x00050001)
                            }
                            Else
                            {
                                Return (0x00050000)
                            }
                        }
    
                 .....
                    If (Local0 == 0x53564544)
                    {
    		...
                        If (IIA0 == 0x00050001)
                        {
                            Return (ALSC (IIA1))
                        }
    
                      ......
                        Method (GALS, 0, NotSerialized)
                        {
                            Local0 = Zero
                            Local0 |= 0x20
                            If (ALAE)
                            {
                                Local0 |= 0x10
                            }
    
                            Local1 = 0x0A
                            Local1 <<= 0x08
                            Local0 |= Local1
                            Return (Local0)
                        }
    
    Since it works without problems on Windows I assume ASUS WMI driver for Win
    never trying to get ALS state, and instead it is setting it by default to ON.
    
    This patch will do the same. Turn ALS on by default.
    Signed-off-by: default avatarOleksij Rempel <linux@rempel-privat.de>
    Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
    e9b61518
asus-nb-wmi.c 14.4 KB