Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154384
b: refs/heads/master
c: dbfa3ba
h: refs/heads/master
v: v3
  • Loading branch information
Corentin Chary authored and Len Brown committed Jun 26, 2009
1 parent ec7ee99 commit b9f5018
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f36509e7248631671d02f48d1a88f56cdeb54ed8
refs/heads/master: dbfa3ba90dfe353a56e107cff5bce9fb7976f06f
23 changes: 23 additions & 0 deletions trunk/drivers/platform/x86/eeepc-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,28 @@ static int eeepc_setkeycode(struct input_dev *dev, int scancode, int keycode)
return -EINVAL;
}

static void cmsg_quirk(int cm, const char *name)
{
int dummy;

/* Some BIOSes do not report cm although it is avaliable.
Check if cm_getv[cm] works and, if yes, assume cm should be set. */
if (!(ehotk->cm_supported & (1 << cm))
&& !read_acpi_int(ehotk->handle, cm_getv[cm], &dummy)) {
pr_info("%s (%x) not reported by BIOS,"
" enabling anyway\n", name, 1 << cm);
ehotk->cm_supported |= 1 << cm;
}
}

static void cmsg_quirks(void)
{
cmsg_quirk(CM_ASL_LID, "LID");
cmsg_quirk(CM_ASL_TYPE, "TYPE");
cmsg_quirk(CM_ASL_PANELPOWER, "PANELPOWER");
cmsg_quirk(CM_ASL_TPD, "TPD");
}

static int eeepc_hotk_check(void)
{
const struct key_entry *key;
Expand All @@ -576,6 +598,7 @@ static int eeepc_hotk_check(void)
pr_err("Get control methods supported failed\n");
return -ENODEV;
} else {
cmsg_quirks();
pr_info("Get control methods supported: 0x%x\n",
ehotk->cm_supported);
}
Expand Down

0 comments on commit b9f5018

Please sign in to comment.