Commit 96bfc13c authored by zino lin's avatar zino lin Committed by Kleber Sacilotto de Souza

platform/x86: asus-wmi: fix asus ux303ub brightness issue

BugLink: https://bugs.launchpad.net/bugs/1854855

[ Upstream commit 999d4376 ]

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: default avatarzino lin <linzino7@gmail.com>
Acked-by: default avatarCorentin Chary <corentin.chary@gmail.com>
Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 3083b2ef
...@@ -116,6 +116,10 @@ static struct quirk_entry quirk_no_rfkill_wapf4 = { ...@@ -116,6 +116,10 @@ static struct quirk_entry quirk_no_rfkill_wapf4 = {
.no_rfkill = true, .no_rfkill = true,
}; };
static struct quirk_entry quirk_asus_ux303ub = {
.wmi_backlight_native = true,
};
static int dmi_matched(const struct dmi_system_id *dmi) static int dmi_matched(const struct dmi_system_id *dmi)
{ {
quirks = dmi->driver_data; quirks = dmi->driver_data;
...@@ -398,6 +402,15 @@ static const struct dmi_system_id asus_quirks[] = { ...@@ -398,6 +402,15 @@ static const struct dmi_system_id asus_quirks[] = {
}, },
.driver_data = &quirk_no_rfkill, .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,
},
{}, {},
}; };
......
...@@ -2091,6 +2091,9 @@ static int asus_wmi_add(struct platform_device *pdev) ...@@ -2091,6 +2091,9 @@ static int asus_wmi_add(struct platform_device *pdev)
if (asus->driver->quirks->wmi_backlight_power) if (asus->driver->quirks->wmi_backlight_power)
acpi_video_set_dmi_backlight_type(acpi_backlight_vendor); 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) { if (acpi_video_get_backlight_type() == acpi_backlight_vendor) {
err = asus_wmi_backlight_init(asus); err = asus_wmi_backlight_init(asus);
if (err && err != -ENODEV) if (err && err != -ENODEV)
......
...@@ -44,6 +44,7 @@ struct quirk_entry { ...@@ -44,6 +44,7 @@ struct quirk_entry {
bool scalar_panel_brightness; bool scalar_panel_brightness;
bool store_backlight_power; bool store_backlight_power;
bool wmi_backlight_power; bool wmi_backlight_power;
bool wmi_backlight_native;
bool wmi_backlight_set_devstate; bool wmi_backlight_set_devstate;
int wapf; int wapf;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment