Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-06-05 Thread Darren Hart
On Mon, May 29, 2017 at 07:45:05PM -0700, Dmitry Torokhov wrote:
> On Sat, May 27, 2017 at 11:40:52AM -0700, Andy Lutomirski wrote:
> > On Sat, May 27, 2017 at 9:17 AM, Dmitry Torokhov
> >  wrote:
> > > On May 27, 2017 9:04:38 AM PDT, Andy Lutomirski  wrote:
> > >>On Sat, May 27, 2017 at 3:50 AM, Pali Rohár 
> > >>wrote:
> > >>> On Saturday 27 May 2017 07:31:30 Darren Hart wrote:
> >  - dell_wmi_input_dev->name = "Dell WMI hotkeys";
> >  - dell_wmi_input_dev->phys = "wmi/input0";
> >  - dell_wmi_input_dev->id.bustype = BUS_HOST;
> >  + priv->input_dev->name = "Dell WMI hotkeys";
> >  + priv->input_dev->id.bustype = BUS_HOST;
> > >>>
> > >>> Is not there BUS_WMI, or something like that? (Just asking)
> > >>>
> > >>
> > >>Jiri and/or Dmitry, what is bustype for, anyway?
> > >
> > > The bus type could be used to help further  identifying device if it used 
> > > same vendor/product for spi and i2c, for example, but there are not many 
> > > if them. I'm not sure if anyone actually makes decisions based on it, but 
> > > it is part of abi now.
> > >
> > >>I suppose we could add BUS_PLATFORM.
> > >
> > > What would be the difference from BUS_HOST?
> > >
> > 
> > If BUS_HOST means that the device is part of the host as opposed to
> > being plugged in, then it seems entirely reasonable.
> 
> Yes, it basically means platform-specific interface.
> 

I'm going to leave this as BUS_HOST then. Thanks everyone.

-- 
Darren Hart
VMware Open Source Technology Center


Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-06-05 Thread Darren Hart
On Mon, May 29, 2017 at 07:45:05PM -0700, Dmitry Torokhov wrote:
> On Sat, May 27, 2017 at 11:40:52AM -0700, Andy Lutomirski wrote:
> > On Sat, May 27, 2017 at 9:17 AM, Dmitry Torokhov
> >  wrote:
> > > On May 27, 2017 9:04:38 AM PDT, Andy Lutomirski  wrote:
> > >>On Sat, May 27, 2017 at 3:50 AM, Pali Rohár 
> > >>wrote:
> > >>> On Saturday 27 May 2017 07:31:30 Darren Hart wrote:
> >  - dell_wmi_input_dev->name = "Dell WMI hotkeys";
> >  - dell_wmi_input_dev->phys = "wmi/input0";
> >  - dell_wmi_input_dev->id.bustype = BUS_HOST;
> >  + priv->input_dev->name = "Dell WMI hotkeys";
> >  + priv->input_dev->id.bustype = BUS_HOST;
> > >>>
> > >>> Is not there BUS_WMI, or something like that? (Just asking)
> > >>>
> > >>
> > >>Jiri and/or Dmitry, what is bustype for, anyway?
> > >
> > > The bus type could be used to help further  identifying device if it used 
> > > same vendor/product for spi and i2c, for example, but there are not many 
> > > if them. I'm not sure if anyone actually makes decisions based on it, but 
> > > it is part of abi now.
> > >
> > >>I suppose we could add BUS_PLATFORM.
> > >
> > > What would be the difference from BUS_HOST?
> > >
> > 
> > If BUS_HOST means that the device is part of the host as opposed to
> > being plugged in, then it seems entirely reasonable.
> 
> Yes, it basically means platform-specific interface.
> 

I'm going to leave this as BUS_HOST then. Thanks everyone.

-- 
Darren Hart
VMware Open Source Technology Center


Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-05-29 Thread Dmitry Torokhov
On Sat, May 27, 2017 at 11:40:52AM -0700, Andy Lutomirski wrote:
> On Sat, May 27, 2017 at 9:17 AM, Dmitry Torokhov
>  wrote:
> > On May 27, 2017 9:04:38 AM PDT, Andy Lutomirski  wrote:
> >>On Sat, May 27, 2017 at 3:50 AM, Pali Rohár 
> >>wrote:
> >>> On Saturday 27 May 2017 07:31:30 Darren Hart wrote:
>  - dell_wmi_input_dev->name = "Dell WMI hotkeys";
>  - dell_wmi_input_dev->phys = "wmi/input0";
>  - dell_wmi_input_dev->id.bustype = BUS_HOST;
>  + priv->input_dev->name = "Dell WMI hotkeys";
>  + priv->input_dev->id.bustype = BUS_HOST;
> >>>
> >>> Is not there BUS_WMI, or something like that? (Just asking)
> >>>
> >>
> >>Jiri and/or Dmitry, what is bustype for, anyway?
> >
> > The bus type could be used to help further  identifying device if it used 
> > same vendor/product for spi and i2c, for example, but there are not many if 
> > them. I'm not sure if anyone actually makes decisions based on it, but it 
> > is part of abi now.
> >
> >>I suppose we could add BUS_PLATFORM.
> >
> > What would be the difference from BUS_HOST?
> >
> 
> If BUS_HOST means that the device is part of the host as opposed to
> being plugged in, then it seems entirely reasonable.

Yes, it basically means platform-specific interface.

-- 
Dmitry


Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-05-29 Thread Dmitry Torokhov
On Sat, May 27, 2017 at 11:40:52AM -0700, Andy Lutomirski wrote:
> On Sat, May 27, 2017 at 9:17 AM, Dmitry Torokhov
>  wrote:
> > On May 27, 2017 9:04:38 AM PDT, Andy Lutomirski  wrote:
> >>On Sat, May 27, 2017 at 3:50 AM, Pali Rohár 
> >>wrote:
> >>> On Saturday 27 May 2017 07:31:30 Darren Hart wrote:
>  - dell_wmi_input_dev->name = "Dell WMI hotkeys";
>  - dell_wmi_input_dev->phys = "wmi/input0";
>  - dell_wmi_input_dev->id.bustype = BUS_HOST;
>  + priv->input_dev->name = "Dell WMI hotkeys";
>  + priv->input_dev->id.bustype = BUS_HOST;
> >>>
> >>> Is not there BUS_WMI, or something like that? (Just asking)
> >>>
> >>
> >>Jiri and/or Dmitry, what is bustype for, anyway?
> >
> > The bus type could be used to help further  identifying device if it used 
> > same vendor/product for spi and i2c, for example, but there are not many if 
> > them. I'm not sure if anyone actually makes decisions based on it, but it 
> > is part of abi now.
> >
> >>I suppose we could add BUS_PLATFORM.
> >
> > What would be the difference from BUS_HOST?
> >
> 
> If BUS_HOST means that the device is part of the host as opposed to
> being plugged in, then it seems entirely reasonable.

Yes, it basically means platform-specific interface.

-- 
Dmitry


Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-05-27 Thread Andy Lutomirski
On Sat, May 27, 2017 at 9:17 AM, Dmitry Torokhov
 wrote:
> On May 27, 2017 9:04:38 AM PDT, Andy Lutomirski  wrote:
>>On Sat, May 27, 2017 at 3:50 AM, Pali Rohár 
>>wrote:
>>> On Saturday 27 May 2017 07:31:30 Darren Hart wrote:
 - dell_wmi_input_dev->name = "Dell WMI hotkeys";
 - dell_wmi_input_dev->phys = "wmi/input0";
 - dell_wmi_input_dev->id.bustype = BUS_HOST;
 + priv->input_dev->name = "Dell WMI hotkeys";
 + priv->input_dev->id.bustype = BUS_HOST;
>>>
>>> Is not there BUS_WMI, or something like that? (Just asking)
>>>
>>
>>Jiri and/or Dmitry, what is bustype for, anyway?
>
> The bus type could be used to help further  identifying device if it used 
> same vendor/product for spi and i2c, for example, but there are not many if 
> them. I'm not sure if anyone actually makes decisions based on it, but it is 
> part of abi now.
>
>>I suppose we could add BUS_PLATFORM.
>
> What would be the difference from BUS_HOST?
>

If BUS_HOST means that the device is part of the host as opposed to
being plugged in, then it seems entirely reasonable.


Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-05-27 Thread Andy Lutomirski
On Sat, May 27, 2017 at 9:17 AM, Dmitry Torokhov
 wrote:
> On May 27, 2017 9:04:38 AM PDT, Andy Lutomirski  wrote:
>>On Sat, May 27, 2017 at 3:50 AM, Pali Rohár 
>>wrote:
>>> On Saturday 27 May 2017 07:31:30 Darren Hart wrote:
 - dell_wmi_input_dev->name = "Dell WMI hotkeys";
 - dell_wmi_input_dev->phys = "wmi/input0";
 - dell_wmi_input_dev->id.bustype = BUS_HOST;
 + priv->input_dev->name = "Dell WMI hotkeys";
 + priv->input_dev->id.bustype = BUS_HOST;
>>>
>>> Is not there BUS_WMI, or something like that? (Just asking)
>>>
>>
>>Jiri and/or Dmitry, what is bustype for, anyway?
>
> The bus type could be used to help further  identifying device if it used 
> same vendor/product for spi and i2c, for example, but there are not many if 
> them. I'm not sure if anyone actually makes decisions based on it, but it is 
> part of abi now.
>
>>I suppose we could add BUS_PLATFORM.
>
> What would be the difference from BUS_HOST?
>

If BUS_HOST means that the device is part of the host as opposed to
being plugged in, then it seems entirely reasonable.


Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-05-27 Thread Dmitry Torokhov
On May 27, 2017 9:04:38 AM PDT, Andy Lutomirski  wrote:
>On Sat, May 27, 2017 at 3:50 AM, Pali Rohár 
>wrote:
>> On Saturday 27 May 2017 07:31:30 Darren Hart wrote:
>>> - dell_wmi_input_dev->name = "Dell WMI hotkeys";
>>> - dell_wmi_input_dev->phys = "wmi/input0";
>>> - dell_wmi_input_dev->id.bustype = BUS_HOST;
>>> + priv->input_dev->name = "Dell WMI hotkeys";
>>> + priv->input_dev->id.bustype = BUS_HOST;
>>
>> Is not there BUS_WMI, or something like that? (Just asking)
>>
>
>Jiri and/or Dmitry, what is bustype for, anyway? 

The bus type could be used to help further  identifying device if it used same 
vendor/product for spi and i2c, for example, but there are not many if them. 
I'm not sure if anyone actually makes decisions based on it, but it is part of 
abi now.

>I suppose we could add BUS_PLATFORM.

What would be the difference from BUS_HOST?


Thanks.

-- 
Dmitry


Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-05-27 Thread Dmitry Torokhov
On May 27, 2017 9:04:38 AM PDT, Andy Lutomirski  wrote:
>On Sat, May 27, 2017 at 3:50 AM, Pali Rohár 
>wrote:
>> On Saturday 27 May 2017 07:31:30 Darren Hart wrote:
>>> - dell_wmi_input_dev->name = "Dell WMI hotkeys";
>>> - dell_wmi_input_dev->phys = "wmi/input0";
>>> - dell_wmi_input_dev->id.bustype = BUS_HOST;
>>> + priv->input_dev->name = "Dell WMI hotkeys";
>>> + priv->input_dev->id.bustype = BUS_HOST;
>>
>> Is not there BUS_WMI, or something like that? (Just asking)
>>
>
>Jiri and/or Dmitry, what is bustype for, anyway? 

The bus type could be used to help further  identifying device if it used same 
vendor/product for spi and i2c, for example, but there are not many if them. 
I'm not sure if anyone actually makes decisions based on it, but it is part of 
abi now.

>I suppose we could add BUS_PLATFORM.

What would be the difference from BUS_HOST?


Thanks.

-- 
Dmitry


Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-05-27 Thread Andy Lutomirski
On Sat, May 27, 2017 at 3:50 AM, Pali Rohár  wrote:
> On Saturday 27 May 2017 07:31:30 Darren Hart wrote:
>> - dell_wmi_input_dev->name = "Dell WMI hotkeys";
>> - dell_wmi_input_dev->phys = "wmi/input0";
>> - dell_wmi_input_dev->id.bustype = BUS_HOST;
>> + priv->input_dev->name = "Dell WMI hotkeys";
>> + priv->input_dev->id.bustype = BUS_HOST;
>
> Is not there BUS_WMI, or something like that? (Just asking)
>

Jiri and/or Dmitry, what is bustype for, anyway?  I suppose we could
add BUS_PLATFORM.


Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-05-27 Thread Andy Lutomirski
On Sat, May 27, 2017 at 3:50 AM, Pali Rohár  wrote:
> On Saturday 27 May 2017 07:31:30 Darren Hart wrote:
>> - dell_wmi_input_dev->name = "Dell WMI hotkeys";
>> - dell_wmi_input_dev->phys = "wmi/input0";
>> - dell_wmi_input_dev->id.bustype = BUS_HOST;
>> + priv->input_dev->name = "Dell WMI hotkeys";
>> + priv->input_dev->id.bustype = BUS_HOST;
>
> Is not there BUS_WMI, or something like that? (Just asking)
>

Jiri and/or Dmitry, what is bustype for, anyway?  I suppose we could
add BUS_PLATFORM.


Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-05-27 Thread Pali Rohár
On Saturday 27 May 2017 07:31:30 Darren Hart wrote:
> - dell_wmi_input_dev->name = "Dell WMI hotkeys";
> - dell_wmi_input_dev->phys = "wmi/input0";
> - dell_wmi_input_dev->id.bustype = BUS_HOST;
> + priv->input_dev->name = "Dell WMI hotkeys";
> + priv->input_dev->id.bustype = BUS_HOST;

Is not there BUS_WMI, or something like that? (Just asking)

-- 
Pali Rohár
pali.ro...@gmail.com


signature.asc
Description: This is a digitally signed message part.


Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-05-27 Thread Pali Rohár
On Saturday 27 May 2017 07:31:30 Darren Hart wrote:
> - dell_wmi_input_dev->name = "Dell WMI hotkeys";
> - dell_wmi_input_dev->phys = "wmi/input0";
> - dell_wmi_input_dev->id.bustype = BUS_HOST;
> + priv->input_dev->name = "Dell WMI hotkeys";
> + priv->input_dev->id.bustype = BUS_HOST;

Is not there BUS_WMI, or something like that? (Just asking)

-- 
Pali Rohár
pali.ro...@gmail.com


signature.asc
Description: This is a digitally signed message part.


[PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-05-26 Thread Darren Hart
From: Andy Lutomirski 

Move some initialization out of _init and into _probe.
Update signatures and logic to use the wmi bus and device structures.

Signed-off-by: Andy Lutomirski 
[dvhart: drop deprecated sparse_keymap_free, order declarations, add commit msg]
Cc: Andy Lutomirski 
Cc: Mario Limonciello 
Cc: Pali Rohár 
Cc: Rafael Wysocki 
Cc: linux-kernel@vger.kernel.org
Cc: platform-driver-...@vger.kernel.org
Cc: linux-a...@vger.kernel.org
Signed-off-by: Darren Hart (VMware) 
---
 drivers/platform/x86/dell-wmi.c | 136 +---
 1 file changed, 70 insertions(+), 66 deletions(-)

diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index 8a64c79..badc01e 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "dell-smbios.h"
 
@@ -53,6 +54,10 @@ static bool wmi_requires_smbios_request;
 MODULE_ALIAS("wmi:"DELL_EVENT_GUID);
 MODULE_ALIAS("wmi:"DELL_DESCRIPTOR_GUID);
 
+struct dell_wmi_priv {
+   struct input_dev *input_dev;
+};
+
 static int __init dmi_matched(const struct dmi_system_id *dmi)
 {
wmi_requires_smbios_request = 1;
@@ -86,7 +91,7 @@ static const struct dmi_system_id dell_wmi_smbios_list[] 
__initconst = {
  * notifications (rather than requests for change) or are also sent
  * via the keyboard controller so should not be sent again.
  */
-static const struct key_entry dell_wmi_keymap_type_[] __initconst = {
+static const struct key_entry dell_wmi_keymap_type_[] = {
{ KE_IGNORE, 0x003a, { KEY_CAPSLOCK } },
 
/* Key code is followed by brightness level */
@@ -207,7 +212,7 @@ struct dell_dmi_results {
 };
 
 /* Uninitialized entries here are KEY_RESERVED == 0. */
-static const u16 bios_to_linux_keycode[256] __initconst = {
+static const u16 bios_to_linux_keycode[256] = {
[0] = KEY_MEDIA,
[1] = KEY_NEXTSONG,
[2] = KEY_PLAYPAUSE,
@@ -256,7 +261,7 @@ static const u16 bios_to_linux_keycode[256] __initconst = {
  * These are applied if the 0xB2 DMI hotkey table is present and doesn't
  * override them.
  */
-static const struct key_entry dell_wmi_keymap_type_0010[] __initconst = {
+static const struct key_entry dell_wmi_keymap_type_0010[] = {
/* Fn-lock */
{ KE_IGNORE, 0x151, { KEY_RESERVED } },
 
@@ -289,7 +294,7 @@ static const struct key_entry dell_wmi_keymap_type_0010[] 
__initconst = {
 /*
  * Keymap for WMI events of type 0x0011
  */
-static const struct key_entry dell_wmi_keymap_type_0011[] __initconst = {
+static const struct key_entry dell_wmi_keymap_type_0011[] = {
/* Battery unplugged */
{ KE_IGNORE, 0xfff0, { KEY_RESERVED } },
 
@@ -304,13 +309,12 @@ static const struct key_entry dell_wmi_keymap_type_0011[] 
__initconst = {
{ KE_IGNORE, 0x02f6, { KEY_RESERVED } },
 };
 
-static struct input_dev *dell_wmi_input_dev;
-
-static void dell_wmi_process_key(int type, int code)
+static void dell_wmi_process_key(struct wmi_device *wdev, int type, int code)
 {
+   struct dell_wmi_priv *priv = dev_get_drvdata(>dev);
const struct key_entry *key;
 
-   key = sparse_keymap_entry_from_scancode(dell_wmi_input_dev,
+   key = sparse_keymap_entry_from_scancode(priv->input_dev,
(type << 16) | code);
if (!key) {
pr_info("Unknown key with type 0x%04x and code 0x%04x 
pressed\n",
@@ -333,33 +337,18 @@ static void dell_wmi_process_key(int type, int code)
dell_laptop_call_notifier(
DELL_LAPTOP_KBD_BACKLIGHT_BRIGHTNESS_CHANGED, NULL);
 
-   sparse_keymap_report_entry(dell_wmi_input_dev, key, 1, true);
+   sparse_keymap_report_entry(priv->input_dev, key, 1, true);
 }
 
-static void dell_wmi_notify(u32 value, void *context)
+static void dell_wmi_notify(struct wmi_device *wdev,
+   union acpi_object *obj)
 {
-   struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
-   union acpi_object *obj;
-   acpi_status status;
-   acpi_size buffer_size;
u16 *buffer_entry, *buffer_end;
+   acpi_size buffer_size;
int len, i;
 
-   status = wmi_get_event_data(value, );
-   if (status != AE_OK) {
-   pr_warn("bad event status 0x%x\n", status);
-   return;
-   }
-
-   obj = (union acpi_object *)response.pointer;
-   if (!obj) {
-   pr_warn("no response\n");
-   return;
-   }
-
if (obj->type != ACPI_TYPE_BUFFER) {
pr_warn("bad response type %x\n", obj->type);
-   kfree(obj);
return;
}
 
@@ -404,13 +393,14 @@ static void dell_wmi_notify(u32 value, void *context)

[PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-05-26 Thread Darren Hart
From: Andy Lutomirski 

Move some initialization out of _init and into _probe.
Update signatures and logic to use the wmi bus and device structures.

Signed-off-by: Andy Lutomirski 
[dvhart: drop deprecated sparse_keymap_free, order declarations, add commit msg]
Cc: Andy Lutomirski 
Cc: Mario Limonciello 
Cc: Pali Rohár 
Cc: Rafael Wysocki 
Cc: linux-kernel@vger.kernel.org
Cc: platform-driver-...@vger.kernel.org
Cc: linux-a...@vger.kernel.org
Signed-off-by: Darren Hart (VMware) 
---
 drivers/platform/x86/dell-wmi.c | 136 +---
 1 file changed, 70 insertions(+), 66 deletions(-)

diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index 8a64c79..badc01e 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "dell-smbios.h"
 
@@ -53,6 +54,10 @@ static bool wmi_requires_smbios_request;
 MODULE_ALIAS("wmi:"DELL_EVENT_GUID);
 MODULE_ALIAS("wmi:"DELL_DESCRIPTOR_GUID);
 
+struct dell_wmi_priv {
+   struct input_dev *input_dev;
+};
+
 static int __init dmi_matched(const struct dmi_system_id *dmi)
 {
wmi_requires_smbios_request = 1;
@@ -86,7 +91,7 @@ static const struct dmi_system_id dell_wmi_smbios_list[] 
__initconst = {
  * notifications (rather than requests for change) or are also sent
  * via the keyboard controller so should not be sent again.
  */
-static const struct key_entry dell_wmi_keymap_type_[] __initconst = {
+static const struct key_entry dell_wmi_keymap_type_[] = {
{ KE_IGNORE, 0x003a, { KEY_CAPSLOCK } },
 
/* Key code is followed by brightness level */
@@ -207,7 +212,7 @@ struct dell_dmi_results {
 };
 
 /* Uninitialized entries here are KEY_RESERVED == 0. */
-static const u16 bios_to_linux_keycode[256] __initconst = {
+static const u16 bios_to_linux_keycode[256] = {
[0] = KEY_MEDIA,
[1] = KEY_NEXTSONG,
[2] = KEY_PLAYPAUSE,
@@ -256,7 +261,7 @@ static const u16 bios_to_linux_keycode[256] __initconst = {
  * These are applied if the 0xB2 DMI hotkey table is present and doesn't
  * override them.
  */
-static const struct key_entry dell_wmi_keymap_type_0010[] __initconst = {
+static const struct key_entry dell_wmi_keymap_type_0010[] = {
/* Fn-lock */
{ KE_IGNORE, 0x151, { KEY_RESERVED } },
 
@@ -289,7 +294,7 @@ static const struct key_entry dell_wmi_keymap_type_0010[] 
__initconst = {
 /*
  * Keymap for WMI events of type 0x0011
  */
-static const struct key_entry dell_wmi_keymap_type_0011[] __initconst = {
+static const struct key_entry dell_wmi_keymap_type_0011[] = {
/* Battery unplugged */
{ KE_IGNORE, 0xfff0, { KEY_RESERVED } },
 
@@ -304,13 +309,12 @@ static const struct key_entry dell_wmi_keymap_type_0011[] 
__initconst = {
{ KE_IGNORE, 0x02f6, { KEY_RESERVED } },
 };
 
-static struct input_dev *dell_wmi_input_dev;
-
-static void dell_wmi_process_key(int type, int code)
+static void dell_wmi_process_key(struct wmi_device *wdev, int type, int code)
 {
+   struct dell_wmi_priv *priv = dev_get_drvdata(>dev);
const struct key_entry *key;
 
-   key = sparse_keymap_entry_from_scancode(dell_wmi_input_dev,
+   key = sparse_keymap_entry_from_scancode(priv->input_dev,
(type << 16) | code);
if (!key) {
pr_info("Unknown key with type 0x%04x and code 0x%04x 
pressed\n",
@@ -333,33 +337,18 @@ static void dell_wmi_process_key(int type, int code)
dell_laptop_call_notifier(
DELL_LAPTOP_KBD_BACKLIGHT_BRIGHTNESS_CHANGED, NULL);
 
-   sparse_keymap_report_entry(dell_wmi_input_dev, key, 1, true);
+   sparse_keymap_report_entry(priv->input_dev, key, 1, true);
 }
 
-static void dell_wmi_notify(u32 value, void *context)
+static void dell_wmi_notify(struct wmi_device *wdev,
+   union acpi_object *obj)
 {
-   struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
-   union acpi_object *obj;
-   acpi_status status;
-   acpi_size buffer_size;
u16 *buffer_entry, *buffer_end;
+   acpi_size buffer_size;
int len, i;
 
-   status = wmi_get_event_data(value, );
-   if (status != AE_OK) {
-   pr_warn("bad event status 0x%x\n", status);
-   return;
-   }
-
-   obj = (union acpi_object *)response.pointer;
-   if (!obj) {
-   pr_warn("no response\n");
-   return;
-   }
-
if (obj->type != ACPI_TYPE_BUFFER) {
pr_warn("bad response type %x\n", obj->type);
-   kfree(obj);
return;
}
 
@@ -404,13 +393,14 @@ static void dell_wmi_notify(u32 value, void *context)
switch (buffer_entry[1]) {
case 0x: /* One key pressed or event occurred */
if (len > 2)
-