Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177549
b: refs/heads/master
c: d89a727
h: refs/heads/master
i:
  177547: 45f9def
v: v3
  • Loading branch information
Henrique de Moraes Holschuh authored and Len Brown committed Dec 16, 2009
1 parent b0ad247 commit 0f1edf4
Show file tree
Hide file tree
Showing 2 changed files with 11 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: 792979c8032b8f5adb77ea986db7082fff04c8e7
refs/heads/master: d89a727aff649f6768f7a34ee57f031ebf8bab4c
14 changes: 10 additions & 4 deletions trunk/drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3186,6 +3186,8 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
int res, i;
int status;
int hkeyv;
bool radiosw_state = false;
bool tabletsw_state = false;

unsigned long quirks;

Expand Down Expand Up @@ -3291,13 +3293,15 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
if (dbg_wlswemul) {
tp_features.hotkey_wlsw = 1;
radiosw_state = !!tpacpi_wlsw_emulstate;
printk(TPACPI_INFO
"radio switch emulation enabled\n");
} else
#endif
/* Not all thinkpads have a hardware radio switch */
if (acpi_evalf(hkey_handle, &status, "WLSW", "qd")) {
tp_features.hotkey_wlsw = 1;
radiosw_state = !!status;
printk(TPACPI_INFO
"radio switch found; radios are %s\n",
enabled(status, 0));
Expand All @@ -3309,11 +3313,11 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
/* For X41t, X60t, X61t Tablets... */
if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) {
tp_features.hotkey_tablet = 1;
tabletsw_state = !!(status & TP_HOTKEY_TABLET_MASK);
printk(TPACPI_INFO
"possible tablet mode switch found; "
"ThinkPad in %s mode\n",
(status & TP_HOTKEY_TABLET_MASK)?
"tablet" : "laptop");
(tabletsw_state) ? "tablet" : "laptop");
res = add_to_attr_set(hotkey_dev_attributes,
&dev_attr_hotkey_tablet_mode.attr);
}
Expand Down Expand Up @@ -3364,9 +3368,13 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)

if (tp_features.hotkey_wlsw) {
input_set_capability(tpacpi_inputdev, EV_SW, SW_RFKILL_ALL);
input_report_switch(tpacpi_inputdev,
SW_RFKILL_ALL, radiosw_state);
}
if (tp_features.hotkey_tablet) {
input_set_capability(tpacpi_inputdev, EV_SW, SW_TABLET_MODE);
input_report_switch(tpacpi_inputdev,
SW_TABLET_MODE, tabletsw_state);
}

/* Do not issue duplicate brightness change events to
Expand Down Expand Up @@ -3433,8 +3441,6 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
tpacpi_inputdev->close = &hotkey_inputdev_close;

hotkey_poll_setup_safe(true);
tpacpi_send_radiosw_update();
tpacpi_input_send_tabletsw();

return 0;

Expand Down

0 comments on commit 0f1edf4

Please sign in to comment.