From: David Woodhouse <dwmw2@infradead.org>
To: Corentin Chary <corentin.chary@gmail.com>
Cc: mjg59@srcf.ucam.org, platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH] Lenovo IdeaPAD ACPI driver
Date: Thu, 12 Aug 2010 10:42:31 +0100 [thread overview]
Message-ID: <1281606151.12475.57.camel@localhost> (raw)
In-Reply-To: <AANLkTinBqq+0rDE8DM0wz-FvUQqzH2Rf0F=YJgqVLHqM@mail.gmail.com>
On Wed, 2010-08-11 at 15:51 +0200, Corentin Chary wrote:
> And you should probably make it a platform driver (being the parent of
> acpi, wmi, input, backlight, rfkill, etc..).
>
> Is there a lot of thing hidden in ACPI / WMI on these models (like
> hotkeys, backlight, light sensors) ?
I hooked up something (below) to dump the AE or IO WMI blocks each time
we get a notification on the VPC2004 device. Although the notification
happens when we press a key, nothing ever changes in either of them.
I *did* notice that we're actually getting proper keycodes for the
hotkeys though, so for now I've lost what little interest I already had
in doing anything with WMI. If anyone (Florian?) wants to do more, I'd
be happy to do some testing.
As I said, my main reason for looking at this was to implement the
rkfill support, without which some people can't get the wireless working
on these devices at all (without booting to Windows to unblock it). And
that much is working in git://git.infradead.org/~dwmw2/ideapad-2.6.git
diff --git a/drivers/platform/x86/ideapad-wmi.c b/drivers/platform/x86/ideapad-wmi.c
index 53046d1..5bdbd9c 100644
--- a/drivers/platform/x86/ideapad-wmi.c
+++ b/drivers/platform/x86/ideapad-wmi.c
@@ -28,6 +28,10 @@
#include <acpi/acpi_drivers.h>
#include <linux/rfkill.h>
+#define IDEAPAD_EVENT_GUID "ABBC0F20-8EA1-11D1-00A0-C90629100000"
+#define IDEAPAD_IO_GUID "ABBC0F40-8EA1-11D1-00A0-C90629100000"
+#define IDEAPAD_AE_GUID "05901221-D566-11D1-B2F0-00A0C9062910"
+
#define IDEAPAD_DEV_CAMERA 0
#define IDEAPAD_DEV_WLAN 1
#define IDEAPAD_DEV_BLUETOOTH 2
@@ -268,9 +272,44 @@ static int ideapad_acpi_remove(struct acpi_device *adevice, int type)
return 0;
}
+static int oldlen;
+static unsigned char oldresponse[4096];
+
static void ideapad_acpi_notify(struct acpi_device *adevice, u32 event)
{
+ struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
+ union acpi_object *obj;
+ acpi_status status;
+
ideapad_sync_rfk_state(adevice);
+
+ status = wmi_query_block(IDEAPAD_AE_GUID, 1, &response);
+ if (ACPI_FAILURE(status))
+ return;
+
+ obj = response.pointer;
+ if (obj && obj->type == ACPI_TYPE_BUFFER) {
+ int i;
+#if 1
+ for (i=0 ; i<obj->buffer.length; i++) {
+ if (!(i&0xf)) {
+ if (i)
+ printk("\n");
+ printk(KERN_INFO "%04x:", i);
+ }
+ printk(" %02x", ((unsigned char *)obj->buffer.pointer)[i]);
+ }
+ printk("\n");
+#endif
+ for (i=0 ; i < obj->buffer.length && i < oldlen; i++) {
+ if (oldresponse[i] != obj->buffer.pointer[i])
+ printk(KERN_INFO "Byte %04x: %02x->%02x\n",
+ i, oldresponse[i], obj->buffer.pointer[i]);
+ }
+ oldlen = min(sizeof(oldresponse), obj->buffer.length);
+ memcpy(oldresponse, obj->buffer.pointer, oldlen);
+ }
+ kfree(obj);
}
static struct acpi_driver ideapad_acpi_driver = {
--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation
next prev parent reply other threads:[~2010-08-12 9:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-10 22:52 [PATCH] Lenovo IdeaPAD ACPI driver David Woodhouse
2010-08-11 12:59 ` Corentin Chary
2010-08-11 13:39 ` David Woodhouse
2010-08-11 13:51 ` Corentin Chary
2010-08-11 13:55 ` David Woodhouse
2010-08-12 9:42 ` David Woodhouse [this message]
2010-08-12 11:49 ` Corentin Chary
2010-08-12 12:24 ` David Woodhouse
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=1281606151.12475.57.camel@localhost \
--to=dwmw2@infradead.org \
--cc=corentin.chary@gmail.com \
--cc=mjg59@srcf.ucam.org \
--cc=platform-driver-x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.