Skip to content

Commit

Permalink
Input: wistron - generate normal key event if bluetooth or wifi not p…
Browse files Browse the repository at this point in the history
…resent

If the subsystem is not present, instead of not doing anything, report
the key press as a normal key. This is done by modifying at
initialization the copied key entry table.

Signed-off-by: Eric Piel <Eric.Piel@tremplin-utc.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Éric Piel authored and Dmitry Torokhov committed Jun 30, 2008
1 parent 5a54c01 commit a894403
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion drivers/input/misc/wistron_btns.c
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ static int wistron_setkeycode(struct input_dev *dev, int scancode, int keycode)

static int __devinit setup_input_dev(void)
{
const struct key_entry *key;
struct key_entry *key;
struct input_dev *input_dev;
int error;

Expand Down Expand Up @@ -1219,6 +1219,23 @@ static int __devinit setup_input_dev(void)
set_bit(key->sw.code, input_dev->swbit);
break;

/* if wifi or bluetooth are not available, create normal keys */
case KE_WIFI:
if (!have_wifi) {
key->type = KE_KEY;
key->keycode = KEY_WLAN;
key--;
}
break;

case KE_BLUETOOTH:
if (!have_bluetooth) {
key->type = KE_KEY;
key->keycode = KEY_BLUETOOTH;
key--;
}
break;

default:
break;
}
Expand Down

0 comments on commit a894403

Please sign in to comment.