Skip to content

Commit

Permalink
asus-wmi: control backlight power through WMI, not ACPI
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/1000146

Some h/w that can adjust screen brightness through ACPI functions, but
can't turn on/off the backlight power correctly. So, we list those h/w in
quirks and try to turn on/off the backlight power through WMI.
Signed-off-by: AceLan Kao <[email protected]>
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
  • Loading branch information
acelan authored and Matthew Garrett committed Jul 28, 2012
1 parent e052067 commit 272c77d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
9 changes: 9 additions & 0 deletions drivers/platform/x86/asus-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
#include <linux/thermal.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#ifdef CONFIG_ACPI_VIDEO
#include <acpi/video.h>
#endif

#include "asus-wmi.h"

Expand Down Expand Up @@ -1676,7 +1679,13 @@ static int asus_wmi_add(struct platform_device *pdev)
if (err)
goto fail_rfkill;

if (asus->driver->quirks->wmi_backlight_power)
acpi_video_dmi_promote_vendor();
if (!acpi_video_backlight_support()) {
#ifdef CONFIG_ACPI_VIDEO
pr_info("Disabling ACPI video driver\n");
acpi_video_unregister();
#endif
err = asus_wmi_backlight_init(asus);
if (err && err != -ENODEV)
goto fail_backlight;
Expand Down
1 change: 1 addition & 0 deletions drivers/platform/x86/asus-wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ struct quirk_entry {
bool hotplug_wireless;
bool scalar_panel_brightness;
bool store_backlight_power;
bool wmi_backlight_power;
int wapf;
};

Expand Down
25 changes: 24 additions & 1 deletion drivers/platform/x86/eeepc-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static const struct key_entry eeepc_wmi_keymap[] = {
{ KE_KEY, 0xe1, { KEY_F14 } }, /* Change Resolution */
{ KE_KEY, HOME_PRESS, { KEY_CONFIG } }, /* Home/Express gate key */
{ KE_KEY, 0xe8, { KEY_SCREENLOCK } },
{ KE_KEY, 0xe9, { KEY_BRIGHTNESS_ZERO } },
{ KE_KEY, 0xe9, { KEY_DISPLAYTOGGLE } },
{ KE_KEY, 0xeb, { KEY_CAMERA_ZOOMOUT } },
{ KE_KEY, 0xec, { KEY_CAMERA_UP } },
{ KE_KEY, 0xed, { KEY_CAMERA_DOWN } },
Expand Down Expand Up @@ -107,6 +107,11 @@ static struct quirk_entry quirk_asus_et2012_type3 = {
.store_backlight_power = true,
};

static struct quirk_entry quirk_asus_x101ch = {
/* We need this when ACPI function doesn't do this well */
.wmi_backlight_power = true,
};

static struct quirk_entry *quirks;

static void et2012_quirks(void)
Expand Down Expand Up @@ -157,6 +162,24 @@ static struct dmi_system_id asus_quirks[] = {
},
.driver_data = &quirk_asus_unknown,
},
{
.callback = dmi_matched,
.ident = "ASUSTeK Computer INC. X101CH",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X101CH"),
},
.driver_data = &quirk_asus_x101ch,
},
{
.callback = dmi_matched,
.ident = "ASUSTeK Computer INC. 1015CX",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "1015CX"),
},
.driver_data = &quirk_asus_x101ch,
},
{},
};

Expand Down

0 comments on commit 272c77d

Please sign in to comment.