summaryrefslogtreecommitdiffstats
path: root/drivers/input/misc
diff options
context:
space:
mode:
authorÉric Piel <Eric.Piel@tremplin-utc.net>2008-06-26 17:05:01 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2008-06-30 15:37:51 +0200
commita894403766c93a8fae6de15684aa559fc78d5530 (patch)
tree570ff2ab0b09d245cdcc85988efc2b88e96aa8bc /drivers/input/misc
parentInput: atkbd - fix HP 2133 not sending release event for video switch (diff)
downloadlinux-a894403766c93a8fae6de15684aa559fc78d5530.tar.xz
linux-a894403766c93a8fae6de15684aa559fc78d5530.zip
Input: wistron - generate normal key event if bluetooth or wifi not present
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>
Diffstat (limited to 'drivers/input/misc')
-rw-r--r--drivers/input/misc/wistron_btns.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index 72176f3d49cb..fe268be3293b 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -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;
@@ -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;
}