Skip to contentSkip to conversation

asus-wmi: fix asus ux303ub brightness issue

PATCH In review Zino Lin 3 participants 4 messages Aug 28, 2016 – Sep 9, 2016

Subsystems (2)
lore
Share & tools
lore

Zino Lin

author
#0 lore raw

PATCH 1/1 asus-wmi: fix asus ux303ub brightness issue

From: zino lin <[email protected]>

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.

---
 drivers/platform/x86/asus-nb-wmi.c | 13 +++++++++++++
 drivers/platform/x86/asus-wmi.c    |  3 +++
 drivers/platform/x86/asus-wmi.h    |  1 +
 3 files changed, 17 insertions(+)
drivers/platform/x86/asus-nb-wmi.c +13 -0
index adecc1c..456ad8e 100644
@@ -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,
+	},
 	{},
 };
 
drivers/platform/x86/asus-wmi.c +3 -0
index 7c093a0..ce6ca31 100644
@@ -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)
drivers/platform/x86/asus-wmi.h +1 -0
index 5de1df5..5e22041 100644
@@ -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
Signature · 1 line
2.7.4
#1 lore raw
Quoted 5 lines · Zino Lin

From: zino lin <[email protected]>

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.

Thanks Zino,

+Rafael in case he has an opinion wrt to the acpi_video bit.

Looking for an Ack from Corentin, but otherwise this looks fine to me.

Quoted 69 lines
---
 drivers/platform/x86/asus-nb-wmi.c | 13 +++++++++++++
 drivers/platform/x86/asus-wmi.c    |  3 +++
 drivers/platform/x86/asus-wmi.h    |  1 +
 3 files changed, 17 insertions(+)
drivers/platform/x86/asus-nb-wmi.c +13 -0
index adecc1c..456ad8e 100644
@@ -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,
+	},
 	{},
 };
 
drivers/platform/x86/asus-wmi.c +3 -0
index 7c093a0..ce6ca31 100644
@@ -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)
drivers/platform/x86/asus-wmi.h +1 -0
index 5de1df5..5e22041 100644
@@ -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
Signature · 1 line
2.7.4
Signature · 2 lines
Darren Hart
Intel Open Source Technology Center
maintainer Acked-by
#2 lore raw
Quoted 78 lines · Darren Hart
Quoted 5 lines · Zino Lin

From: zino lin <[email protected]>

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.

Thanks Zino,

+Rafael in case he has an opinion wrt to the acpi_video bit.

Looking for an Ack from Corentin, but otherwise this looks fine to me.

Quoted 65 lines
---
 drivers/platform/x86/asus-nb-wmi.c | 13 +++++++++++++
 drivers/platform/x86/asus-wmi.c    |  3 +++
 drivers/platform/x86/asus-wmi.h    |  1 +
 3 files changed, 17 insertions(+)
drivers/platform/x86/asus-nb-wmi.c +13 -0
index adecc1c..456ad8e 100644
@@ -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,
+     },
      {},
 };
 
drivers/platform/x86/asus-wmi.c +3 -0
index 7c093a0..ce6ca31 100644
@@ -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)
drivers/platform/x86/asus-wmi.h +1 -0
index 5de1df5..5e22041 100644
@@ -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
Quoted 8 lines
Quoted 4 lines

--
2.7.4

--
Darren Hart
Intel Open Source Technology Center

Signature · 2 lines
Corentin Chary
http://xf.iksaif.net
#3 lore raw
Quoted 88 lines · Corentin Chary
Quoted 78 lines · Darren Hart
Quoted 5 lines · Zino Lin

From: zino lin <[email protected]>

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.

Thanks Zino,

+Rafael in case he has an opinion wrt to the acpi_video bit.

Looking for an Ack from Corentin, but otherwise this looks fine to me.

Quoted 65 lines
---
 drivers/platform/x86/asus-nb-wmi.c | 13 +++++++++++++
 drivers/platform/x86/asus-wmi.c    |  3 +++
 drivers/platform/x86/asus-wmi.h    |  1 +
 3 files changed, 17 insertions(+)
drivers/platform/x86/asus-nb-wmi.c +13 -0
index adecc1c..456ad8e 100644
@@ -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,
+     },
      {},
 };
 
drivers/platform/x86/asus-wmi.c +3 -0
index 7c093a0..ce6ca31 100644
@@ -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)
drivers/platform/x86/asus-wmi.h +1 -0
index 5de1df5..5e22041 100644
@@ -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
Quoted 8 lines
Quoted 4 lines

--
2.7.4

--
Darren Hart
Intel Open Source Technology Center

Quoted 1 line

Queued to testing, thanks Zino and Corentin.

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center