Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1651773 > unrolled thread

[PATCH 00/16] Convert WMI to a proper bus

Started byDarren Hart <dvhart@infradead.org>
First post2017-05-27 07:40 +0200
Last post2017-06-06 19:30 +0200
Articles 14 — 6 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/16] Convert WMI to a proper bus Darren Hart <dvhart@infradead.org> - 2017-05-27 07:40 +0200
    [PATCH 11/16] platform/x86: wmi: Add a new interface to read block data Darren Hart <dvhart@infradead.org> - 2017-05-27 07:40 +0200
    [PATCH 02/16] platform/x86: wmi: Pass the acpi_device through to parse_wdg Darren Hart <dvhart@infradead.org> - 2017-05-27 07:40 +0200
    [PATCH 04/16] platform/x86: wmi: Track wmi devices per ACPI device Darren Hart <dvhart@infradead.org> - 2017-05-27 07:40 +0200
    [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure Darren Hart <dvhart@infradead.org> - 2017-05-27 07:40 +0200
      Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure Pali Rohár <pali.rohar@gmail.com> - 2017-05-27 13:00 +0200
        Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure Andy Lutomirski <luto@kernel.org> - 2017-05-27 18:10 +0200
          Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-05-27 18:20 +0200
            Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure Andy Lutomirski <luto@kernel.org> - 2017-05-27 20:50 +0200
              Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus  infrastructure Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-05-30 04:50 +0200
                Re: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus  infrastructure Darren Hart <dvhart@infradead.org> - 2017-06-06 05:10 +0200
    Re: [PATCH 00/16] Convert WMI to a proper bus "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-05-27 22:00 +0200
      Re: [PATCH 00/16] Convert WMI to a proper bus Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 22:10 +0200
    Re: [PATCH 00/16] Convert WMI to a proper bus Darren Hart <dvhart@infradead.org> - 2017-06-06 19:30 +0200

#1651773 — [PATCH 00/16] Convert WMI to a proper bus

FromDarren Hart <dvhart@infradead.org>
Date2017-05-27 07:40 +0200
Subject[PATCH 00/16] Convert WMI to a proper bus
Message-ID<tLCCd-7vw-3@gated-at.bofh.it>
From: "Darren Hart (VMware)" <dvhart@infradead.org>

This series is based on the original work of
Andy Lutomirski <luto@amacapital.net> [1]. I have made minor edits, and in
one instance, squashed two patches in which the latter undid the former.

This series converts WMI [2] into a proper bus, adds some useful information via
sysfs, and exposes the embedded MOF [3] binary. It converts dell-wmi to use the
new WMI bus architecture.

This is the first part of an ongoing effort to enhance the WMI infrastructure
within the kernel, and eventually expose WMI to userspace for the consumption of
management utilities as it was intended.

1. https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/log/?h=platform/wmi
2. https://msdn.microsoft.com/en-us/library/windows/hardware/dn614028(v=vs.85).aspx
3. https://msdn.microsoft.com/en-us/library/aa823192(v=vs.85).aspx

Andy Lutomirski (15):
  platform/x86: wmi: Drop "Mapper (un)loaded" messages
  platform/x86: wmi: Pass the acpi_device through to parse_wdg
  platform/x86: wmi: Clean up acpi_wmi_add
  platform/x86: wmi: Track wmi devices per ACPI device
  platform/x86: wmi: Turn WMI into a bus driver
  platform/x86: wmi: Fix error handling when creating devices
  platform/x86: wmi: Split devices into types and add basic sysfs attributes
  platform/x86: wmi: Probe data objects for read and write capabilities
  platform/x86: wmi: Instantiate all devices before adding them
  platform/x86: wmi: Incorporate acpi_install_notify_handler
  platform/x86: wmi: Add a new interface to read block data
  platform/x86: wmi: Bind the platform device, not the ACPI node
  platform/x86: wmi: Add an interface for subdrivers to access sibling devices
  platform/x86: wmi-mof: New driver to expose embedded WMI MOF metadata
  platform/x86: dell-wmi: Convert to the WMI bus infrastructure

Darren Hart (VMware) (1):
  platform/x86: wmi: Require query for data blocks, rename writable to setable

 drivers/platform/x86/Kconfig    |  12 +
 drivers/platform/x86/Makefile   |   1 +
 drivers/platform/x86/dell-wmi.c | 136 ++++----
 drivers/platform/x86/wmi-mof.c  | 125 ++++++++
 drivers/platform/x86/wmi.c      | 677 ++++++++++++++++++++++++++++++++--------
 include/linux/wmi.h             |  59 ++++
 6 files changed, 815 insertions(+), 195 deletions(-)
 create mode 100644 drivers/platform/x86/wmi-mof.c
 create mode 100644 include/linux/wmi.h

-- 
2.9.4

[toc] | [next] | [standalone]


#1651774 — [PATCH 11/16] platform/x86: wmi: Add a new interface to read block data

FromDarren Hart <dvhart@infradead.org>
Date2017-05-27 07:40 +0200
Subject[PATCH 11/16] platform/x86: wmi: Add a new interface to read block data
Message-ID<tLCCf-7vw-31@gated-at.bofh.it>
In reply to#1651773
From: Andy Lutomirski <luto@kernel.org>

wmi_query_block is unnecessarily indirect. Add a straightforward
method for wmi bus drivers to use to read block data.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Mario Limonciello <mario_limonciello@dell.com>
Cc: Pali Rohár <pali.rohar@gmail.com>
Cc: Rafael Wysocki <rjw@rjwysocki.net>
Cc: linux-kernel@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-acpi@vger.kernel.org
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
---
 drivers/platform/x86/wmi.c | 54 ++++++++++++++++++++++++++++++++--------------
 include/linux/wmi.h        |  4 ++++
 2 files changed, 42 insertions(+), 16 deletions(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 208e187..483e4a6 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -244,19 +244,10 @@ u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out)
 }
 EXPORT_SYMBOL_GPL(wmi_evaluate_method);
 
-/**
- * wmi_query_block - Return contents of a WMI block
- * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba
- * @instance: Instance index
- * &out: Empty buffer to return the contents of the data block to
- *
- * Return the contents of an ACPI-WMI data block to a buffer
- */
-acpi_status wmi_query_block(const char *guid_string, u8 instance,
-struct acpi_buffer *out)
+static acpi_status __query_block(struct wmi_block *wblock, u8 instance,
+				 struct acpi_buffer *out)
 {
 	struct guid_block *block = NULL;
-	struct wmi_block *wblock = NULL;
 	acpi_handle handle;
 	acpi_status status, wc_status = AE_ERROR;
 	struct acpi_object_list input;
@@ -264,12 +255,9 @@ struct acpi_buffer *out)
 	char method[5];
 	char wc_method[5] = "WC";
 
-	if (!guid_string || !out)
+	if (!out)
 		return AE_BAD_PARAMETER;
 
-	if (!find_guid(guid_string, &wblock))
-		return AE_ERROR;
-
 	block = &wblock->gblock;
 	handle = wblock->acpi_device->handle;
 
@@ -320,8 +308,42 @@ struct acpi_buffer *out)
 
 	return status;
 }
+
+/**
+ * wmi_query_block - Return contents of a WMI block (deprecated)
+ * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba
+ * @instance: Instance index
+ * &out: Empty buffer to return the contents of the data block to
+ *
+ * Return the contents of an ACPI-WMI data block to a buffer
+ */
+acpi_status wmi_query_block(const char *guid_string, u8 instance,
+			    struct acpi_buffer *out)
+{
+	struct wmi_block *wblock;
+
+	if (!guid_string)
+		return AE_BAD_PARAMETER;
+
+	if (!find_guid(guid_string, &wblock))
+		return AE_ERROR;
+
+	return __query_block(wblock, instance, out);
+}
 EXPORT_SYMBOL_GPL(wmi_query_block);
 
+union acpi_object *wmidev_block_query(struct wmi_device *wdev, u8 instance)
+{
+	struct acpi_buffer out = { ACPI_ALLOCATE_BUFFER, NULL };
+	struct wmi_block *wblock = container_of(wdev, struct wmi_block, dev);
+
+	if (ACPI_FAILURE(__query_block(wblock, instance, &out)))
+		return NULL;
+
+	return (union acpi_object *)out.pointer;
+}
+EXPORT_SYMBOL_GPL(wmidev_block_query);
+
 /**
  * wmi_set_block - Write to a WMI block
  * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba
@@ -331,7 +353,7 @@ EXPORT_SYMBOL_GPL(wmi_query_block);
  * Write the contents of the input buffer to an ACPI-WMI data block
  */
 acpi_status wmi_set_block(const char *guid_string, u8 instance,
-const struct acpi_buffer *in)
+			  const struct acpi_buffer *in)
 {
 	struct guid_block *block = NULL;
 	struct wmi_block *wblock = NULL;
diff --git a/include/linux/wmi.h b/include/linux/wmi.h
index c6eedfd..0ab2540 100644
--- a/include/linux/wmi.h
+++ b/include/linux/wmi.h
@@ -29,6 +29,10 @@ struct wmi_device {
 	bool readable, writeable;
 };
 
+/* Caller must kfree the result. */
+extern union acpi_object *wmidev_block_query(struct wmi_device *wdev,
+					     u8 instance);
+
 struct wmi_device_id {
 	const char *guid_string;
 };
-- 
2.9.4

[toc] | [prev] | [next] | [standalone]


#1651775 — [PATCH 02/16] platform/x86: wmi: Pass the acpi_device through to parse_wdg

FromDarren Hart <dvhart@infradead.org>
Date2017-05-27 07:40 +0200
Subject[PATCH 02/16] platform/x86: wmi: Pass the acpi_device through to parse_wdg
Message-ID<tLCCf-7vw-25@gated-at.bofh.it>
In reply to#1651773
From: Andy Lutomirski <luto@kernel.org>

We will need the device to convert to a bus architecture and bind WMI to
the platform device.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Mario Limonciello <mario_limonciello@dell.com>
Cc: Pali Rohár <pali.rohar@gmail.com>
Cc: Rafael Wysocki <rjw@rjwysocki.net>
Cc: linux-kernel@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-acpi@vger.kernel.org
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
---
 drivers/platform/x86/wmi.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 0043581..c6e11b5 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -606,7 +606,8 @@ static struct class wmi_class = {
 };
 
 static int wmi_create_device(const struct guid_block *gblock,
-			     struct wmi_block *wblock, acpi_handle handle)
+			     struct wmi_block *wblock,
+			     struct acpi_device *device)
 {
 	wblock->dev.class = &wmi_class;
 
@@ -645,7 +646,7 @@ static bool guid_already_parsed(const char *guid_string)
 /*
  * Parse the _WDG method for the GUID data blocks
  */
-static int parse_wdg(acpi_handle handle)
+static int parse_wdg(struct acpi_device *device)
 {
 	struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
 	union acpi_object *obj;
@@ -655,7 +656,7 @@ static int parse_wdg(acpi_handle handle)
 	int retval;
 	u32 i, total;
 
-	status = acpi_evaluate_object(handle, "_WDG", NULL, &out);
+	status = acpi_evaluate_object(device->handle, "_WDG", NULL, &out);
 	if (ACPI_FAILURE(status))
 		return -ENXIO;
 
@@ -679,7 +680,7 @@ static int parse_wdg(acpi_handle handle)
 		if (!wblock)
 			return -ENOMEM;
 
-		wblock->handle = handle;
+		wblock->handle = device->handle;
 		wblock->gblock = gblock[i];
 
 		/*
@@ -689,7 +690,7 @@ static int parse_wdg(acpi_handle handle)
 		  for device creation.
 		*/
 		if (!guid_already_parsed(gblock[i].guid)) {
-			retval = wmi_create_device(&gblock[i], wblock, handle);
+			retval = wmi_create_device(&gblock[i], wblock, device);
 			if (retval) {
 				wmi_free_devices();
 				goto out_free_pointer;
@@ -806,7 +807,7 @@ static int acpi_wmi_add(struct acpi_device *device)
 		return -ENODEV;
 	}
 
-	error = parse_wdg(device->handle);
+	error = parse_wdg(device);
 	if (error) {
 		acpi_remove_address_space_handler(device->handle,
 						  ACPI_ADR_SPACE_EC,
-- 
2.9.4

[toc] | [prev] | [next] | [standalone]


#1651776 — [PATCH 04/16] platform/x86: wmi: Track wmi devices per ACPI device

FromDarren Hart <dvhart@infradead.org>
Date2017-05-27 07:40 +0200
Subject[PATCH 04/16] platform/x86: wmi: Track wmi devices per ACPI device
Message-ID<tLCCf-7vw-33@gated-at.bofh.it>
In reply to#1651773
From: Andy Lutomirski <luto@kernel.org>

Currently we free all devices when we detach from any ACPI node.
Instead, keep track of which node WMI devices are attached to and
free them only as needed. While we are at it, match up notifications
with the device they came from correctly.

This will make our behavior more straightforward on systems with
more than one WMI node in the ACPI tables (e.g. the Dell XPS 13
9350).

This also adds a warning when GUIDs are not unique.

NB: The guid_string parameter in guid_already_parsed was a
little-endian binary GUID, not a string.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Mario Limonciello <mario_limonciello@dell.com>
Cc: Pali Rohár <pali.rohar@gmail.com>
Cc: Rafael Wysocki <rjw@rjwysocki.net>
Cc: linux-kernel@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-acpi@vger.kernel.org
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
---
 drivers/platform/x86/wmi.c | 58 ++++++++++++++++++++++++++++------------------
 1 file changed, 36 insertions(+), 22 deletions(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index ac60a51..faaa9a7 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -64,7 +64,7 @@ struct guid_block {
 struct wmi_block {
 	struct list_head list;
 	struct guid_block gblock;
-	acpi_handle handle;
+	struct acpi_device *acpi_device;
 	wmi_notify_handler handler;
 	void *handler_data;
 	struct device dev;
@@ -147,7 +147,7 @@ static acpi_status wmi_method_enable(struct wmi_block *wblock, int enable)
 	acpi_handle handle;
 
 	block = &wblock->gblock;
-	handle = wblock->handle;
+	handle = wblock->acpi_device->handle;
 
 	snprintf(method, 5, "WE%02X", block->notify_id);
 	status = acpi_execute_simple_method(handle, method, enable);
@@ -186,7 +186,7 @@ u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out)
 		return AE_ERROR;
 
 	block = &wblock->gblock;
-	handle = wblock->handle;
+	handle = wblock->acpi_device->handle;
 
 	if (!(block->flags & ACPI_WMI_METHOD))
 		return AE_BAD_DATA;
@@ -248,7 +248,7 @@ struct acpi_buffer *out)
 		return AE_ERROR;
 
 	block = &wblock->gblock;
-	handle = wblock->handle;
+	handle = wblock->acpi_device->handle;
 
 	if (block->instance_count < instance)
 		return AE_BAD_PARAMETER;
@@ -321,7 +321,7 @@ const struct acpi_buffer *in)
 		return AE_ERROR;
 
 	block = &wblock->gblock;
-	handle = wblock->handle;
+	handle = wblock->acpi_device->handle;
 
 	if (block->instance_count < instance)
 		return AE_BAD_PARAMETER;
@@ -525,8 +525,8 @@ acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out)
 
 		if ((gblock->flags & ACPI_WMI_EVENT) &&
 			(gblock->notify_id == event))
-			return acpi_evaluate_object(wblock->handle, "_WED",
-				&input, out);
+			return acpi_evaluate_object(wblock->acpi_device->handle,
+				"_WED", &input, out);
 	}
 
 	return AE_NOT_FOUND;
@@ -618,27 +618,40 @@ static int wmi_create_device(const struct guid_block *gblock,
 	return device_register(&wblock->dev);
 }
 
-static void wmi_free_devices(void)
+static void wmi_free_devices(struct acpi_device *device)
 {
 	struct wmi_block *wblock, *next;
 
 	/* Delete devices for all the GUIDs */
 	list_for_each_entry_safe(wblock, next, &wmi_block_list, list) {
-		list_del(&wblock->list);
-		if (wblock->dev.class)
-			device_unregister(&wblock->dev);
-		else
-			kfree(wblock);
+		if (wblock->acpi_device == device) {
+			list_del(&wblock->list);
+			if (wblock->dev.class)
+				device_unregister(&wblock->dev);
+			else
+				kfree(wblock);
+		}
 	}
 }
 
-static bool guid_already_parsed(const char *guid_string)
+static bool guid_already_parsed(struct acpi_device *device,
+				const u8 *guid)
 {
 	struct wmi_block *wblock;
 
-	list_for_each_entry(wblock, &wmi_block_list, list)
-		if (memcmp(wblock->gblock.guid, guid_string, 16) == 0)
+	list_for_each_entry(wblock, &wmi_block_list, list) {
+		if (memcmp(wblock->gblock.guid, guid, 16) == 0) {
+			/*
+			 * Because we historically didn't track the relationship
+			 * between GUIDs and ACPI nodes, we don't know whether
+			 * we need to suppress GUIDs that are unique on a
+			 * given node but duplicated across nodes.
+			 */
+			dev_warn(&device->dev, "duplicate WMI GUID %pUL (first instance was on %s)\n",
+				 guid, dev_name(&wblock->acpi_device->dev));
 			return true;
+		}
+	}
 
 	return false;
 }
@@ -680,7 +693,7 @@ static int parse_wdg(struct acpi_device *device)
 		if (!wblock)
 			return -ENOMEM;
 
-		wblock->handle = device->handle;
+		wblock->acpi_device = device;
 		wblock->gblock = gblock[i];
 
 		/*
@@ -689,10 +702,10 @@ static int parse_wdg(struct acpi_device *device)
 		  case yet, so for now, we'll just ignore the duplicate
 		  for device creation.
 		*/
-		if (!guid_already_parsed(gblock[i].guid)) {
+		if (!guid_already_parsed(device, gblock[i].guid)) {
 			retval = wmi_create_device(&gblock[i], wblock, device);
 			if (retval) {
-				wmi_free_devices();
+				wmi_free_devices(device);
 				goto out_free_pointer;
 			}
 		}
@@ -767,8 +780,9 @@ static void acpi_wmi_notify(struct acpi_device *device, u32 event)
 		wblock = list_entry(p, struct wmi_block, list);
 		block = &wblock->gblock;
 
-		if ((block->flags & ACPI_WMI_EVENT) &&
-			(block->notify_id == event)) {
+		if (wblock->acpi_device == device &&
+		    (block->flags & ACPI_WMI_EVENT) &&
+		    (block->notify_id == event)) {
 			if (wblock->handler)
 				wblock->handler(event, wblock->handler_data);
 			if (debug_event) {
@@ -788,7 +802,7 @@ static int acpi_wmi_remove(struct acpi_device *device)
 {
 	acpi_remove_address_space_handler(device->handle,
 				ACPI_ADR_SPACE_EC, &acpi_wmi_ec_space_handler);
-	wmi_free_devices();
+	wmi_free_devices(device);
 
 	return 0;
 }
-- 
2.9.4

[toc] | [prev] | [next] | [standalone]


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

FromDarren Hart <dvhart@infradead.org>
Date2017-05-27 07:40 +0200
Subject[PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure
Message-ID<tLCCf-7vw-29@gated-at.bofh.it>
In reply to#1651773
From: Andy Lutomirski <luto@kernel.org>

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 <luto@kernel.org>
[dvhart: drop deprecated sparse_keymap_free, order declarations, add commit msg]
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Mario Limonciello <mario_limonciello@dell.com>
Cc: Pali Rohár <pali.rohar@gmail.com>
Cc: Rafael Wysocki <rjw@rjwysocki.net>
Cc: linux-kernel@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-acpi@vger.kernel.org
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
---
 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 <linux/acpi.h>
 #include <linux/string.h>
 #include <linux/dmi.h>
+#include <linux/wmi.h>
 #include <acpi/video.h>
 #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_0000[] __initconst = {
+static const struct key_entry dell_wmi_keymap_type_0000[] = {
 	{ 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(&wdev->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, &response);
-	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 0x0000: /* One key pressed or event occurred */
 			if (len > 2)
-				dell_wmi_process_key(0x0000, buffer_entry[2]);
+				dell_wmi_process_key(wdev, 0x0000,
+						     buffer_entry[2]);
 			/* Other entries could contain additional information */
 			break;
 		case 0x0010: /* Sequence of keys pressed */
 		case 0x0011: /* Sequence of events occurred */
 			for (i = 2; i < len; ++i)
-				dell_wmi_process_key(buffer_entry[1],
+				dell_wmi_process_key(wdev, buffer_entry[1],
 						     buffer_entry[i]);
 			break;
 		default: /* Unknown event */
@@ -423,7 +413,6 @@ static void dell_wmi_notify(u32 value, void *context)
 
 	}
 
-	kfree(obj);
 }
 
 static bool have_scancode(u32 scancode, const struct key_entry *keymap, int len)
@@ -437,9 +426,7 @@ static bool have_scancode(u32 scancode, const struct key_entry *keymap, int len)
 	return false;
 }
 
-static void __init handle_dmi_entry(const struct dmi_header *dm,
-				    void *opaque)
-
+static void handle_dmi_entry(const struct dmi_header *dm, void *opaque)
 {
 	struct dell_dmi_results *results = opaque;
 	struct dell_bios_hotkey_table *table;
@@ -509,19 +496,20 @@ static void __init handle_dmi_entry(const struct dmi_header *dm,
 	results->keymap_size = pos;
 }
 
-static int __init dell_wmi_input_setup(void)
+static int dell_wmi_input_setup(struct wmi_device *wdev)
 {
+	struct dell_wmi_priv *priv = dev_get_drvdata(&wdev->dev);
 	struct dell_dmi_results dmi_results = {};
 	struct key_entry *keymap;
 	int err, i, pos = 0;
 
-	dell_wmi_input_dev = input_allocate_device();
-	if (!dell_wmi_input_dev)
+	priv->input_dev = input_allocate_device();
+	if (!priv->input_dev)
 		return -ENOMEM;
 
-	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;
+	priv->input_dev->dev.parent = &wdev->dev;
 
 	if (dmi_walk(handle_dmi_entry, &dmi_results)) {
 		/*
@@ -596,7 +584,7 @@ static int __init dell_wmi_input_setup(void)
 
 	keymap[pos].type = KE_END;
 
-	err = sparse_keymap_setup(dell_wmi_input_dev, keymap, NULL);
+	err = sparse_keymap_setup(priv->input_dev, keymap, NULL);
 	/*
 	 * Sparse keymap library makes a copy of keymap so we don't need the
 	 * original one that was allocated.
@@ -605,17 +593,24 @@ static int __init dell_wmi_input_setup(void)
 	if (err)
 		goto err_free_dev;
 
-	err = input_register_device(dell_wmi_input_dev);
+	err = input_register_device(priv->input_dev);
 	if (err)
 		goto err_free_dev;
 
 	return 0;
 
  err_free_dev:
-	input_free_device(dell_wmi_input_dev);
+	input_free_device(priv->input_dev);
 	return err;
 }
 
+static void dell_wmi_input_destroy(struct wmi_device *wdev)
+{
+	struct dell_wmi_priv *priv = dev_get_drvdata(&wdev->dev);
+
+	input_unregister_device(priv->input_dev);
+}
+
 /*
  * Descriptor buffer is 128 byte long and contains:
  *
@@ -714,46 +709,55 @@ static int dell_wmi_events_set_enabled(bool enable)
 	return dell_smbios_error(ret);
 }
 
+static int dell_wmi_probe(struct wmi_device *wdev)
+{
+	struct dell_wmi_priv *priv = devm_kzalloc(
+		&wdev->dev, sizeof(struct dell_wmi_priv), GFP_KERNEL);
+
+	dev_set_drvdata(&wdev->dev, priv);
+
+	return dell_wmi_input_setup(wdev);
+}
+
+static int dell_wmi_remove(struct wmi_device *wdev)
+{
+	dell_wmi_input_destroy(wdev);
+	return 0;
+}
+static const struct wmi_device_id dell_wmi_id_table[] = {
+	{ .guid_string = DELL_EVENT_GUID },
+	{ },
+};
+
+static struct wmi_driver dell_wmi_driver = {
+	.driver = {
+		.name = "dell-wmi",
+	},
+	.id_table = dell_wmi_id_table,
+	.probe = dell_wmi_probe,
+	.remove = dell_wmi_remove,
+	.notify = dell_wmi_notify,
+};
+
 static int __init dell_wmi_init(void)
 {
 	int err;
-	acpi_status status;
-
-	if (!wmi_has_guid(DELL_EVENT_GUID) ||
-	    !wmi_has_guid(DELL_DESCRIPTOR_GUID)) {
-		pr_warn("Dell WMI GUID were not found\n");
-		return -ENODEV;
-	}
 
 	err = dell_wmi_check_descriptor_buffer();
 	if (err)
 		return err;
 
-	err = dell_wmi_input_setup();
-	if (err)
-		return err;
-
-	status = wmi_install_notify_handler(DELL_EVENT_GUID,
-					 dell_wmi_notify, NULL);
-	if (ACPI_FAILURE(status)) {
-		input_unregister_device(dell_wmi_input_dev);
-		pr_err("Unable to register notify handler - %d\n", status);
-		return -ENODEV;
-	}
-
 	dmi_check_system(dell_wmi_smbios_list);
 
 	if (wmi_requires_smbios_request) {
 		err = dell_wmi_events_set_enabled(true);
 		if (err) {
 			pr_err("Failed to enable WMI events\n");
-			wmi_remove_notify_handler(DELL_EVENT_GUID);
-			input_unregister_device(dell_wmi_input_dev);
 			return err;
 		}
 	}
 
-	return 0;
+	return wmi_driver_register(&dell_wmi_driver);
 }
 module_init(dell_wmi_init);
 
@@ -761,7 +765,7 @@ static void __exit dell_wmi_exit(void)
 {
 	if (wmi_requires_smbios_request)
 		dell_wmi_events_set_enabled(false);
-	wmi_remove_notify_handler(DELL_EVENT_GUID);
-	input_unregister_device(dell_wmi_input_dev);
+
+	wmi_driver_unregister(&dell_wmi_driver);
 }
 module_exit(dell_wmi_exit);
-- 
2.9.4

[toc] | [prev] | [next] | [standalone]


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

FromPali Rohár <pali.rohar@gmail.com>
Date2017-05-27 13:00 +0200
SubjectRe: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure
Message-ID<tLHBU-2aL-7@gated-at.bofh.it>
In reply to#1651777

[Multipart message — attachments visible in raw view] — view raw

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.rohar@gmail.com

[toc] | [prev] | [next] | [standalone]


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

FromAndy Lutomirski <luto@kernel.org>
Date2017-05-27 18:10 +0200
SubjectRe: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure
Message-ID<tLMrU-6fP-37@gated-at.bofh.it>
In reply to#1651853
On Sat, May 27, 2017 at 3:50 AM, Pali Rohár <pali.rohar@gmail.com> 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.

[toc] | [prev] | [next] | [standalone]


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

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-05-27 18:20 +0200
SubjectRe: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure
Message-ID<tLMBA-6jn-23@gated-at.bofh.it>
In reply to#1651910
On May 27, 2017 9:04:38 AM PDT, Andy Lutomirski <luto@kernel.org> wrote:
>On Sat, May 27, 2017 at 3:50 AM, Pali Rohár <pali.rohar@gmail.com>
>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

[toc] | [prev] | [next] | [standalone]


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

FromAndy Lutomirski <luto@kernel.org>
Date2017-05-27 20:50 +0200
SubjectRe: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure
Message-ID<tLOWJ-7Id-5@gated-at.bofh.it>
In reply to#1651919
On Sat, May 27, 2017 at 9:17 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On May 27, 2017 9:04:38 AM PDT, Andy Lutomirski <luto@kernel.org> wrote:
>>On Sat, May 27, 2017 at 3:50 AM, Pali Rohár <pali.rohar@gmail.com>
>>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.

[toc] | [prev] | [next] | [standalone]


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

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-05-30 04:50 +0200
SubjectRe: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure
Message-ID<tMFol-XX-1@gated-at.bofh.it>
In reply to#1651956
On Sat, May 27, 2017 at 11:40:52AM -0700, Andy Lutomirski wrote:
> On Sat, May 27, 2017 at 9:17 AM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > On May 27, 2017 9:04:38 AM PDT, Andy Lutomirski <luto@kernel.org> wrote:
> >>On Sat, May 27, 2017 at 3:50 AM, Pali Rohár <pali.rohar@gmail.com>
> >>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

[toc] | [prev] | [next] | [standalone]


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

FromDarren Hart <dvhart@infradead.org>
Date2017-06-06 05:10 +0200
SubjectRe: [PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure
Message-ID<tPd2y-3dl-13@gated-at.bofh.it>
In reply to#1652779
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
> > <dmitry.torokhov@gmail.com> wrote:
> > > On May 27, 2017 9:04:38 AM PDT, Andy Lutomirski <luto@kernel.org> wrote:
> > >>On Sat, May 27, 2017 at 3:50 AM, Pali Rohár <pali.rohar@gmail.com>
> > >>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

[toc] | [prev] | [next] | [standalone]


#1651970

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2017-05-27 22:00 +0200
Message-ID<tLQ2u-8qB-25@gated-at.bofh.it>
In reply to#1651773
On Friday, May 26, 2017 10:31:14 PM Darren Hart wrote:
> From: "Darren Hart (VMware)" <dvhart@infradead.org>
> 
> This series is based on the original work of
> Andy Lutomirski <luto@amacapital.net> [1]. I have made minor edits, and in
> one instance, squashed two patches in which the latter undid the former.
> 
> This series converts WMI [2] into a proper bus, adds some useful information via
> sysfs, and exposes the embedded MOF [3] binary. It converts dell-wmi to use the
> new WMI bus architecture.
> 
> This is the first part of an ongoing effort to enhance the WMI infrastructure
> within the kernel, and eventually expose WMI to userspace for the consumption of
> management utilities as it was intended.
> 
> 1. https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/log/?h=platform/wmi
> 2. https://msdn.microsoft.com/en-us/library/windows/hardware/dn614028(v=vs.85).aspx
> 3. https://msdn.microsoft.com/en-us/library/aa823192(v=vs.85).aspx
> 
> Andy Lutomirski (15):
>   platform/x86: wmi: Drop "Mapper (un)loaded" messages
>   platform/x86: wmi: Pass the acpi_device through to parse_wdg
>   platform/x86: wmi: Clean up acpi_wmi_add
>   platform/x86: wmi: Track wmi devices per ACPI device
>   platform/x86: wmi: Turn WMI into a bus driver
>   platform/x86: wmi: Fix error handling when creating devices
>   platform/x86: wmi: Split devices into types and add basic sysfs attributes
>   platform/x86: wmi: Probe data objects for read and write capabilities
>   platform/x86: wmi: Instantiate all devices before adding them
>   platform/x86: wmi: Incorporate acpi_install_notify_handler
>   platform/x86: wmi: Add a new interface to read block data
>   platform/x86: wmi: Bind the platform device, not the ACPI node
>   platform/x86: wmi: Add an interface for subdrivers to access sibling devices
>   platform/x86: wmi-mof: New driver to expose embedded WMI MOF metadata
>   platform/x86: dell-wmi: Convert to the WMI bus infrastructure
> 
> Darren Hart (VMware) (1):
>   platform/x86: wmi: Require query for data blocks, rename writable to setable
> 
>  drivers/platform/x86/Kconfig    |  12 +
>  drivers/platform/x86/Makefile   |   1 +
>  drivers/platform/x86/dell-wmi.c | 136 ++++----
>  drivers/platform/x86/wmi-mof.c  | 125 ++++++++
>  drivers/platform/x86/wmi.c      | 677 ++++++++++++++++++++++++++++++++--------
>  include/linux/wmi.h             |  59 ++++
>  6 files changed, 815 insertions(+), 195 deletions(-)
>  create mode 100644 drivers/platform/x86/wmi-mof.c
>  create mode 100644 include/linux/wmi.h

All of this makes sense from the ACPI core perspective, so

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

for the series and I'm assuming that it will go in via the platform/x86 tree.

Thanks,
Rafael

[toc] | [prev] | [next] | [standalone]


#1651973

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2017-05-27 22:10 +0200
Message-ID<tLQc9-hL-1@gated-at.bofh.it>
In reply to#1651970
On Sat, May 27, 2017 at 10:49 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> On Friday, May 26, 2017 10:31:14 PM Darren Hart wrote:
>> From: "Darren Hart (VMware)" <dvhart@infradead.org>
>>
>> This series is based on the original work of
>> Andy Lutomirski <luto@amacapital.net> [1]. I have made minor edits, and in
>> one instance, squashed two patches in which the latter undid the former.
>>
>> This series converts WMI [2] into a proper bus, adds some useful information via
>> sysfs, and exposes the embedded MOF [3] binary. It converts dell-wmi to use the
>> new WMI bus architecture.
>>
>> This is the first part of an ongoing effort to enhance the WMI infrastructure
>> within the kernel, and eventually expose WMI to userspace for the consumption of
>> management utilities as it was intended.
>>
>> 1. https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/log/?h=platform/wmi
>> 2. https://msdn.microsoft.com/en-us/library/windows/hardware/dn614028(v=vs.85).aspx
>> 3. https://msdn.microsoft.com/en-us/library/aa823192(v=vs.85).aspx
>>
>> Andy Lutomirski (15):
>>   platform/x86: wmi: Drop "Mapper (un)loaded" messages
>>   platform/x86: wmi: Pass the acpi_device through to parse_wdg
>>   platform/x86: wmi: Clean up acpi_wmi_add
>>   platform/x86: wmi: Track wmi devices per ACPI device
>>   platform/x86: wmi: Turn WMI into a bus driver
>>   platform/x86: wmi: Fix error handling when creating devices
>>   platform/x86: wmi: Split devices into types and add basic sysfs attributes
>>   platform/x86: wmi: Probe data objects for read and write capabilities
>>   platform/x86: wmi: Instantiate all devices before adding them
>>   platform/x86: wmi: Incorporate acpi_install_notify_handler
>>   platform/x86: wmi: Add a new interface to read block data
>>   platform/x86: wmi: Bind the platform device, not the ACPI node
>>   platform/x86: wmi: Add an interface for subdrivers to access sibling devices
>>   platform/x86: wmi-mof: New driver to expose embedded WMI MOF metadata
>>   platform/x86: dell-wmi: Convert to the WMI bus infrastructure
>>
>> Darren Hart (VMware) (1):
>>   platform/x86: wmi: Require query for data blocks, rename writable to setable
>>
>>  drivers/platform/x86/Kconfig    |  12 +
>>  drivers/platform/x86/Makefile   |   1 +
>>  drivers/platform/x86/dell-wmi.c | 136 ++++----
>>  drivers/platform/x86/wmi-mof.c  | 125 ++++++++
>>  drivers/platform/x86/wmi.c      | 677 ++++++++++++++++++++++++++++++++--------
>>  include/linux/wmi.h             |  59 ++++
>>  6 files changed, 815 insertions(+), 195 deletions(-)
>>  create mode 100644 drivers/platform/x86/wmi-mof.c
>>  create mode 100644 include/linux/wmi.h
>
> All of this makes sense from the ACPI core perspective, so
>
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Thanks, Rafael.

> for the series and I'm assuming that it will go in via the platform/x86 tree.

Correct.

-- 
With Best Regards,
Andy Shevchenko

[toc] | [prev] | [next] | [standalone]


#1658968

FromDarren Hart <dvhart@infradead.org>
Date2017-06-06 19:30 +0200
Message-ID<tPqsN-3lq-9@gated-at.bofh.it>
In reply to#1651773
On Fri, May 26, 2017 at 10:31:14PM -0700, Darren Hart wrote:
> From: "Darren Hart (VMware)" <dvhart@infradead.org>
> 
> This series is based on the original work of
> Andy Lutomirski <luto@amacapital.net> [1]. I have made minor edits, and in
> one instance, squashed two patches in which the latter undid the former.
> 
> This series converts WMI [2] into a proper bus, adds some useful information via
> sysfs, and exposes the embedded MOF [3] binary. It converts dell-wmi to use the
> new WMI bus architecture.
> 
> This is the first part of an ongoing effort to enhance the WMI infrastructure
> within the kernel, and eventually expose WMI to userspace for the consumption of
> management utilities as it was intended.

I have incorporated all feedback, all of it minor, and with confirmation for
those modifications, have committed the series to the testing branch:

http://git.infradead.org/linux-platform-drivers-x86.git/shortlog/refs/heads/testing

We would appreciate any additional real-world testing anyone can offer.

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web