linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	lenb@kernel.org
Subject: Re: [PATCH, resend] misc: Add dell-wmi driver for hotkey control
Date: Tue, 30 Dec 2008 15:50:35 -0800	[thread overview]
Message-ID: <20081230155035.8224ca86.akpm@linux-foundation.org> (raw)
In-Reply-To: <20081228153128.GC13424@srcf.ucam.org>

On Sun, 28 Dec 2008 15:31:28 +0000
Matthew Garrett <mjg59@srcf.ucam.org> wrote:

> misc: add dell-wmi driver
>     
> Add a WMI driver for Dell laptops. Currently it does nothing but send a
> generic input event when a button with a picture of a battery on it is
> pressed, but maybe other uses will appear over time.
>     

One wonders whether this driver should really live in drivers/input/?

+#include <linux/input.h>
+static struct input_dev *dell_wmi_input_dev;
+static int dell_wmi_getkeycode(struct input_dev *dev, int scancode,
+static int dell_wmi_setkeycode(struct input_dev *dev, int scancode, int keycode)
+			input_report_key(dell_wmi_input_dev, key->keycode, 1);
+			input_sync(dell_wmi_input_dev);
+			input_report_key(dell_wmi_input_dev, key->keycode, 0);
+			input_sync(dell_wmi_input_dev);
+static int __init dell_wmi_input_setup(void)
+	dell_wmi_input_dev = input_allocate_device();
+	if (!dell_wmi_input_dev)
+	dell_wmi_input_dev->name = "Dell WMI hotkeys";
+	dell_wmi_input_dev->phys = "wmi/input0";
+	dell_wmi_input_dev->id.bustype = BUS_HOST;
+	dell_wmi_input_dev->getkeycode = dell_wmi_getkeycode;
+	dell_wmi_input_dev->setkeycode = dell_wmi_setkeycode;
+			set_bit(EV_KEY, dell_wmi_input_dev->evbit);
+			set_bit(key->keycode, dell_wmi_input_dev->keybit);
+			set_bit(EV_SW, dell_wmi_input_dev->evbit);
+			set_bit(key->keycode, dell_wmi_input_dev->swbit);
+	err = input_register_device(dell_wmi_input_dev);
+		input_free_device(dell_wmi_input_dev);
+		err = dell_wmi_input_setup();
+			input_unregister_device(dell_wmi_input_dev);
+		input_unregister_device(dell_wmi_input_dev);


  reply	other threads:[~2008-12-30 23:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-28 15:31 [PATCH, resend] misc: Add dell-wmi driver for hotkey control Matthew Garrett
2008-12-30 23:50 ` Andrew Morton [this message]
2008-12-31  0:14   ` Matthew Garrett
2009-01-01  0:14     ` Len Brown

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=20081230155035.8224ca86.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.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;
as well as URLs for NNTP newsgroup(s).