public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mattia Dongili <malattia@linux.it>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org,
	Harald Jenny <harald@a-little-linux-box.at>,
	Mattia Dongili <malattia@linux.it>
Subject: [PATCH 2/7] [sony-laptop] VGN-A317M hotkey support
Date: Mon,  3 Nov 2008 18:41:15 +0900	[thread overview]
Message-ID: <1225705280-12775-3-git-send-email-malattia@linux.it> (raw)
In-Reply-To: <1225705280-12775-2-git-send-email-malattia@linux.it>

From: Harald Jenny <harald@a-little-linux-box.at>

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: Mattia Dongili <malattia@linux.it>
---
 drivers/misc/sony-laptop.c |   24 +++++++++++++++++++++++-
 include/linux/sonypi.h     |    3 +++
 2 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
index 7151cee..4c9a3e8 100644
--- a/drivers/misc/sony-laptop.c
+++ b/drivers/misc/sony-laptop.c
@@ -211,6 +211,9 @@ static int sony_laptop_input_index[] = {
 	48,	/* 61 SONYPI_EVENT_WIRELESS_OFF */
 	49,	/* 62 SONYPI_EVENT_ZOOM_IN_PRESSED */
 	50,	/* 63 SONYPI_EVENT_ZOOM_OUT_PRESSED */
+	51,	/* 64 SONYPI_EVENT_VOLUME_INC_PRESSED */
+	52,	/* 65 SONYPI_EVENT_VOLUME_DEC_PRESSED */
+	-1,	/* 66 SONYPI_EVENT_BRIGHTNESS_PRESSED */
 };
 
 static int sony_laptop_input_keycode_map[] = {
@@ -264,7 +267,9 @@ static int sony_laptop_input_keycode_map[] = {
 	KEY_WLAN,	/* 47 SONYPI_EVENT_WIRELESS_ON */
 	KEY_WLAN,	/* 48 SONYPI_EVENT_WIRELESS_OFF */
 	KEY_ZOOMIN,	/* 49 SONYPI_EVENT_ZOOM_IN_PRESSED */
-	KEY_ZOOMOUT	/* 50 SONYPI_EVENT_ZOOM_OUT_PRESSED */
+	KEY_ZOOMOUT,	/* 50 SONYPI_EVENT_ZOOM_OUT_PRESSED */
+	KEY_VOLUMEUP,	/* 51 SONYPI_EVENT_VOLUME_INC_PRESSED */
+	KEY_VOLUMEDOWN,	/* 52 SONYPI_EVENT_VOLUME_DEC_PRESSED */
 };
 
 /* release buttons after a short delay if pressed */
@@ -1320,6 +1325,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 }
 };
 
@@ -1363,6 +1369,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 }
 };
 
@@ -1393,6 +1400,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 },
@@ -1433,6 +1453,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 },
 };
 
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h
index f41ffd7..ce0c80f 100644
--- a/include/linux/sonypi.h
+++ b/include/linux/sonypi.h
@@ -103,6 +103,9 @@
 #define SONYPI_EVENT_WIRELESS_OFF		61
 #define SONYPI_EVENT_ZOOM_IN_PRESSED		62
 #define SONYPI_EVENT_ZOOM_OUT_PRESSED		63
+#define SONYPI_EVENT_VOLUME_INC_PRESSED		64
+#define SONYPI_EVENT_VOLUME_DEC_PRESSED		65
+#define SONYPI_EVENT_BRIGHTNESS_PRESSED		66
 
 /* get/set brightness */
 #define SONYPI_IOCGBRT		_IOR('v', 0, __u8)
-- 
1.5.6.5


  reply	other threads:[~2008-11-03  9:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-03  9:41 [PATCH 0/7] sony-laptop for acpi-test Mattia Dongili
2008-11-03  9:41 ` [PATCH 1/7] [sony-laptop] merge Type4 into Type3 Mattia Dongili
2008-11-03  9:41   ` Mattia Dongili [this message]
2008-11-03  9:41     ` [PATCH 3/7] [sony-laptop] Eliminate BKL in ioctls Mattia Dongili
2008-11-03  9:41       ` [PATCH 4/7] [sony-laptop] detect the ICH9 chipset as Type3 Mattia Dongili
2008-11-03  9:41         ` [PATCH 5/7] [sony-laptop] call the extra enable function for SNC on Vaio Z Mattia Dongili
2008-11-03  9:41           ` [PATCH 6/7] [sony-laptop] add control over wifi power in Sony laptops Mattia Dongili
2008-11-03  9:41             ` [PATCH 7/7] [sony-laptop] notify the hardware of a state change in wwanpower Mattia Dongili
2008-11-03 10:32             ` [PATCH 6/7] [sony-laptop] add control over wifi power in Sony laptops Matthew Garrett
2008-11-03 10:55               ` Sergey Yanovich
2008-11-03 10:57                 ` Matthew Garrett
2008-11-04  8:22         ` [PATCH 4/7] [sony-laptop] detect the ICH9 chipset as Type3 ISHIKAWA Mutsumi
2008-11-04 13:21           ` Mattia Dongili
2008-11-03 11:17 ` [PATCH 0/7] sony-laptop for acpi-test Norbert Preining
2008-11-03 12:48   ` Mattia Dongili
2008-11-03 13:02     ` Norbert Preining

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1225705280-12775-3-git-send-email-malattia@linux.it \
    --to=malattia@linux.it \
    --cc=harald@a-little-linux-box.at \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox