sony-laptop: add AVMode key mapping
authorMattia Dongili <malattia@linux.it>
Wed, 16 Dec 2009 15:08:33 +0000 (00:08 +0900)
committerLen Brown <len.brown@intel.com>
Thu, 17 Dec 2009 03:32:29 +0000 (22:32 -0500)
Some models are equipped with an "AVMode" function key that sends
  sony-laptop: Unknown event: 0x100 0xa1
  sony-laptop: Unknown event: 0x100 0x21
for press and release respectively.

Cc: "Matthew W. S. Bell" <matthew@bells23.org.uk>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/platform/x86/sony-laptop.c
include/linux/sonypi.h

index a2a742c8ff7e30dab430ef7ece4abc1c2a930dd3..9710f70040ba559c99e0e702c288f9776ca947d6 100644 (file)
@@ -232,6 +232,7 @@ static int sony_laptop_input_index[] = {
        56,     /* 69 SONYPI_EVENT_VOLUME_INC_PRESSED */
        57,     /* 70 SONYPI_EVENT_VOLUME_DEC_PRESSED */
        -1,     /* 71 SONYPI_EVENT_BRIGHTNESS_PRESSED */
+       58,     /* 72 SONYPI_EVENT_MEDIA_PRESSED */
 };
 
 static int sony_laptop_input_keycode_map[] = {
@@ -293,6 +294,7 @@ static int sony_laptop_input_keycode_map[] = {
        KEY_F15,        /* 55 SONYPI_EVENT_SETTINGKEY_PRESSED */
        KEY_VOLUMEUP,   /* 56 SONYPI_EVENT_VOLUME_INC_PRESSED */
        KEY_VOLUMEDOWN, /* 57 SONYPI_EVENT_VOLUME_DEC_PRESSED */
+       KEY_MEDIA,      /* 58 SONYPI_EVENT_MEDIA_PRESSED */
 };
 
 /* release buttons after a short delay if pressed */
@@ -890,6 +892,8 @@ static struct sony_nc_event sony_100_events[] = {
        { 0x0C, SONYPI_EVENT_FNKEY_RELEASED },
        { 0x9f, SONYPI_EVENT_CD_EJECT_PRESSED },
        { 0x1f, SONYPI_EVENT_ANYBUTTON_RELEASED },
+       { 0xa1, SONYPI_EVENT_MEDIA_PRESSED },
+       { 0x21, SONYPI_EVENT_ANYBUTTON_RELEASED },
        { 0, 0 },
 };
 
index 34c4475ac4a201767392bca52f642a17a6000860..4f95c1aac2fde62b3ddb6294d836243a23119146 100644 (file)
 #define SONYPI_EVENT_VOLUME_INC_PRESSED                69
 #define SONYPI_EVENT_VOLUME_DEC_PRESSED                70
 #define SONYPI_EVENT_BRIGHTNESS_PRESSED                71
+#define SONYPI_EVENT_MEDIA_PRESSED             72
 
 /* get/set brightness */
 #define SONYPI_IOCGBRT         _IOR('v', 0, __u8)