sony-laptop: VGN-A317M hotkey support
authorHarald Jenny <harald@a-little-linux-box.at>
Thu, 26 Mar 2009 12:58:18 +0000 (21:58 +0900)
committerLen Brown <len.brown@intel.com>
Fri, 27 Mar 2009 16:18:56 +0000 (12:18 -0400)
This laptop has 5 SPIC managed buttons above the keyboard:
sound + and - as well as brightness, zoom and S1.
Possibly the entire VGN-A serie behaves the same.

Signed-off-by: Harald Jenny <harald@a-little-linux-box.at>
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 3e45c65b8f81e0b7de309913331de57046d0b10c..4f932889569b7d73c6fe4fe1d50b826a379d3eb5 100644 (file)
@@ -230,6 +230,9 @@ static int sony_laptop_input_index[] = {
        53,     /* 66 SONYPI_EVENT_PKEY_P4 */
        54,     /* 67 SONYPI_EVENT_PKEY_P5 */
        55,     /* 68 SONYPI_EVENT_SETTINGKEY_PRESSED */
+       56,     /* 69 SONYPI_EVENT_VOLUME_INC_PRESSED */
+       57,     /* 70 SONYPI_EVENT_VOLUME_DEC_PRESSED */
+       -1,     /* 71 SONYPI_EVENT_BRIGHTNESS_PRESSED */
 };
 
 static int sony_laptop_input_keycode_map[] = {
@@ -289,6 +292,8 @@ static int sony_laptop_input_keycode_map[] = {
        KEY_PROG4,      /* 53 SONYPI_EVENT_PKEY_P4 */
        KEY_F14,        /* 54 SONYPI_EVENT_PKEY_P5 */
        KEY_F15,        /* 55 SONYPI_EVENT_SETTINGKEY_PRESSED */
+       KEY_VOLUMEUP,   /* 56 SONYPI_EVENT_VOLUME_INC_PRESSED */
+       KEY_VOLUMEDOWN, /* 57 SONYPI_EVENT_VOLUME_DEC_PRESSED */
 };
 
 /* release buttons after a short delay if pressed */
@@ -1555,6 +1560,7 @@ static struct sonypi_event sonypi_pkeyev[] = {
        { 0x01, SONYPI_EVENT_PKEY_P1 },
        { 0x02, SONYPI_EVENT_PKEY_P2 },
        { 0x04, SONYPI_EVENT_PKEY_P3 },
+       { 0x20, SONYPI_EVENT_PKEY_P1 },
        { 0, 0 }
 };
 
@@ -1598,6 +1604,7 @@ static struct sonypi_event sonypi_zoomev[] = {
        { 0x39, SONYPI_EVENT_ZOOM_PRESSED },
        { 0x10, SONYPI_EVENT_ZOOM_IN_PRESSED },
        { 0x20, SONYPI_EVENT_ZOOM_OUT_PRESSED },
+       { 0x04, SONYPI_EVENT_ZOOM_PRESSED },
        { 0, 0 }
 };
 
@@ -1628,6 +1635,19 @@ static struct sonypi_event sonypi_batteryev[] = {
        { 0, 0 }
 };
 
+/* The set of possible volume events */
+static struct sonypi_event sonypi_volumeev[] = {
+       { 0x01, SONYPI_EVENT_VOLUME_INC_PRESSED },
+       { 0x02, SONYPI_EVENT_VOLUME_DEC_PRESSED },
+       { 0, 0 }
+};
+
+/* The set of possible brightness events */
+static struct sonypi_event sonypi_brightnessev[] = {
+       { 0x80, SONYPI_EVENT_BRIGHTNESS_PRESSED },
+       { 0, 0 }
+};
+
 static struct sonypi_eventtypes type1_events[] = {
        { 0, 0xffffffff, sonypi_releaseev },
        { 0x70, SONYPI_MEYE_MASK, sonypi_meyeev },
@@ -1668,6 +1688,8 @@ static struct sonypi_eventtypes type3_events[] = {
        { 0x05, SONYPI_PKEY_MASK, sonypi_pkeyev },
        { 0x05, SONYPI_ZOOM_MASK, sonypi_zoomev },
        { 0x05, SONYPI_CAPTURE_MASK, sonypi_captureev },
+       { 0x05, SONYPI_PKEY_MASK, sonypi_volumeev },
+       { 0x05, SONYPI_PKEY_MASK, sonypi_brightnessev },
        { 0 },
 };
 
index bb835019ac7feb1a64bbd50bd50f6d054f4a11b2..34c4475ac4a201767392bca52f642a17a6000860 100644 (file)
 #define SONYPI_EVENT_PKEY_P4                   66
 #define SONYPI_EVENT_PKEY_P5                   67
 #define SONYPI_EVENT_SETTINGKEY_PRESSED                68
+#define SONYPI_EVENT_VOLUME_INC_PRESSED                69
+#define SONYPI_EVENT_VOLUME_DEC_PRESSED                70
+#define SONYPI_EVENT_BRIGHTNESS_PRESSED                71
 
 /* get/set brightness */
 #define SONYPI_IOCGBRT         _IOR('v', 0, __u8)