Commit 1a7d946993aaf2a79e9c65abbe169a108e351bcb

Authored by Mattia Dongili
Committed by Matthew Garrett
1 parent 0c51a4d8ab

sony-laptop: support new hotkeys on the P, Z and EC series

Add new mappings for assist, VAIO, zoom and eject buttons present on
refurbished P, Z and EC models.

Reported-by: Gyorgy Jeney <nog.lkml@gmail.com>
Reported-by: Stephan Mueller <smueller@chronox.de>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Matthew Garrett <mjg@redhat.com>

Showing 2 changed files with 11 additions and 0 deletions Side-by-side Diff

drivers/platform/x86/sony-laptop.c
... ... @@ -235,6 +235,7 @@
235 235 57, /* 70 SONYPI_EVENT_VOLUME_DEC_PRESSED */
236 236 -1, /* 71 SONYPI_EVENT_BRIGHTNESS_PRESSED */
237 237 58, /* 72 SONYPI_EVENT_MEDIA_PRESSED */
  238 + 59, /* 72 SONYPI_EVENT_VENDOR_PRESSED */
238 239 };
239 240  
240 241 static int sony_laptop_input_keycode_map[] = {
... ... @@ -297,6 +298,7 @@
297 298 KEY_VOLUMEUP, /* 56 SONYPI_EVENT_VOLUME_INC_PRESSED */
298 299 KEY_VOLUMEDOWN, /* 57 SONYPI_EVENT_VOLUME_DEC_PRESSED */
299 300 KEY_MEDIA, /* 58 SONYPI_EVENT_MEDIA_PRESSED */
  301 + KEY_VENDOR, /* 59 SONYPI_EVENT_VENDOR_PRESSED */
300 302 };
301 303  
302 304 /* release buttons after a short delay if pressed */
303 305  
... ... @@ -894,10 +896,18 @@
894 896 { 0x0A, SONYPI_EVENT_FNKEY_RELEASED },
895 897 { 0x8C, SONYPI_EVENT_FNKEY_F12 },
896 898 { 0x0C, SONYPI_EVENT_FNKEY_RELEASED },
  899 + { 0x9d, SONYPI_EVENT_ZOOM_PRESSED },
  900 + { 0x1d, SONYPI_EVENT_ANYBUTTON_RELEASED },
897 901 { 0x9f, SONYPI_EVENT_CD_EJECT_PRESSED },
898 902 { 0x1f, SONYPI_EVENT_ANYBUTTON_RELEASED },
899 903 { 0xa1, SONYPI_EVENT_MEDIA_PRESSED },
900 904 { 0x21, SONYPI_EVENT_ANYBUTTON_RELEASED },
  905 + { 0xa4, SONYPI_EVENT_CD_EJECT_PRESSED },
  906 + { 0x24, SONYPI_EVENT_ANYBUTTON_RELEASED },
  907 + { 0xa5, SONYPI_EVENT_VENDOR_PRESSED },
  908 + { 0x25, SONYPI_EVENT_ANYBUTTON_RELEASED },
  909 + { 0xa6, SONYPI_EVENT_HELP_PRESSED },
  910 + { 0x26, SONYPI_EVENT_ANYBUTTON_RELEASED },
901 911 { 0, 0 },
902 912 };
903 913  
include/linux/sonypi.h
... ... @@ -112,6 +112,7 @@
112 112 #define SONYPI_EVENT_VOLUME_DEC_PRESSED 70
113 113 #define SONYPI_EVENT_BRIGHTNESS_PRESSED 71
114 114 #define SONYPI_EVENT_MEDIA_PRESSED 72
  115 +#define SONYPI_EVENT_VENDOR_PRESSED 73
115 116  
116 117 /* get/set brightness */
117 118 #define SONYPI_IOCGBRT _IOR('v', 0, __u8)