linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] alienware-wmi: new platform and feature support
@ 2016-02-02 21:38 Mario Limonciello
  2016-02-02 21:38 ` [PATCH v3 1/6] alienware-wmi: Clean up whitespace for ASM100 platform Mario Limonciello
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Mario Limonciello @ 2016-02-02 21:38 UTC (permalink / raw)
  To: dvhart; +Cc: LKML, platform-driver-x86, Mario Limonciello

I've got some extensions for the alienware-wmi driver that have
been introduced for a few new platforms and can be controlled via the WMI
interface.

Changes from V2:
- add alienware-wmi to subjects (all patches)
- fix indentation on 2 changing comments (patch 3/6)
- remove goto error on amplifier creation (patch 3/6)
- clarify commit message (patch 4/6)
- fix line wrapping on some long lines (patch 4/6)
- remove goto error on deep sleep creation (patch 4/6)
- whitespace improvements in other parts of the driver (patch 6/6)

Changes from V1:
- Make sure whitespace changes are in their own patch
- Add commit descriptions to all patches
- Allow one line to go over 80 characters in deep sleep control patch
  Other patches may have some areas that avoid going over 80 characters
  still, but this matches the style of the existing driver.  If you would
  like these to go over 80 characters as well, please comment which areas
  this is OK.


Mario Limonciello (6):
  alienware-wmi: Clean up whitespace for ASM100 platform
  alienware-wmi: Add support for new platform: X51-R3
  alienware-wmi: Add initial support for alienware graphics amplifier.
  alienware-wmi: Add support for deep sleep control.
  alienware-wmi: Add support for two new systems: ASM200 and ASM201.
  alienware-wmi: whitespace improvements

 drivers/platform/x86/alienware-wmi.c | 291 +++++++++++++++++++++++++++++------
 1 file changed, 247 insertions(+), 44 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v3 1/6] alienware-wmi: Clean up whitespace for ASM100 platform
  2016-02-02 21:38 [PATCH v3 0/6] alienware-wmi: new platform and feature support Mario Limonciello
@ 2016-02-02 21:38 ` Mario Limonciello
  2016-02-02 21:38 ` [PATCH v3 2/6] alienware-wmi: Add support for new platform: X51-R3 Mario Limonciello
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Mario Limonciello @ 2016-02-02 21:38 UTC (permalink / raw)
  To: dvhart; +Cc: LKML, platform-driver-x86, Mario Limonciello

This brings them more in line with the usage of whitespace
in other platforms.

Signed-off-by: Mario Limonciello <mario_limonciello@dell.com>
---
 drivers/platform/x86/alienware-wmi.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c
index 1e1e594..a8750ed 100644
--- a/drivers/platform/x86/alienware-wmi.c
+++ b/drivers/platform/x86/alienware-wmi.c
@@ -105,14 +105,14 @@ static const struct dmi_system_id alienware_quirks[] __initconst = {
 	 .driver_data = &quirk_x51_family,
 	 },
 	{
-		.callback = dmi_matched,
-		.ident = "Alienware ASM100",
-		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ASM100"),
-		},
-		.driver_data = &quirk_asm100,
-	},
+	 .callback = dmi_matched,
+	 .ident = "Alienware ASM100",
+	 .matches = {
+		     DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
+		     DMI_MATCH(DMI_PRODUCT_NAME, "ASM100"),
+		     },
+	 .driver_data = &quirk_asm100,
+	 },
 	{}
 };
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 2/6] alienware-wmi: Add support for new platform: X51-R3
  2016-02-02 21:38 [PATCH v3 0/6] alienware-wmi: new platform and feature support Mario Limonciello
  2016-02-02 21:38 ` [PATCH v3 1/6] alienware-wmi: Clean up whitespace for ASM100 platform Mario Limonciello
@ 2016-02-02 21:38 ` Mario Limonciello
  2016-02-02 21:38 ` [PATCH v3 3/6] alienware-wmi: Add initial support for alienware graphics amplifier Mario Limonciello
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Mario Limonciello @ 2016-02-02 21:38 UTC (permalink / raw)
  To: dvhart; +Cc: LKML, platform-driver-x86, Mario Limonciello

The X51-R3 is in the X51 family.  It includes 3 internal
lighting zones as well as is the first AW desktop that
includes support for a graphics amplifier.

Signed-off-by: Mario Limonciello <mario_limonciello@dell.com>
---
 drivers/platform/x86/alienware-wmi.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c
index a8750ed..8e8ea4f 100644
--- a/drivers/platform/x86/alienware-wmi.c
+++ b/drivers/platform/x86/alienware-wmi.c
@@ -69,11 +69,16 @@ static struct quirk_entry quirk_unknown = {
 	.hdmi_mux = 0,
 };
 
-static struct quirk_entry quirk_x51_family = {
+static struct quirk_entry quirk_x51_r1_r2 = {
 	.num_zones = 3,
 	.hdmi_mux = 0.
 };
 
+static struct quirk_entry quirk_x51_r3 = {
+	.num_zones = 4,
+	.hdmi_mux = 0,
+};
+
 static struct quirk_entry quirk_asm100 = {
 	.num_zones = 2,
 	.hdmi_mux = 1,
@@ -88,12 +93,12 @@ static int __init dmi_matched(const struct dmi_system_id *dmi)
 static const struct dmi_system_id alienware_quirks[] __initconst = {
 	{
 	 .callback = dmi_matched,
-	 .ident = "Alienware X51 R1",
+	 .ident = "Alienware X51 R3",
 	 .matches = {
 		     DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "Alienware X51"),
+		     DMI_MATCH(DMI_PRODUCT_NAME, "Alienware X51 R3"),
 		     },
-	 .driver_data = &quirk_x51_family,
+	 .driver_data = &quirk_x51_r3,
 	 },
 	{
 	 .callback = dmi_matched,
@@ -102,7 +107,16 @@ static const struct dmi_system_id alienware_quirks[] __initconst = {
 		     DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
 		     DMI_MATCH(DMI_PRODUCT_NAME, "Alienware X51 R2"),
 		     },
-	 .driver_data = &quirk_x51_family,
+	 .driver_data = &quirk_x51_r1_r2,
+	 },
+	{
+	 .callback = dmi_matched,
+	 .ident = "Alienware X51 R1",
+	 .matches = {
+		     DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
+		     DMI_MATCH(DMI_PRODUCT_NAME, "Alienware X51"),
+		     },
+	 .driver_data = &quirk_x51_r1_r2,
 	 },
 	{
 	 .callback = dmi_matched,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 3/6] alienware-wmi: Add initial support for alienware graphics amplifier.
  2016-02-02 21:38 [PATCH v3 0/6] alienware-wmi: new platform and feature support Mario Limonciello
  2016-02-02 21:38 ` [PATCH v3 1/6] alienware-wmi: Clean up whitespace for ASM100 platform Mario Limonciello
  2016-02-02 21:38 ` [PATCH v3 2/6] alienware-wmi: Add support for new platform: X51-R3 Mario Limonciello
@ 2016-02-02 21:38 ` Mario Limonciello
  2016-02-02 21:38 ` [PATCH v3 4/6] alienware-wmi: Add support for deep sleep control Mario Limonciello
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Mario Limonciello @ 2016-02-02 21:38 UTC (permalink / raw)
  To: dvhart; +Cc: LKML, platform-driver-x86, Mario Limonciello

The alienware graphics amplifier is a device that provides external access
to a full PCIe slot, USB hub, and additional control zone.

This patch enables support for reading status whether the cable is plugged
in as well as for setting the colors in the new zone on the amplifier.

Signed-off-by: Mario Limonciello <mario_limonciello@dell.com>
---
 drivers/platform/x86/alienware-wmi.c | 106 ++++++++++++++++++++++++++++-------
 1 file changed, 87 insertions(+), 19 deletions(-)

diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c
index 8e8ea4f..7ada7ce 100644
--- a/drivers/platform/x86/alienware-wmi.c
+++ b/drivers/platform/x86/alienware-wmi.c
@@ -33,6 +33,7 @@
 #define WMAX_METHOD_BRIGHTNESS		0x3
 #define WMAX_METHOD_ZONE_CONTROL	0x4
 #define WMAX_METHOD_HDMI_CABLE		0x5
+#define WMAX_METHOD_AMPLIFIER_CABLE	0x6
 
 MODULE_AUTHOR("Mario Limonciello <mario_limonciello@dell.com>");
 MODULE_DESCRIPTION("Alienware special feature control");
@@ -60,6 +61,7 @@ enum WMAX_CONTROL_STATES {
 struct quirk_entry {
 	u8 num_zones;
 	u8 hdmi_mux;
+	u8 amplifier;
 };
 
 static struct quirk_entry *quirks;
@@ -67,21 +69,25 @@ static struct quirk_entry *quirks;
 static struct quirk_entry quirk_unknown = {
 	.num_zones = 2,
 	.hdmi_mux = 0,
+	.amplifier = 0,
 };
 
 static struct quirk_entry quirk_x51_r1_r2 = {
 	.num_zones = 3,
-	.hdmi_mux = 0.
+	.hdmi_mux = 0,
+	.amplifier = 0,
 };
 
 static struct quirk_entry quirk_x51_r3 = {
 	.num_zones = 4,
 	.hdmi_mux = 0,
+	.amplifier = 1,
 };
 
 static struct quirk_entry quirk_asm100 = {
 	.num_zones = 2,
 	.hdmi_mux = 1,
+	.amplifier = 0,
 };
 
 static int __init dmi_matched(const struct dmi_system_id *dmi)
@@ -147,7 +153,7 @@ struct wmax_brightness_args {
 	u32 percentage;
 };
 
-struct hdmi_args {
+struct wmax_basic_args {
 	u8 arg;
 };
 
@@ -232,16 +238,16 @@ static int alienware_update_led(struct platform_zone *zone)
 	char *guid;
 	struct acpi_buffer input;
 	struct legacy_led_args legacy_args;
-	struct wmax_led_args wmax_args;
+	struct wmax_led_args wmax_basic_args;
 	if (interface == WMAX) {
-		wmax_args.led_mask = 1 << zone->location;
-		wmax_args.colors = zone->colors;
-		wmax_args.state = lighting_control_state;
+		wmax_basic_args.led_mask = 1 << zone->location;
+		wmax_basic_args.colors = zone->colors;
+		wmax_basic_args.state = lighting_control_state;
 		guid = WMAX_CONTROL_GUID;
 		method_id = WMAX_METHOD_ZONE_CONTROL;
 
-		input.length = (acpi_size) sizeof(wmax_args);
-		input.pointer = &wmax_args;
+		input.length = (acpi_size) sizeof(wmax_basic_args);
+		input.pointer = &wmax_basic_args;
 	} else {
 		legacy_args.colors = zone->colors;
 		legacy_args.brightness = global_brightness;
@@ -449,11 +455,7 @@ static void alienware_zone_exit(struct platform_device *dev)
 	kfree(zone_attrs);
 }
 
-/*
-	The HDMI mux sysfs node indicates the status of the HDMI input mux.
-	It can toggle between standard system GPU output and HDMI input.
-*/
-static acpi_status alienware_hdmi_command(struct hdmi_args *in_args,
+static acpi_status alienware_wmax_command(struct wmax_basic_args *in_args,
 					  u32 command, int *out_data)
 {
 	acpi_status status;
@@ -481,16 +483,20 @@ static acpi_status alienware_hdmi_command(struct hdmi_args *in_args,
 
 }
 
+/*
+ *	The HDMI mux sysfs node indicates the status of the HDMI input mux.
+ *	It can toggle between standard system GPU output and HDMI input.
+ */
 static ssize_t show_hdmi_cable(struct device *dev,
 			       struct device_attribute *attr, char *buf)
 {
 	acpi_status status;
 	u32 out_data;
-	struct hdmi_args in_args = {
+	struct wmax_basic_args in_args = {
 		.arg = 0,
 	};
 	status =
-	    alienware_hdmi_command(&in_args, WMAX_METHOD_HDMI_CABLE,
+	    alienware_wmax_command(&in_args, WMAX_METHOD_HDMI_CABLE,
 				   (u32 *) &out_data);
 	if (ACPI_SUCCESS(status)) {
 		if (out_data == 0)
@@ -509,11 +515,11 @@ static ssize_t show_hdmi_source(struct device *dev,
 {
 	acpi_status status;
 	u32 out_data;
-	struct hdmi_args in_args = {
+	struct wmax_basic_args in_args = {
 		.arg = 0,
 	};
 	status =
-	    alienware_hdmi_command(&in_args, WMAX_METHOD_HDMI_STATUS,
+	    alienware_wmax_command(&in_args, WMAX_METHOD_HDMI_STATUS,
 				   (u32 *) &out_data);
 
 	if (ACPI_SUCCESS(status)) {
@@ -533,7 +539,7 @@ static ssize_t toggle_hdmi_source(struct device *dev,
 				  const char *buf, size_t count)
 {
 	acpi_status status;
-	struct hdmi_args args;
+	struct wmax_basic_args args;
 	if (strcmp(buf, "gpu\n") == 0)
 		args.arg = 1;
 	else if (strcmp(buf, "input\n") == 0)
@@ -542,7 +548,7 @@ static ssize_t toggle_hdmi_source(struct device *dev,
 		args.arg = 3;
 	pr_debug("alienware-wmi: setting hdmi to %d : %s", args.arg, buf);
 
-	status = alienware_hdmi_command(&args, WMAX_METHOD_HDMI_SOURCE, NULL);
+	status = alienware_wmax_command(&args, WMAX_METHOD_HDMI_SOURCE, NULL);
 
 	if (ACPI_FAILURE(status))
 		pr_err("alienware-wmi: HDMI toggle failed: results: %u\n",
@@ -585,6 +591,61 @@ error_create_hdmi:
 	return ret;
 }
 
+/* Alienware GFX amplifier support
+ * - Currently supports reading cable status
+ * - Leaving expansion room to possibly support dock/undock events later
+ */
+static ssize_t show_amplifier_status(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	acpi_status status;
+	u32 out_data;
+	struct wmax_basic_args in_args = {
+		.arg = 0,
+	};
+	status =
+	    alienware_wmax_command(&in_args, WMAX_METHOD_AMPLIFIER_CABLE,
+				   (u32 *) &out_data);
+	if (ACPI_SUCCESS(status)) {
+		if (out_data == 0)
+			return scnprintf(buf, PAGE_SIZE,
+					 "[unconnected] connected unknown\n");
+		else if (out_data == 1)
+			return scnprintf(buf, PAGE_SIZE,
+					 "unconnected [connected] unknown\n");
+	}
+	pr_err("alienware-wmi: unknown amplifier cable status: %d\n", status);
+	return scnprintf(buf, PAGE_SIZE, "unconnected connected [unknown]\n");
+}
+
+static DEVICE_ATTR(status, S_IRUGO, show_amplifier_status, NULL);
+
+static struct attribute *amplifier_attrs[] = {
+	&dev_attr_status.attr,
+	NULL,
+};
+
+static struct attribute_group amplifier_attribute_group = {
+	.name = "amplifier",
+	.attrs = amplifier_attrs,
+};
+
+static void remove_amplifier(struct platform_device *dev)
+{
+	if (quirks->amplifier > 0)
+		sysfs_remove_group(&dev->dev.kobj, &amplifier_attribute_group);
+}
+
+static int create_amplifier(struct platform_device *dev)
+{
+	int ret;
+
+	ret = sysfs_create_group(&dev->dev.kobj, &amplifier_attribute_group);
+	if (ret)
+		remove_amplifier(dev);
+	return ret;
+}
+
 static int __init alienware_wmi_init(void)
 {
 	int ret;
@@ -620,6 +681,12 @@ static int __init alienware_wmi_init(void)
 			goto fail_prep_hdmi;
 	}
 
+	if (quirks->amplifier > 0) {
+		ret = create_amplifier(platform_device);
+		if (ret)
+			goto fail_prep_amplifier;
+	}
+
 	ret = alienware_zone_init(platform_device);
 	if (ret)
 		goto fail_prep_zones;
@@ -628,6 +695,7 @@ static int __init alienware_wmi_init(void)
 
 fail_prep_zones:
 	alienware_zone_exit(platform_device);
+fail_prep_amplifier:
 fail_prep_hdmi:
 	platform_device_del(platform_device);
 fail_platform_device2:
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 4/6] alienware-wmi: Add support for deep sleep control.
  2016-02-02 21:38 [PATCH v3 0/6] alienware-wmi: new platform and feature support Mario Limonciello
                   ` (2 preceding siblings ...)
  2016-02-02 21:38 ` [PATCH v3 3/6] alienware-wmi: Add initial support for alienware graphics amplifier Mario Limonciello
@ 2016-02-02 21:38 ` Mario Limonciello
  2016-02-02 21:38 ` [PATCH v3 5/6] alienware-wmi: Add support for two new systems: ASM200 and ASM201 Mario Limonciello
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Mario Limonciello @ 2016-02-02 21:38 UTC (permalink / raw)
  To: dvhart; +Cc: LKML, platform-driver-x86, Mario Limonciello

Allow for user configuration of BIOS settings that allow the system to be
turned on via HID devices.

The feature requires hardware architectural modifications and can not be
supported on existing systems.

Signed-off-by: Mario Limonciello <mario_limonciello@dell.com>
---
 drivers/platform/x86/alienware-wmi.c | 95 ++++++++++++++++++++++++++++++++++++
 1 file changed, 95 insertions(+)

diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c
index 7ada7ce..55967dc 100644
--- a/drivers/platform/x86/alienware-wmi.c
+++ b/drivers/platform/x86/alienware-wmi.c
@@ -34,6 +34,8 @@
 #define WMAX_METHOD_ZONE_CONTROL	0x4
 #define WMAX_METHOD_HDMI_CABLE		0x5
 #define WMAX_METHOD_AMPLIFIER_CABLE	0x6
+#define WMAX_METHOD_DEEP_SLEEP_CONTROL	0x0B
+#define WMAX_METHOD_DEEP_SLEEP_STATUS	0x0C
 
 MODULE_AUTHOR("Mario Limonciello <mario_limonciello@dell.com>");
 MODULE_DESCRIPTION("Alienware special feature control");
@@ -62,6 +64,7 @@ struct quirk_entry {
 	u8 num_zones;
 	u8 hdmi_mux;
 	u8 amplifier;
+	u8 deepslp;
 };
 
 static struct quirk_entry *quirks;
@@ -70,24 +73,28 @@ static struct quirk_entry quirk_unknown = {
 	.num_zones = 2,
 	.hdmi_mux = 0,
 	.amplifier = 0,
+	.deepslp = 0,
 };
 
 static struct quirk_entry quirk_x51_r1_r2 = {
 	.num_zones = 3,
 	.hdmi_mux = 0,
 	.amplifier = 0,
+	.deepslp = 0,
 };
 
 static struct quirk_entry quirk_x51_r3 = {
 	.num_zones = 4,
 	.hdmi_mux = 0,
 	.amplifier = 1,
+	.deepslp = 0,
 };
 
 static struct quirk_entry quirk_asm100 = {
 	.num_zones = 2,
 	.hdmi_mux = 1,
 	.amplifier = 0,
+	.deepslp = 0,
 };
 
 static int __init dmi_matched(const struct dmi_system_id *dmi)
@@ -646,6 +653,87 @@ static int create_amplifier(struct platform_device *dev)
 	return ret;
 }
 
+/* Deep Sleep Control support
+ * - Modifies BIOS setting for deep sleep control allowing extra wakeup events
+ */
+static ssize_t show_deepsleep_status(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	acpi_status status;
+	u32 out_data;
+	struct wmax_basic_args in_args = {
+		.arg = 0,
+	};
+	status =
+	    alienware_wmax_command(&in_args, WMAX_METHOD_DEEP_SLEEP_STATUS,
+				   (u32 *) &out_data);
+	if (ACPI_SUCCESS(status)) {
+		if (out_data == 0)
+			return scnprintf(buf, PAGE_SIZE,
+					 "[disabled] s5 s5_s4\n");
+		else if (out_data == 1)
+			return scnprintf(buf, PAGE_SIZE,
+					 "disabled [s5] s5_s4\n");
+		else if (out_data == 2)
+			return scnprintf(buf, PAGE_SIZE,
+					 "disabled s5 [s5_s4]\n");
+	}
+	pr_err("alienware-wmi: unknown deep sleep status: %d\n", status);
+	return scnprintf(buf, PAGE_SIZE, "disabled s5 s5_s4 [unknown]\n");
+}
+
+static ssize_t toggle_deepsleep(struct device *dev,
+				struct device_attribute *attr,
+				const char *buf, size_t count)
+{
+	acpi_status status;
+	struct wmax_basic_args args;
+
+	if (strcmp(buf, "disabled\n") == 0)
+		args.arg = 0;
+	else if (strcmp(buf, "s5\n") == 0)
+		args.arg = 1;
+	else
+		args.arg = 2;
+	pr_debug("alienware-wmi: setting deep sleep to %d : %s", args.arg, buf);
+
+	status = alienware_wmax_command(&args, WMAX_METHOD_DEEP_SLEEP_CONTROL,
+					NULL);
+
+	if (ACPI_FAILURE(status))
+		pr_err("alienware-wmi: deep sleep control failed: results: %u\n",
+			status);
+	return count;
+}
+
+static DEVICE_ATTR(deepsleep, S_IRUGO | S_IWUSR, show_deepsleep_status, toggle_deepsleep);
+
+static struct attribute *deepsleep_attrs[] = {
+	&dev_attr_deepsleep.attr,
+	NULL,
+};
+
+static struct attribute_group deepsleep_attribute_group = {
+	.name = "deepsleep",
+	.attrs = deepsleep_attrs,
+};
+
+static void remove_deepsleep(struct platform_device *dev)
+{
+	if (quirks->deepslp > 0)
+		sysfs_remove_group(&dev->dev.kobj, &deepsleep_attribute_group);
+}
+
+static int create_deepsleep(struct platform_device *dev)
+{
+	int ret;
+
+	ret = sysfs_create_group(&dev->dev.kobj, &deepsleep_attribute_group);
+	if (ret)
+		remove_deepsleep(dev);
+	return ret;
+}
+
 static int __init alienware_wmi_init(void)
 {
 	int ret;
@@ -687,6 +775,12 @@ static int __init alienware_wmi_init(void)
 			goto fail_prep_amplifier;
 	}
 
+	if (quirks->deepslp > 0) {
+		ret = create_deepsleep(platform_device);
+		if (ret)
+			goto fail_prep_deepsleep;
+	}
+
 	ret = alienware_zone_init(platform_device);
 	if (ret)
 		goto fail_prep_zones;
@@ -695,6 +789,7 @@ static int __init alienware_wmi_init(void)
 
 fail_prep_zones:
 	alienware_zone_exit(platform_device);
+fail_prep_deepsleep:
 fail_prep_amplifier:
 fail_prep_hdmi:
 	platform_device_del(platform_device);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 5/6] alienware-wmi: Add support for two new systems: ASM200 and ASM201.
  2016-02-02 21:38 [PATCH v3 0/6] alienware-wmi: new platform and feature support Mario Limonciello
                   ` (3 preceding siblings ...)
  2016-02-02 21:38 ` [PATCH v3 4/6] alienware-wmi: Add support for deep sleep control Mario Limonciello
@ 2016-02-02 21:38 ` Mario Limonciello
  2016-02-02 21:38 ` [PATCH v3 6/6] alienware-wmi: whitespace improvements Mario Limonciello
  2016-02-07 20:05 ` [PATCH v3 0/6] alienware-wmi: new platform and feature support Darren Hart
  6 siblings, 0 replies; 9+ messages in thread
From: Mario Limonciello @ 2016-02-02 21:38 UTC (permalink / raw)
  To: dvhart; +Cc: LKML, platform-driver-x86, Mario Limonciello

Both of these systems support:
* 2 lighting control zones
* HDMI mux control
* deep sleep control (to enable wakup from controller)

The ASM201 also supports the external graphics amplifier.

Signed-off-by: Mario Limonciello <mario_limonciello@dell.com>
---
 drivers/platform/x86/alienware-wmi.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c
index 55967dc..0cbcda1 100644
--- a/drivers/platform/x86/alienware-wmi.c
+++ b/drivers/platform/x86/alienware-wmi.c
@@ -97,6 +97,20 @@ static struct quirk_entry quirk_asm100 = {
 	.deepslp = 0,
 };
 
+static struct quirk_entry quirk_asm200 = {
+	.num_zones = 2,
+	.hdmi_mux = 1,
+	.amplifier = 0,
+	.deepslp = 1,
+};
+
+static struct quirk_entry quirk_asm201 = {
+	.num_zones = 2,
+	.hdmi_mux = 1,
+	.amplifier = 1,
+	.deepslp = 1,
+};
+
 static int __init dmi_matched(const struct dmi_system_id *dmi)
 {
 	quirks = dmi->driver_data;
@@ -140,6 +154,24 @@ static const struct dmi_system_id alienware_quirks[] __initconst = {
 		     },
 	 .driver_data = &quirk_asm100,
 	 },
+	{
+	 .callback = dmi_matched,
+	 .ident = "Alienware ASM200",
+	 .matches = {
+		     DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
+		     DMI_MATCH(DMI_PRODUCT_NAME, "ASM200"),
+		     },
+	 .driver_data = &quirk_asm200,
+	 },
+	{
+	 .callback = dmi_matched,
+	 .ident = "Alienware ASM201",
+	 .matches = {
+		     DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
+		     DMI_MATCH(DMI_PRODUCT_NAME, "ASM201"),
+		     },
+	 .driver_data = &quirk_asm201,
+	 },
 	{}
 };
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 6/6] alienware-wmi: whitespace improvements
  2016-02-02 21:38 [PATCH v3 0/6] alienware-wmi: new platform and feature support Mario Limonciello
                   ` (4 preceding siblings ...)
  2016-02-02 21:38 ` [PATCH v3 5/6] alienware-wmi: Add support for two new systems: ASM200 and ASM201 Mario Limonciello
@ 2016-02-02 21:38 ` Mario Limonciello
  2016-02-07 20:05 ` [PATCH v3 0/6] alienware-wmi: new platform and feature support Darren Hart
  6 siblings, 0 replies; 9+ messages in thread
From: Mario Limonciello @ 2016-02-02 21:38 UTC (permalink / raw)
  To: dvhart; +Cc: LKML, platform-driver-x86, Mario Limonciello

These were some items that were pointed out in previous patches that
weren't caught be previous reviewers, but should be applied to other
parts of the driver as well.

Signed-off-by: Mario Limonciello <mario_limonciello@dell.com>
---
 drivers/platform/x86/alienware-wmi.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c
index 0cbcda1..536fee6 100644
--- a/drivers/platform/x86/alienware-wmi.c
+++ b/drivers/platform/x86/alienware-wmi.c
@@ -229,7 +229,7 @@ static u8 global_brightness;
 
 /*
  * Helpers used for zone control
-*/
+ */
 static int parse_rgb(const char *buf, struct platform_zone *zone)
 {
 	long unsigned int rgb;
@@ -269,7 +269,7 @@ static struct platform_zone *match_zone(struct device_attribute *attr)
 
 /*
  * Individual RGB zone control
-*/
+ */
 static int alienware_update_led(struct platform_zone *zone)
 {
 	int method_id;
@@ -342,7 +342,7 @@ static ssize_t zone_set(struct device *dev, struct device_attribute *attr,
 
 /*
  * LED Brightness (Global)
-*/
+ */
 static int wmax_brightness(int brightness)
 {
 	acpi_status status;
@@ -386,7 +386,7 @@ static struct led_classdev global_led = {
 
 /*
  * Lighting control state device attribute (Global)
-*/
+ */
 static ssize_t show_control_state(struct device *dev,
 				  struct device_attribute *attr, char *buf)
 {
@@ -590,14 +590,12 @@ static ssize_t toggle_hdmi_source(struct device *dev,
 	status = alienware_wmax_command(&args, WMAX_METHOD_HDMI_SOURCE, NULL);
 
 	if (ACPI_FAILURE(status))
-		pr_err("alienware-wmi: HDMI toggle failed: results: %u\n",
-		       status);
+		pr_err("alienware-wmi: HDMI toggle failed: results: %u\n", status);
 	return count;
 }
 
 static DEVICE_ATTR(cable, S_IRUGO, show_hdmi_cable, NULL);
-static DEVICE_ATTR(source, S_IRUGO | S_IWUSR, show_hdmi_source,
-		   toggle_hdmi_source);
+static DEVICE_ATTR(source, S_IRUGO | S_IWUSR, show_hdmi_source, toggle_hdmi_source);
 
 static struct attribute *hdmi_attrs[] = {
 	&dev_attr_cable.attr,
@@ -622,11 +620,7 @@ static int create_hdmi(struct platform_device *dev)
 
 	ret = sysfs_create_group(&dev->dev.kobj, &hdmi_attribute_group);
 	if (ret)
-		goto error_create_hdmi;
-	return 0;
-
-error_create_hdmi:
-	remove_hdmi(dev);
+		remove_hdmi(dev);
 	return ret;
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 0/6] alienware-wmi: new platform and feature support
  2016-02-02 21:38 [PATCH v3 0/6] alienware-wmi: new platform and feature support Mario Limonciello
                   ` (5 preceding siblings ...)
  2016-02-02 21:38 ` [PATCH v3 6/6] alienware-wmi: whitespace improvements Mario Limonciello
@ 2016-02-07 20:05 ` Darren Hart
  2016-02-15 22:51   ` Mario Limonciello
  6 siblings, 1 reply; 9+ messages in thread
From: Darren Hart @ 2016-02-07 20:05 UTC (permalink / raw)
  To: Mario Limonciello; +Cc: LKML, platform-driver-x86

On Tue, Feb 02, 2016 at 03:38:51PM -0600, Mario Limonciello wrote:
> I've got some extensions for the alienware-wmi driver that have
> been introduced for a few new platforms and can be controlled via the WMI
> interface.

Thanks Mario, and apologies for the delay. This appears functionally correct at
each patch. There were still a couple minor line wrapping and comment block
formatting issues, but given the time delay, I just took care of those myself
and annotated it in the commit messages. These are now queued to testing.

If you would like to verify my changes, they are available in the testing branch
of my tree.

-- 
Darren Hart
Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 0/6] alienware-wmi: new platform and feature support
  2016-02-07 20:05 ` [PATCH v3 0/6] alienware-wmi: new platform and feature support Darren Hart
@ 2016-02-15 22:51   ` Mario Limonciello
  0 siblings, 0 replies; 9+ messages in thread
From: Mario Limonciello @ 2016-02-15 22:51 UTC (permalink / raw)
  To: Darren Hart; +Cc: LKML, platform-driver-x86@vger.kernel.org



On 02/07/2016 02:05 PM, Darren Hart wrote:
> On Tue, Feb 02, 2016 at 03:38:51PM -0600, Mario Limonciello wrote:
>> I've got some extensions for the alienware-wmi driver that have
>> been introduced for a few new platforms and can be controlled via the WMI
>> interface.
> Thanks Mario, and apologies for the delay. This appears functionally correct at
> each patch. There were still a couple minor line wrapping and comment block
> formatting issues, but given the time delay, I just took care of those myself
> and annotated it in the commit messages. These are now queued to testing.
>
> If you would like to verify my changes, they are available in the testing branch
> of my tree.
>
Everything looks good, thanks!

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-02-15 22:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-02 21:38 [PATCH v3 0/6] alienware-wmi: new platform and feature support Mario Limonciello
2016-02-02 21:38 ` [PATCH v3 1/6] alienware-wmi: Clean up whitespace for ASM100 platform Mario Limonciello
2016-02-02 21:38 ` [PATCH v3 2/6] alienware-wmi: Add support for new platform: X51-R3 Mario Limonciello
2016-02-02 21:38 ` [PATCH v3 3/6] alienware-wmi: Add initial support for alienware graphics amplifier Mario Limonciello
2016-02-02 21:38 ` [PATCH v3 4/6] alienware-wmi: Add support for deep sleep control Mario Limonciello
2016-02-02 21:38 ` [PATCH v3 5/6] alienware-wmi: Add support for two new systems: ASM200 and ASM201 Mario Limonciello
2016-02-02 21:38 ` [PATCH v3 6/6] alienware-wmi: whitespace improvements Mario Limonciello
2016-02-07 20:05 ` [PATCH v3 0/6] alienware-wmi: new platform and feature support Darren Hart
2016-02-15 22:51   ` Mario Limonciello

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).