All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: asus-wmi: try to set als by default
@ 2017-04-21 15:24 Oleksij Rempel
  2017-04-21 19:06 ` Andy Shevchenko
  0 siblings, 1 reply; 9+ messages in thread
From: Oleksij Rempel @ 2017-04-21 15:24 UTC (permalink / raw)
  To: dvhart, corentin.chary, acpi4asus-user, platform-driver-x86
  Cc: Oleksij Rempel

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))
                    }

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: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/platform/x86/asus-wmi.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 8fe5890bf539..6b3aef40431c 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1109,6 +1109,15 @@ static void asus_wmi_set_xusb2pr(struct asus_wmi *asus)
 }
 
 /*
+ * Some devices dont support or have borcken get_als method
+ * but still support set method.
+ */
+static void asus_wmi_set_als(void)
+{
+	asus_wmi_set_devstate(ASUS_WMI_DEVID_ALS_ENABLE, 1, NULL);
+}
+
+/*
  * Hwmon device
  */
 static int asus_hwmon_agfn_fan_speed_read(struct asus_wmi *asus, int fan,
@@ -2117,6 +2126,8 @@ static int asus_wmi_add(struct platform_device *pdev)
 			goto fail_rfkill;
 	}
 
+	asus_wmi_set_als();
+
 	/* Some Asus desktop boards export an acpi-video backlight interface,
 	   stop this from showing up */
 	chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: asus-wmi: try to set als by default
  2017-04-21 15:24 [PATCH] platform/x86: asus-wmi: try to set als by default Oleksij Rempel
@ 2017-04-21 19:06 ` Andy Shevchenko
  2017-04-22  6:14   ` Oleksij Rempel
  2017-04-22  6:55   ` Oleksij Rempel
  0 siblings, 2 replies; 9+ messages in thread
From: Andy Shevchenko @ 2017-04-21 19:06 UTC (permalink / raw)
  To: Oleksij Rempel; +Cc: dvhart, Corentin Chary, acpi4asus-user, Platform Driver

On Fri, Apr 21, 2017 at 6:24 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
> some laptops, for example ASUS UX330UAK, have brocken als_get function
> but working als_set funktion. In this case, ALS will stay turned off.

Please, spell check the above.

some -> Some
brocken -> broken
funktion -> function

>
>              Method (WMNB, 3, Serialized)
>             {
>             ...
>                If (Local0 == 0x53545344)
>                 {
>                 ...
>                     If (IIA0 == 0x00050001)
>                     {
>                         If (!ALSP)
>                         {
>                             Return (0x02)
>                         }
>
>                         Local0 = (GALS & 0x10)    <<<---- bug,
>                                                     should be: (GALS () & 0x10)

How GALS is defined in ASL?

> 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.

It would be good to see if there is no regression added.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: asus-wmi: try to set als by default
  2017-04-21 19:06 ` Andy Shevchenko
@ 2017-04-22  6:14   ` Oleksij Rempel
  2017-04-22  6:55   ` Oleksij Rempel
  1 sibling, 0 replies; 9+ messages in thread
From: Oleksij Rempel @ 2017-04-22  6:14 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: dvhart, Corentin Chary, acpi4asus-user, Platform Driver


[-- Attachment #1.1: Type: text/plain, Size: 3091 bytes --]

Am 21.04.2017 um 21:06 schrieb Andy Shevchenko:
> On Fri, Apr 21, 2017 at 6:24 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
>> some laptops, for example ASUS UX330UAK, have brocken als_get function
>> but working als_set funktion. In this case, ALS will stay turned off.
> 
> Please, spell check the above.
> 
> some -> Some
> brocken -> broken
> funktion -> function

ok. thank you.

>>
>>              Method (WMNB, 3, Serialized)
>>             {
>>             ...
>>                If (Local0 == 0x53545344)
>>                 {
>>                 ...
>>                     If (IIA0 == 0x00050001)
>>                     {
>>                         If (!ALSP)
>>                         {
>>                             Return (0x02)
>>                         }
>>
>>                         Local0 = (GALS & 0x10)    <<<---- bug,
>>                                                     should be: (GALS () & 0x10)
> 
> How GALS is defined in ASL?

                    Method (GALS, 0, NotSerialized)
                    {
                        Local0 = Zero
                        Local0 |= 0x20
                        If (ALAE)
                        {
                            Local0 |= 0x10
                        }

                        Local1 = 0x0A
                        Local1 <<= 0x08
                        Local0 |= Local1
                        Return (Local0)
                    }


beside, same part of code on ASUS UX32A, which works just fine:

                    If ((IIA0 == 0x00050001))
                    {
                        If (!ALSP)
                        {
                            Return (0x02)
                        }

                        Local0 = (GALS () & 0x10)
                        If (Local0)
                        {
                            Return (0x00050001)
                        }
                        Else
                        {
                            Return (0x00050000)
                        }
                    }

                    If ((IIA0 == 0x00050013))
                    {
                        Local0 = (GALS () & 0x0F0F)
                        Return (Local0)
                    }

....
            Method (GALS, 0, NotSerialized)
            {
                Local0 = (LBTN & 0x0F)
                Local0 |= 0x20
                If (ALAE)
                {
                    Local0 |= 0x10
                }

                Local1 = (0x0B - One)
                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.
> 
> It would be good to see if there is no regression added.

sure. Is there anything i can do for this, except continue to use this
patch with my HW?

-- 
Regards,
Oleksij


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: asus-wmi: try to set als by default
  2017-04-21 19:06 ` Andy Shevchenko
  2017-04-22  6:14   ` Oleksij Rempel
@ 2017-04-22  6:55   ` Oleksij Rempel
  2017-04-25 12:25     ` Andy Shevchenko
  1 sibling, 1 reply; 9+ messages in thread
From: Oleksij Rempel @ 2017-04-22  6:55 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: dvhart, Corentin Chary, acpi4asus-user, Platform Driver


[-- Attachment #1.1: Type: text/plain, Size: 1400 bytes --]

Am 21.04.2017 um 21:06 schrieb Andy Shevchenko:
> On Fri, Apr 21, 2017 at 6:24 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
>> some laptops, for example ASUS UX330UAK, have brocken als_get function
>> but working als_set funktion. In this case, ALS will stay turned off.
> 
> Please, spell check the above.
> 
> some -> Some
> brocken -> broken
> funktion -> function
> 
>>
>>              Method (WMNB, 3, Serialized)
>>             {
>>             ...
>>                If (Local0 == 0x53545344)
>>                 {
>>                 ...
>>                     If (IIA0 == 0x00050001)
>>                     {
>>                         If (!ALSP)
>>                         {
>>                             Return (0x02)
>>                         }
>>
>>                         Local0 = (GALS & 0x10)    <<<---- bug,
>>                                                     should be: (GALS () & 0x10)
> 
> How GALS is defined in ASL?
> 
>> 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.
> 
> It would be good to see if there is no regression added.

I just send this email to ASUS support, may be some thing will happen:
https://pastebin.com/TLjbbNMc

-- 
Regards,
Oleksij


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: asus-wmi: try to set als by default
  2017-04-22  6:55   ` Oleksij Rempel
@ 2017-04-25 12:25     ` Andy Shevchenko
  2017-04-25 18:42       ` Oleksij Rempel
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2017-04-25 12:25 UTC (permalink / raw)
  To: Oleksij Rempel; +Cc: dvhart, Corentin Chary, acpi4asus-user, Platform Driver

On Sat, Apr 22, 2017 at 9:55 AM, Oleksij Rempel <linux@rempel-privat.de> wrote:
> Am 21.04.2017 um 21:06 schrieb Andy Shevchenko:
>> On Fri, Apr 21, 2017 at 6:24 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
>>> some laptops, for example ASUS UX330UAK, have brocken als_get function
>>> but working als_set funktion. In this case, ALS will stay turned off.

>>> This patch will do the same. Turn ALS on by default.
>>
>> It would be good to see if there is no regression added.
>
> I just send this email to ASUS support, may be some thing will happen:
> https://pastebin.com/TLjbbNMc

Okay, let's wait a bit and if there no answer submit v2 based on review.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: asus-wmi: try to set als by default
  2017-04-25 12:25     ` Andy Shevchenko
@ 2017-04-25 18:42       ` Oleksij Rempel
  2017-04-25 19:26         ` Andy Shevchenko
  0 siblings, 1 reply; 9+ messages in thread
From: Oleksij Rempel @ 2017-04-25 18:42 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: dvhart, Corentin Chary, acpi4asus-user, Platform Driver


[-- Attachment #1.1: Type: text/plain, Size: 882 bytes --]

Am 25.04.2017 um 14:25 schrieb Andy Shevchenko:
> On Sat, Apr 22, 2017 at 9:55 AM, Oleksij Rempel <linux@rempel-privat.de> wrote:
>> Am 21.04.2017 um 21:06 schrieb Andy Shevchenko:
>>> On Fri, Apr 21, 2017 at 6:24 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
>>>> some laptops, for example ASUS UX330UAK, have brocken als_get function
>>>> but working als_set funktion. In this case, ALS will stay turned off.
> 
>>>> This patch will do the same. Turn ALS on by default.
>>>
>>> It would be good to see if there is no regression added.
>>
>> I just send this email to ASUS support, may be some thing will happen:
>> https://pastebin.com/TLjbbNMc
> 
> Okay, let's wait a bit and if there no answer submit v2 based on review.

Oh well, the answer is like usual. We support Windows 10, make shit and
bla bla...

I'll send v2 ASAP.

-- 
Regards,
Oleksij


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: asus-wmi: try to set als by default
  2017-04-25 18:42       ` Oleksij Rempel
@ 2017-04-25 19:26         ` Andy Shevchenko
  2017-04-28 14:19           ` Oleksij Rempel
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2017-04-25 19:26 UTC (permalink / raw)
  To: Oleksij Rempel; +Cc: dvhart, Corentin Chary, acpi4asus-user, Platform Driver

On Tue, Apr 25, 2017 at 9:42 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
> Am 25.04.2017 um 14:25 schrieb Andy Shevchenko:
>> On Sat, Apr 22, 2017 at 9:55 AM, Oleksij Rempel <linux@rempel-privat.de> wrote:
>>> Am 21.04.2017 um 21:06 schrieb Andy Shevchenko:
>>>> On Fri, Apr 21, 2017 at 6:24 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
>>>>> some laptops, for example ASUS UX330UAK, have brocken als_get function
>>>>> but working als_set funktion. In this case, ALS will stay turned off.
>>
>>>>> This patch will do the same. Turn ALS on by default.
>>>>
>>>> It would be good to see if there is no regression added.
>>>
>>> I just send this email to ASUS support, may be some thing will happen:
>>> https://pastebin.com/TLjbbNMc
>>
>> Okay, let's wait a bit and if there no answer submit v2 based on review.
>
> Oh well, the answer is like usual. We support Windows 10, make shit and
> bla bla...

I see.

> I'll send v2 ASAP.

One more comment. I think it would be better to make it as a quirk and
call only on certain platforms (based by DMI / etc).

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] platform/x86: asus-wmi: try to set als by default
  2017-04-25 19:26         ` Andy Shevchenko
@ 2017-04-28 14:19           ` Oleksij Rempel
  2017-04-30 12:50             ` Andy Shevchenko
  0 siblings, 1 reply; 9+ messages in thread
From: Oleksij Rempel @ 2017-04-28 14:19 UTC (permalink / raw)
  To: dvhart, corentin.chary, acpi4asus-user, platform-driver-x86
  Cc: Oleksij Rempel

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: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/platform/x86/asus-nb-wmi.c | 13 +++++++++++++
 drivers/platform/x86/asus-wmi.c    | 12 ++++++++++++
 drivers/platform/x86/asus-wmi.h    |  1 +
 3 files changed, 26 insertions(+)

diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
index dea98ffb6f60..e030a8d470a4 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -111,6 +111,10 @@ static struct quirk_entry quirk_asus_x550lb = {
 	.xusb2pr = 0x01D9,
 };
 
+static struct quirk_entry quirk_asus_ux330uak = {
+	.wmi_force_als_set = true,
+};
+
 static int dmi_matched(const struct dmi_system_id *dmi)
 {
 	pr_info("Identified laptop model '%s'\n", dmi->ident);
@@ -369,6 +373,15 @@ static const struct dmi_system_id asus_quirks[] = {
 	},
 	{
 		.callback = dmi_matched,
+		.ident = "ASUSTeK COMPUTER INC. UX330UAK",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "UX330UAK"),
+		},
+		.driver_data = &quirk_asus_ux330uak,
+	},
+	{
+		.callback = dmi_matched,
 		.ident = "ASUSTeK COMPUTER INC. X550LB",
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 8fe5890bf539..9d3dac30cb08 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1109,6 +1109,15 @@ static void asus_wmi_set_xusb2pr(struct asus_wmi *asus)
 }
 
 /*
+ * Some devices dont support or have borcken get_als method
+ * but still support set method.
+ */
+static void asus_wmi_set_als(void)
+{
+	asus_wmi_set_devstate(ASUS_WMI_DEVID_ALS_ENABLE, 1, NULL);
+}
+
+/*
  * Hwmon device
  */
 static int asus_hwmon_agfn_fan_speed_read(struct asus_wmi *asus, int fan,
@@ -2117,6 +2126,9 @@ static int asus_wmi_add(struct platform_device *pdev)
 			goto fail_rfkill;
 	}
 
+	if (asus->driver->quirks->wmi_force_als_set)
+		asus_wmi_set_als();
+
 	/* Some Asus desktop boards export an acpi-video backlight interface,
 	   stop this from showing up */
 	chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
index c9589d9342bb..6c1311f4b04d 100644
--- a/drivers/platform/x86/asus-wmi.h
+++ b/drivers/platform/x86/asus-wmi.h
@@ -44,6 +44,7 @@ struct quirk_entry {
 	bool store_backlight_power;
 	bool wmi_backlight_power;
 	bool wmi_backlight_native;
+	bool wmi_force_als_set;
 	int wapf;
 	/*
 	 * For machines with AMD graphic chips, it will send out WMI event
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] platform/x86: asus-wmi: try to set als by default
  2017-04-28 14:19           ` Oleksij Rempel
@ 2017-04-30 12:50             ` Andy Shevchenko
  0 siblings, 0 replies; 9+ messages in thread
From: Andy Shevchenko @ 2017-04-30 12:50 UTC (permalink / raw)
  To: Oleksij Rempel; +Cc: dvhart, Corentin Chary, acpi4asus-user, Platform Driver

On Fri, Apr 28, 2017 at 5:19 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
> 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: Oleksij Rempel <linux@rempel-privat.de>

Pushed to testing, thanks.

> ---
>  drivers/platform/x86/asus-nb-wmi.c | 13 +++++++++++++
>  drivers/platform/x86/asus-wmi.c    | 12 ++++++++++++
>  drivers/platform/x86/asus-wmi.h    |  1 +
>  3 files changed, 26 insertions(+)
>
> diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
> index dea98ffb6f60..e030a8d470a4 100644
> --- a/drivers/platform/x86/asus-nb-wmi.c
> +++ b/drivers/platform/x86/asus-nb-wmi.c
> @@ -111,6 +111,10 @@ static struct quirk_entry quirk_asus_x550lb = {
>         .xusb2pr = 0x01D9,
>  };
>
> +static struct quirk_entry quirk_asus_ux330uak = {
> +       .wmi_force_als_set = true,
> +};
> +
>  static int dmi_matched(const struct dmi_system_id *dmi)
>  {
>         pr_info("Identified laptop model '%s'\n", dmi->ident);
> @@ -369,6 +373,15 @@ static const struct dmi_system_id asus_quirks[] = {
>         },
>         {
>                 .callback = dmi_matched,
> +               .ident = "ASUSTeK COMPUTER INC. UX330UAK",
> +               .matches = {
> +                       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> +                       DMI_MATCH(DMI_PRODUCT_NAME, "UX330UAK"),
> +               },
> +               .driver_data = &quirk_asus_ux330uak,
> +       },
> +       {
> +               .callback = dmi_matched,
>                 .ident = "ASUSTeK COMPUTER INC. X550LB",
>                 .matches = {
>                         DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index 8fe5890bf539..9d3dac30cb08 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -1109,6 +1109,15 @@ static void asus_wmi_set_xusb2pr(struct asus_wmi *asus)
>  }
>
>  /*
> + * Some devices dont support or have borcken get_als method
> + * but still support set method.
> + */
> +static void asus_wmi_set_als(void)
> +{
> +       asus_wmi_set_devstate(ASUS_WMI_DEVID_ALS_ENABLE, 1, NULL);
> +}
> +
> +/*
>   * Hwmon device
>   */
>  static int asus_hwmon_agfn_fan_speed_read(struct asus_wmi *asus, int fan,
> @@ -2117,6 +2126,9 @@ static int asus_wmi_add(struct platform_device *pdev)
>                         goto fail_rfkill;
>         }
>
> +       if (asus->driver->quirks->wmi_force_als_set)
> +               asus_wmi_set_als();
> +
>         /* Some Asus desktop boards export an acpi-video backlight interface,
>            stop this from showing up */
>         chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
> diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
> index c9589d9342bb..6c1311f4b04d 100644
> --- a/drivers/platform/x86/asus-wmi.h
> +++ b/drivers/platform/x86/asus-wmi.h
> @@ -44,6 +44,7 @@ struct quirk_entry {
>         bool store_backlight_power;
>         bool wmi_backlight_power;
>         bool wmi_backlight_native;
> +       bool wmi_force_als_set;
>         int wapf;
>         /*
>          * For machines with AMD graphic chips, it will send out WMI event
> --
> 2.11.0
>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-04-30 12:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-21 15:24 [PATCH] platform/x86: asus-wmi: try to set als by default Oleksij Rempel
2017-04-21 19:06 ` Andy Shevchenko
2017-04-22  6:14   ` Oleksij Rempel
2017-04-22  6:55   ` Oleksij Rempel
2017-04-25 12:25     ` Andy Shevchenko
2017-04-25 18:42       ` Oleksij Rempel
2017-04-25 19:26         ` Andy Shevchenko
2017-04-28 14:19           ` Oleksij Rempel
2017-04-30 12:50             ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.