Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360545
b: refs/heads/master
c: a2a96f0
h: refs/heads/master
i:
  360543: 0a102a1
v: v3
  • Loading branch information
AceLan Kao authored and Matthew Garrett committed Feb 24, 2013
1 parent efdc685 commit 28c2ace
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3da4cd2015630f50d8d80c6ff5089d3daa2306c6
refs/heads/master: a2a96f0c7221806c8a8072b662e6deaa119833da
31 changes: 30 additions & 1 deletion trunk/drivers/platform/x86/asus-nb-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ static struct quirk_entry quirk_asus_unknown = {
.wapf = 0,
};

/*
* For those machines that need software to control bt/wifi status
* and can't adjust brightness through ACPI interface
* and have duplicate events(ACPI and WMI) for display toggle
*/
static struct quirk_entry quirk_asus_x55u = {
.wapf = 4,
.wmi_backlight_power = true,
.no_display_toggle = true,
};

static struct quirk_entry quirk_asus_x401u = {
.wapf = 4,
};
Expand All @@ -77,6 +88,15 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X401U"),
},
.driver_data = &quirk_asus_x55u,
},
{
.callback = dmi_matched,
.ident = "ASUSTeK COMPUTER INC. X401A",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X401A"),
},
.driver_data = &quirk_asus_x401u,
},
{
Expand All @@ -95,6 +115,15 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X501U"),
},
.driver_data = &quirk_asus_x55u,
},
{
.callback = dmi_matched,
.ident = "ASUSTeK COMPUTER INC. X501A",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X501A"),
},
.driver_data = &quirk_asus_x401u,
},
{
Expand Down Expand Up @@ -131,7 +160,7 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X55U"),
},
.driver_data = &quirk_asus_x401u,
.driver_data = &quirk_asus_x55u,
},
{
.callback = dmi_matched,
Expand Down
31 changes: 28 additions & 3 deletions trunk/drivers/platform/x86/asus-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,23 @@ static void asus_wmi_backlight_exit(struct asus_wmi *asus)
asus->backlight_device = NULL;
}

static int is_display_toggle(int code)
{
/* display toggle keys */
if ((code >= 0x61 && code <= 0x67) ||
(code >= 0x8c && code <= 0x93) ||
(code >= 0xa0 && code <= 0xa7) ||
(code >= 0xd0 && code <= 0xd5))
return 1;

return 0;
}

static void do_nothing(void)
{
return;
}

static void asus_wmi_notify(u32 value, void *context)
{
struct asus_wmi *asus = context;
Expand Down Expand Up @@ -1380,10 +1397,18 @@ static void asus_wmi_notify(u32 value, void *context)
code = NOTIFY_BRNDOWN_MIN;

if (code == NOTIFY_BRNUP_MIN || code == NOTIFY_BRNDOWN_MIN) {
if (!acpi_video_backlight_support())
if (!acpi_video_backlight_support()) {
asus_wmi_backlight_notify(asus, orig_code);
} else if (!sparse_keymap_report_event(asus->inputdev, code,
key_value, autorelease))
}
goto exit;
}

if (is_display_toggle(code) &&
asus->driver->quirks->no_display_toggle)
goto exit;

if (!sparse_keymap_report_event(asus->inputdev, code,
key_value, autorelease))
pr_info("Unknown key %x pressed\n", code);

exit:
Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/platform/x86/asus-wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ struct quirk_entry {
bool store_backlight_power;
bool wmi_backlight_power;
int wapf;
/*
* For machines with AMD graphic chips, it will send out WMI event
* and ACPI interrupt at the same time while hitting the hotkey.
* To simplify the problem, we just have to ignore the WMI event,
* and let the ACPI interrupt to send out the key event.
*/
int no_display_toggle;
};

struct asus_wmi_driver {
Expand Down

0 comments on commit 28c2ace

Please sign in to comment.