Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71612
b: refs/heads/master
c: 8523ed6
h: refs/heads/master
v: v3
  • Loading branch information
Henrique de Moraes Holschuh authored and Len Brown committed Sep 24, 2007
1 parent e786689 commit 48b06f0
Show file tree
Hide file tree
Showing 2 changed files with 11 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: f4e1e43c607b5ead89b2135c348392810420de69
refs/heads/master: 8523ed6fb2ca04973fe759fda8ab4af72492fc7e
10 changes: 10 additions & 0 deletions trunk/drivers/misc/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ static char *next_cmd(char **cmds)
static struct platform_device *tpacpi_pdev;
static struct class_device *tpacpi_hwmon;
static struct input_dev *tpacpi_inputdev;
static struct mutex tpacpi_inputdev_send_mutex;


static int tpacpi_resume_handler(struct platform_device *pdev)
Expand Down Expand Up @@ -1131,6 +1132,8 @@ 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,
Expand All @@ -1142,18 +1145,24 @@ static void tpacpi_input_send_key(unsigned int scancode,
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)
Expand Down Expand Up @@ -4737,6 +4746,7 @@ static int __init thinkpad_acpi_module_init(void)
thinkpad_acpi_module_exit();
return ret;
}
mutex_init(&tpacpi_inputdev_send_mutex);
tpacpi_inputdev = input_allocate_device();
if (!tpacpi_inputdev) {
printk(IBM_ERR "unable to allocate input device\n");
Expand Down

0 comments on commit 48b06f0

Please sign in to comment.