public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Garrett <mjg59@srcf.ucam.org>
To: Mattia Dongili <malattia@linux.it>
Cc: Norbert Preining <preining@logic.at>,
	Matthias Welwarsky <matze@welwarsky.de>,
	linux-acpi@vger.kernel.org
Subject: Re: [PATCH] sony-laptop: support rfkill via ACPI interfaces
Date: Mon, 23 Mar 2009 21:48:22 +0000	[thread overview]
Message-ID: <20090323214822.GA32460@srcf.ucam.org> (raw)
In-Reply-To: <20090322231029.GC17905@kamineko.org>

On Mon, Mar 23, 2009 at 08:10:30AM +0900, Mattia Dongili wrote:

> Yes it does.
> A vaio SR user sent me this list for 0x9c that after a call to SN07(202)
> becomes:

After looking at this, I think we actually want to be calling SN07(20C) 
on these machines - they implement an 0x127 function in the C function 
slot which also calls GECR. I suspect that this corresponds to the 
larger number of programmable buttons, so should be added to another 
table. Something like the following - some amount of tidying up 
required. That would avoid needing to add a multilevel setup.

Interestingly, the recent SRs also appear to implement the 0x124 rfill 
method, but at SN07(4) rather than SN07(3). This leaves me pretty happy 
that I've got the right idea about how this all works now :)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 2d142d3..5d95af8 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -850,6 +850,25 @@ struct sony_nc_event {
 	u8	event;
 };
 
+static struct sony_nc_event sony_127_events[] = {
+	{ 0x81, SONYPI_EVENT_MODEKEY_PRESSED },
+	{ 0x01, SONYPI_EVENT_ANYBUTTON_RELEASED },
+	{ 0x82, SONYPI_EVENT_PKEY_P1 },
+	{ 0x02, SONYPI_EVENT_ANYBUTTON_RELEASED },
+	{ 0x83, SONYPI_EVENT_PKEY_P2 },
+	{ 0x03, SONYPI_EVENT_ANYBUTTON_RELEASED },
+	{ 0x84, SONYPI_EVENT_PKEY_P3 },
+	{ 0x04, SONYPI_EVENT_ANYBUTTON_RELEASED },
+	{ 0x85, SONYPI_EVENT_PKEY_P4 },
+	{ 0x05, SONYPI_EVENT_ANYBUTTON_RELEASED },
+	{ 0x86, SONYPI_EVENT_PKEY_P5 },
+	{ 0x06, SONYPI_EVENT_ANYBUTTON_RELEASED },
+	{ 0x06, SONYPI_EVENT_ANYBUTTON_RELEASED },
+	{ 0x87, SONYPI_EVENT_SETTINGKEY_PRESSED },
+	{ 0x07, SONYPI_EVENT_ANYBUTTON_RELEASED },
+	{ 0, 0 },
+}
+
 static struct sony_nc_event sony_nc_events[] = {
 	{ 0x90, SONYPI_EVENT_PKEY_P1 },
 	{ 0x10, SONYPI_EVENT_ANYBUTTON_RELEASED },
@@ -908,6 +927,24 @@ static void sony_acpi_notify(acpi_handle handle, u32 event, void *data)
 		} else if (sony_find_snc_handle(0x124) == ev) {
 			sony_nc_rfkill_update();
 			return;
+		} else 	if (sony_find_snc_handle(0x127) == ev) {
+			int i;
+
+			if (sony_call_snc_handle(0x127, 0x200, &result))
+				dprintk("sony_acpi_notify, unable to decode event 0x%.2x\n", ev);
+			else
+				ev = result & 0xFF;
+
+			for (i=0; sony_127_events[i].event; i++) {
+				if (sony_127_events[i].data == ev) {
+					ev = sony_127_events[i].event;
+					break;
+				}
+			}
+
+			if (!sony_127_events[i].data)
+				printk(KERN_INFO DRV_PFX
+				       "Unknown event: %x %x\n", origev, ev);
 		}
 	}
 


-- 
Matthew Garrett | mjg59@srcf.ucam.org

  parent reply	other threads:[~2009-03-23 21:48 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19 21:21 [PATCH] sony-laptop: support rfkill via ACPI interfaces Matthew Garrett
2009-03-19 21:28 ` Matthew Garrett
2009-03-19 21:34 ` Norbert Preining
2009-03-19 21:44   ` Matthew Garrett
2009-03-19 21:49     ` Norbert Preining
2009-03-19 21:56       ` Matthew Garrett
2009-03-19 22:15     ` Norbert Preining
2009-03-20  0:28       ` Norbert Preining
2009-03-20  0:38         ` Matthew Garrett
2009-03-20  0:40           ` Norbert Preining
2009-03-20  1:18             ` Norbert Preining
2009-03-20  7:33               ` Matthias Welwarsky
2009-03-21 11:22               ` Matthias Welwarsky
2009-03-21 13:53                 ` Matthias Welwarsky
2009-03-21 14:45                   ` Mattia Dongili
2009-03-21 16:51                     ` Norbert Preining
2009-03-22 17:56                   ` Matthew Garrett
2009-03-22 18:03                     ` Matthew Garrett
2009-03-22 20:36                       ` Norbert Preining
2009-03-22 20:37                         ` Matthew Garrett
2009-03-22 22:06                           ` Norbert Preining
2009-03-22 22:46                             ` Matthew Garrett
2009-03-22 23:10                               ` Mattia Dongili
2009-03-22 23:14                                 ` Matthew Garrett
2009-03-23  0:08                                   ` Mattia Dongili
2009-03-23  0:10                                     ` Matthew Garrett
2009-03-23 12:30                                 ` Norbert Preining
2009-03-23 13:04                                   ` Mattia Dongili
2009-03-23 15:32                                     ` Norbert Preining
2009-03-23 15:43                                       ` Matthew Garrett
2009-03-23 16:00                                         ` Norbert Preining
2009-03-23 16:09                                           ` Matthew Garrett
2009-03-23 16:27                                             ` Norbert Preining
2009-03-23 16:30                                               ` Matthew Garrett
2009-03-23 16:37                                                 ` Norbert Preining
2009-03-23 16:40                                                   ` Matthew Garrett
2009-03-23 16:41                                                     ` Norbert Preining
2009-03-23 16:51                                                       ` Matthew Garrett
2009-03-23 17:48                                                         ` Norbert Preining
2009-03-23 19:51                                                           ` Matthew Garrett
2009-03-24  0:01                                                             ` Norbert Preining
2009-03-24  0:08                                                             ` Mattia Dongili
2009-03-23 21:48                                 ` Matthew Garrett [this message]
2009-03-24  0:02                                   ` Norbert Preining
2009-03-24  0:04                                     ` Matthew Garrett
2009-03-23 12:29                               ` Norbert Preining
2009-03-23 14:58                                 ` Matthew Garrett
2009-03-21 16:18                 ` Norbert Preining
2009-03-20  8:52 ` Mattia Dongili
2009-03-20 14:00   ` Matthew Garrett
2009-03-21  4:00     ` Mattia Dongili
2009-03-21  4:35       ` Matthew Garrett
2009-03-21  6:32         ` Mattia Dongili
2009-03-21 14:06           ` Matthew Garrett
2009-03-21 14:37             ` Mattia Dongili
2009-03-21 14:55               ` Matthew Garrett
2009-03-21 15:10                 ` Matthew Garrett
2009-03-21 19:15                   ` Matthias Welwarsky
2009-03-22 13:33                     ` Matthew Garrett
2009-03-22  2:38                   ` Mattia Dongili

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=20090323214822.GA32460@srcf.ucam.org \
    --to=mjg59@srcf.ucam.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=malattia@linux.it \
    --cc=matze@welwarsky.de \
    --cc=preining@logic.at \
    /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