]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
platform/x86: asus-wmi: fix asus ux303ub brightness issue
authorzino lin <linzino7@gmail.com>
Sun, 28 Aug 2016 08:12:06 +0000 (16:12 +0800)
committerDarren Hart <dvhart@linux.intel.com>
Fri, 23 Sep 2016 23:20:34 +0000 (16:20 -0700)
acpi_video0 doesn't work, asus-wmi brightness interface doesn't work, too.
So, we use native brightness interface to handle the brightness adjustion,
and add quirk_asus_ux303ub.

Signed-off-by: zino lin <linzino7@gmail.com>
Acked-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
drivers/platform/x86/asus-nb-wmi.c
drivers/platform/x86/asus-wmi.c
drivers/platform/x86/asus-wmi.h

index adecc1c555f02a8b18eadca62c0e6eb5e7796b38..f4a60e75cd8a72a5b54a0296eea9d0d4b38bec60 100644 (file)
@@ -87,6 +87,10 @@ static struct quirk_entry quirk_no_rfkill_wapf4 = {
        .no_rfkill = true,
 };
 
+static struct quirk_entry quirk_asus_ux303ub = {
+       .wmi_backlight_native = true,
+};
+
 static int dmi_matched(const struct dmi_system_id *dmi)
 {
        quirks = dmi->driver_data;
@@ -351,6 +355,15 @@ static const struct dmi_system_id asus_quirks[] = {
                },
                .driver_data = &quirk_no_rfkill,
        },
+       {
+               .callback = dmi_matched,
+               .ident = "ASUSTeK COMPUTER INC. UX303UB",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "UX303UB"),
+               },
+               .driver_data = &quirk_asus_ux303ub,
+       },
        {},
 };
 
index 7c093a0b78bb995f687a47329011a40c7ff2a9f4..ce6ca31a2d09a207c1e80c157427aa3960079b73 100644 (file)
@@ -2084,6 +2084,9 @@ static int asus_wmi_add(struct platform_device *pdev)
        if (asus->driver->quirks->wmi_backlight_power)
                acpi_video_set_dmi_backlight_type(acpi_backlight_vendor);
 
+       if (asus->driver->quirks->wmi_backlight_native)
+               acpi_video_set_dmi_backlight_type(acpi_backlight_native);
+
        if (acpi_video_get_backlight_type() == acpi_backlight_vendor) {
                err = asus_wmi_backlight_init(asus);
                if (err && err != -ENODEV)
index 5de1df510ebd8c3ed39db046e70daf5155a4a7ce..5e220411056de215c5fbd5bad7581aeb54168287 100644 (file)
@@ -43,6 +43,7 @@ struct quirk_entry {
        bool scalar_panel_brightness;
        bool store_backlight_power;
        bool wmi_backlight_power;
+       bool wmi_backlight_native;
        int wapf;
        /*
         * For machines with AMD graphic chips, it will send out WMI event