Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84070
b: refs/heads/master
c: b7c8c20
h: refs/heads/master
v: v3
  • Loading branch information
Henrique de Moraes Holschuh authored and Len Brown committed Feb 2, 2008
1 parent 480179f commit fc4583e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 41 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: b2c985e7eba858a1765db6d56bdd4df775f53633
refs/heads/master: b7c8c200bfbf523ea0a72fd8a5e39089c74da371
82 changes: 42 additions & 40 deletions trunk/drivers/misc/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,46 @@ static int hotkey_status_set(int status)
return 0;
}

static void tpacpi_input_send_radiosw(void)
{
int wlsw;

mutex_lock(&tpacpi_inputdev_send_mutex);

if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&wlsw)) {
input_report_switch(tpacpi_inputdev,
SW_RADIO, !!wlsw);
input_sync(tpacpi_inputdev);
}

mutex_unlock(&tpacpi_inputdev_send_mutex);
}

static void tpacpi_input_send_key(unsigned int scancode)
{
unsigned int keycode;

keycode = hotkey_keycode_map[scancode];

if (keycode != KEY_RESERVED) {
mutex_lock(&tpacpi_inputdev_send_mutex);

input_report_key(tpacpi_inputdev, keycode, 1);
if (keycode == KEY_UNKNOWN)
input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN,
scancode);
input_sync(tpacpi_inputdev);

input_report_key(tpacpi_inputdev, keycode, 0);
if (keycode == KEY_UNKNOWN)
input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN,
scancode);
input_sync(tpacpi_inputdev);

mutex_unlock(&tpacpi_inputdev_send_mutex);
}
}

/* sysfs hotkey enable ------------------------------------------------- */
static ssize_t hotkey_enable_show(struct device *dev,
struct device_attribute *attr,
Expand Down Expand Up @@ -1290,47 +1330,10 @@ static void hotkey_exit(void)
}
}

static void tpacpi_input_send_key(unsigned int scancode,
unsigned int keycode)
{
if (keycode != KEY_RESERVED) {
mutex_lock(&tpacpi_inputdev_send_mutex);

input_report_key(tpacpi_inputdev, keycode, 1);
if (keycode == KEY_UNKNOWN)
input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN,
scancode);
input_sync(tpacpi_inputdev);

input_report_key(tpacpi_inputdev, keycode, 0);
if (keycode == KEY_UNKNOWN)
input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN,
scancode);
input_sync(tpacpi_inputdev);

mutex_unlock(&tpacpi_inputdev_send_mutex);
}
}

static void tpacpi_input_send_radiosw(void)
{
int wlsw;

mutex_lock(&tpacpi_inputdev_send_mutex);

if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&wlsw)) {
input_report_switch(tpacpi_inputdev,
SW_RADIO, !!wlsw);
input_sync(tpacpi_inputdev);
}

mutex_unlock(&tpacpi_inputdev_send_mutex);
}

static void hotkey_notify(struct ibm_struct *ibm, u32 event)
{
u32 hkey;
unsigned int keycode, scancode;
unsigned int scancode;
int send_acpi_ev;
int ignore_acpi_ev;

Expand Down Expand Up @@ -1363,8 +1366,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
scancode = hkey & 0xfff;
if (scancode > 0 && scancode < 0x21) {
scancode--;
keycode = hotkey_keycode_map[scancode];
tpacpi_input_send_key(scancode, keycode);
tpacpi_input_send_key(scancode);
} else {
printk(IBM_ERR
"hotkey 0x%04x out of range for keyboard map\n",
Expand Down

0 comments on commit fc4583e

Please sign in to comment.