public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* sony-laptop driver: Volume keys on Sony Vaio TX3 don't work
@ 2011-10-16 11:11 John Hughes
  2011-10-16 12:30 ` Bug: changing keycodes generated by sony-laptop doesn't work John Hughes
  2011-10-16 13:27 ` sony-laptop driver: Volume keys on Sony Vaio TX3 don't work John Hughes
  0 siblings, 2 replies; 16+ messages in thread
From: John Hughes @ 2011-10-16 11:11 UTC (permalink / raw)
  To: linux-kernel, Mattia Dongili, Stelian Pop

[-- Attachment #1: Type: text/plain, Size: 741 bytes --]

Even though sony-laptop has code to handle the volume-up/volume-down 
keys they don't work.  Pressing volume-down gets treated as 
SONYPI_EVENT_PKEY_P1 and volume-up as SONYPI_EVENT_PKEY_P2.

This is because volume-down generates event 0x01 with data mask 0x05 and 
although the sonypi_volumeev table exists to handle this the table 
sonypi_pkeyev steals the event before it gets handled.

Re-ordering the entries in the table type3_events and fixing the bug in 
sonypi_volumeev (up and down were inverted) makes the volume keys work.

See attached patch.

The two remaining problems are:

1. the EJECT key is mapped to FN_E
2. the MUTE key (event 5f, 31) is mapped to nothing.   (Not to important 
as it turns the speaker off in hardware).

[-- Attachment #2: sony-vaio-tx3.patch --]
[-- Type: text/x-patch, Size: 945 bytes --]

--- drivers/platform/x86/sony-laptop.c.orig	2009-12-03 04:51:21.000000000 +0100
+++ drivers/platform/x86/sony-laptop.c	2011-10-16 12:58:07.000000000 +0200
@@ -1576,8 +1576,8 @@
 
 /* The set of possible volume events */
 static struct sonypi_event sonypi_volumeev[] = {
-	{ 0x01, SONYPI_EVENT_VOLUME_INC_PRESSED },
-	{ 0x02, SONYPI_EVENT_VOLUME_DEC_PRESSED },
+	{ 0x01, SONYPI_EVENT_VOLUME_DEC_PRESSED },
+	{ 0x02, SONYPI_EVENT_VOLUME_INC_PRESSED },
 	{ 0, 0 }
 };
 
@@ -1624,10 +1624,10 @@
 	{ 0x31, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev },
 	{ 0x41, SONYPI_BATTERY_MASK, sonypi_batteryev },
 	{ 0x31, SONYPI_PKEY_MASK, sonypi_pkeyev },
+	{ 0x05, SONYPI_PKEY_MASK, sonypi_volumeev },
 	{ 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 },
 };

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-10-19 22:01 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-16 11:11 sony-laptop driver: Volume keys on Sony Vaio TX3 don't work John Hughes
2011-10-16 12:30 ` Bug: changing keycodes generated by sony-laptop doesn't work John Hughes
2011-10-16 13:30   ` John Hughes
2011-10-17  9:08     ` John Hughes
2011-10-16 13:27 ` sony-laptop driver: Volume keys on Sony Vaio TX3 don't work John Hughes
2011-10-16 17:45   ` John Hughes
2011-10-16 18:20     ` Valdis.Kletnieks
2011-10-16 21:38       ` Mattia Dongili
2011-10-16 21:50         ` Valdis.Kletnieks
2011-10-16 23:17           ` John Hughes
2011-10-17 21:43             ` Mattia Dongili
2011-10-18  9:02               ` John Hughes
2011-10-17 21:45           ` Mattia Dongili
2011-10-18  9:07             ` John Hughes
2011-10-19 22:01               ` John Hughes
2011-10-16 23:13       ` John Hughes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox