Skip to content

Commit

Permalink
Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers…
Browse files Browse the repository at this point in the history
…-x86

Pull x86 platform driver updates from Matthew Garrett:
 "Very little of excitement here - the most significant is a new driver
  for detecting device freefall on Dells, other than that it's pretty
  much entirely minor fixes for specific machines"

* 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86:
  hp-wmi: Enable hotkeys on some systems
  thinkpad_acpi: Add mappings for F9 - F12 hotkeys on X240 / T440 / T540
  platform: x86: dell-smo8800: Dell Latitude freefall driver (ACPI SMO8800/SMO8810)
  ideapad_laptop: Introduce the use of the managed version of kzalloc
  platform/x86: Fix run-time dependencies of OLPC drivers
  platform: x86: asus-wmi.c: Cleaning up uninitialized variables
  ix86/mid/thermal: Introduce the use of the managed version of kzalloc
  platform x86 Kconfig: Refer to the laptop list in the Compal driver help
  Documentation: Add list of laptop models supported by the Compal driver
  ideapad-laptop: Blacklist rfkill control on the Lenovo Yoga 2 11
  asus-wmi: Set WAPF to 4 for Asus X550CA
  alienware-wmi: For WMAX HDMI method, introduce a way to query HDMI cable status
  alienware-wmi: Update WMAX brightness method limit to 15
  pvpanic: Set high notifier priority
  platform/x86: samsung-laptop: Add support for Samsung's NP7[34]0U3E models.
  toshiba_acpi: Add alternative keymap support for Satellite M840
  platform-drivers-x86: intel_pmic_gpio: Fix off-by-one valid offset range check
  • Loading branch information
Linus Torvalds committed Jun 10, 2014
2 parents 9ee4d7a + f82bdd0 commit 2937f5e
Show file tree
Hide file tree
Showing 15 changed files with 485 additions and 65 deletions.
18 changes: 18 additions & 0 deletions Documentation/platform/x86-laptop-drivers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
compal-laptop
=============
List of supported hardware:

by Compal:
Compal FL90/IFL90
Compal FL91/IFL91
Compal FL92/JFL92
Compal FT00/IFT00

by Dell:
Dell Vostro 1200
Dell Mini 9 (Inspiron 910)
Dell Mini 10 (Inspiron 1010)
Dell Mini 10v (Inspiron 1011)
Dell Mini 1012 (Inspiron 1012)
Dell Inspiron 11z (Inspiron 1110)
Dell Mini 12 (Inspiron 1210)
31 changes: 20 additions & 11 deletions drivers/platform/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ config DELL_LAPTOP
default n
---help---
This driver adds support for rfkill and backlight control to Dell
laptops.
laptops (except for some models covered by the Compal driver).

config DELL_WMI
tristate "Dell WMI extras"
Expand All @@ -127,6 +127,16 @@ config DELL_WMI_AIO
To compile this driver as a module, choose M here: the module will
be called dell-wmi-aio.

config DELL_SMO8800
tristate "Dell Latitude freefall driver (ACPI SMO8800/SMO8810)"
depends on ACPI
---help---
Say Y here if you want to support SMO8800/SMO8810 freefall device
on Dell Latitude laptops.

To compile this driver as a module, choose M here: the module will
be called dell-smo8800.


config FUJITSU_LAPTOP
tristate "Fujitsu Laptop Extras"
Expand Down Expand Up @@ -265,23 +275,21 @@ config PANASONIC_LAPTOP
R2, R3, R5, T2, W2 and Y2 series), say Y.

config COMPAL_LAPTOP
tristate "Compal Laptop Extras"
tristate "Compal (and others) Laptop Extras"
depends on ACPI
depends on BACKLIGHT_CLASS_DEVICE
depends on RFKILL
depends on HWMON
depends on POWER_SUPPLY
---help---
This is a driver for laptops built by Compal:

Compal FL90/IFL90
Compal FL91/IFL91
Compal FL92/JFL92
Compal FT00/IFT00
This is a driver for laptops built by Compal, and some models by
other brands (e.g. Dell, Toshiba).

It adds support for Bluetooth, WLAN and LCD brightness control.
It adds support for rfkill, Bluetooth, WLAN and LCD brightness
control.

If you have an Compal FL9x/IFL9x/FT00 laptop, say Y or M here.
For a (possibly incomplete) list of supported laptops, please refer
to: Documentation/platform/x86-laptop-drivers.txt

config SONY_LAPTOP
tristate "Sony Laptop Extras"
Expand Down Expand Up @@ -724,14 +732,15 @@ config IBM_RTL

config XO1_RFKILL
tristate "OLPC XO-1 software RF kill switch"
depends on OLPC
depends on OLPC || COMPILE_TEST
depends on RFKILL
---help---
Support for enabling/disabling the WLAN interface on the OLPC XO-1
laptop.

config XO15_EBOOK
tristate "OLPC XO-1.5 ebook switch"
depends on OLPC || COMPILE_TEST
depends on ACPI && INPUT
---help---
Support for the ebook switch on the OLPC XO-1.5 laptop.
Expand Down
1 change: 1 addition & 0 deletions drivers/platform/x86/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ obj-$(CONFIG_COMPAL_LAPTOP) += compal-laptop.o
obj-$(CONFIG_DELL_LAPTOP) += dell-laptop.o
obj-$(CONFIG_DELL_WMI) += dell-wmi.o
obj-$(CONFIG_DELL_WMI_AIO) += dell-wmi-aio.o
obj-$(CONFIG_DELL_SMO8800) += dell-smo8800.o
obj-$(CONFIG_ACER_WMI) += acer-wmi.o
obj-$(CONFIG_ACERHDF) += acerhdf.o
obj-$(CONFIG_HP_ACCEL) += hp_accel.o
Expand Down
121 changes: 89 additions & 32 deletions drivers/platform/x86/alienware-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#define WMAX_METHOD_HDMI_STATUS 0x2
#define WMAX_METHOD_BRIGHTNESS 0x3
#define WMAX_METHOD_ZONE_CONTROL 0x4
#define WMAX_METHOD_HDMI_CABLE 0x5

MODULE_AUTHOR("Mario Limonciello <mario_limonciello@dell.com>");
MODULE_DESCRIPTION("Alienware special feature control");
Expand Down Expand Up @@ -350,12 +351,11 @@ static int alienware_zone_init(struct platform_device *dev)
char *name;

if (interface == WMAX) {
global_led.max_brightness = 100;
lighting_control_state = WMAX_RUNNING;
} else if (interface == LEGACY) {
global_led.max_brightness = 0x0F;
lighting_control_state = LEGACY_RUNNING;
}
global_led.max_brightness = 0x0F;
global_brightness = global_led.max_brightness;

/*
Expand Down Expand Up @@ -423,41 +423,85 @@ static void alienware_zone_exit(struct platform_device *dev)
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(struct device *dev, struct device_attribute *attr,
char *buf)
static acpi_status alienware_hdmi_command(struct hdmi_args *in_args,
u32 command, int *out_data)
{
acpi_status status;
struct acpi_buffer input;
union acpi_object *obj;
u32 tmp = 0;
struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_buffer input;
struct acpi_buffer output;

input.length = (acpi_size) sizeof(*in_args);
input.pointer = in_args;
if (out_data != NULL) {
output.length = ACPI_ALLOCATE_BUFFER;
output.pointer = NULL;
status = wmi_evaluate_method(WMAX_CONTROL_GUID, 1,
command, &input, &output);
} else
status = wmi_evaluate_method(WMAX_CONTROL_GUID, 1,
command, &input, NULL);

if (ACPI_SUCCESS(status) && out_data != NULL) {
obj = (union acpi_object *)output.pointer;
if (obj && obj->type == ACPI_TYPE_INTEGER)
*out_data = (u32) obj->integer.value;
}
return status;

}

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 = {
.arg = 0,
};
input.length = (acpi_size) sizeof(in_args);
input.pointer = &in_args;
status = wmi_evaluate_method(WMAX_CONTROL_GUID, 1,
WMAX_METHOD_HDMI_STATUS, &input, &output);
status =
alienware_hdmi_command(&in_args, WMAX_METHOD_HDMI_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 HDMI cable status: %d\n", status);
return scnprintf(buf, PAGE_SIZE, "unconnected connected [unknown]\n");
}

static ssize_t show_hdmi_source(struct device *dev,
struct device_attribute *attr, char *buf)
{
acpi_status status;
u32 out_data;
struct hdmi_args in_args = {
.arg = 0,
};
status =
alienware_hdmi_command(&in_args, WMAX_METHOD_HDMI_STATUS,
(u32 *) &out_data);

if (ACPI_SUCCESS(status)) {
obj = (union acpi_object *)output.pointer;
if (obj && obj->type == ACPI_TYPE_INTEGER)
tmp = (u32) obj->integer.value;
if (tmp == 1)
if (out_data == 1)
return scnprintf(buf, PAGE_SIZE,
"[input] gpu unknown\n");
else if (tmp == 2)
else if (out_data == 2)
return scnprintf(buf, PAGE_SIZE,
"input [gpu] unknown\n");
}
pr_err("alienware-wmi: unknown HDMI status: %d\n", status);
pr_err("alienware-wmi: unknown HDMI source status: %d\n", out_data);
return scnprintf(buf, PAGE_SIZE, "input gpu [unknown]\n");
}

static ssize_t toggle_hdmi(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
static ssize_t toggle_hdmi_source(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct acpi_buffer input;
acpi_status status;
struct hdmi_args args;
if (strcmp(buf, "gpu\n") == 0)
Expand All @@ -467,33 +511,46 @@ static ssize_t toggle_hdmi(struct device *dev, struct device_attribute *attr,
else
args.arg = 3;
pr_debug("alienware-wmi: setting hdmi to %d : %s", args.arg, buf);
input.length = (acpi_size) sizeof(args);
input.pointer = &args;
status = wmi_evaluate_method(WMAX_CONTROL_GUID, 1,
WMAX_METHOD_HDMI_SOURCE, &input, NULL);

status = alienware_hdmi_command(&args, WMAX_METHOD_HDMI_SOURCE, NULL);

if (ACPI_FAILURE(status))
pr_err("alienware-wmi: HDMI toggle failed: results: %u\n",
status);
return count;
}

static DEVICE_ATTR(hdmi, S_IRUGO | S_IWUSR, show_hdmi, toggle_hdmi);
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 struct attribute *hdmi_attrs[] = {
&dev_attr_cable.attr,
&dev_attr_source.attr,
NULL,
};

static void remove_hdmi(struct platform_device *device)
static struct attribute_group hdmi_attribute_group = {
.name = "hdmi",
.attrs = hdmi_attrs,
};

static void remove_hdmi(struct platform_device *dev)
{
device_remove_file(&device->dev, &dev_attr_hdmi);
sysfs_remove_group(&dev->dev.kobj, &hdmi_attribute_group);
}

static int create_hdmi(void)
static int create_hdmi(struct platform_device *dev)
{
int ret = -ENOMEM;
ret = device_create_file(&platform_device->dev, &dev_attr_hdmi);
int ret;

ret = sysfs_create_group(&dev->dev.kobj, &hdmi_attribute_group);
if (ret)
goto error_create_hdmi;
return 0;

error_create_hdmi:
remove_hdmi(platform_device);
remove_hdmi(dev);
return ret;
}

Expand Down Expand Up @@ -527,7 +584,7 @@ static int __init alienware_wmi_init(void)
goto fail_platform_device2;

if (interface == WMAX) {
ret = create_hdmi();
ret = create_hdmi(platform_device);
if (ret)
goto fail_prep_hdmi;
}
Expand Down
9 changes: 9 additions & 0 deletions drivers/platform/x86/asus-nb-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ static struct dmi_system_id asus_quirks[] = {
},
.driver_data = &quirk_asus_x401u,
},
{
.callback = dmi_matched,
.ident = "ASUSTeK COMPUTER INC. X550CA",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X550CA"),
},
.driver_data = &quirk_asus_x401u,
},
{
.callback = dmi_matched,
.ident = "ASUSTeK COMPUTER INC. X55A",
Expand Down
4 changes: 1 addition & 3 deletions drivers/platform/x86/asus-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1,
struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
acpi_status status;
union acpi_object *obj;
u32 tmp;
u32 tmp = 0;

status = wmi_evaluate_method(ASUS_WMI_MGMT_GUID, 1, method_id,
&input, &output);
Expand All @@ -277,8 +277,6 @@ static int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1,
obj = (union acpi_object *)output.pointer;
if (obj && obj->type == ACPI_TYPE_INTEGER)
tmp = (u32) obj->integer.value;
else
tmp = 0;

if (retval)
*retval = tmp;
Expand Down
Loading

0 comments on commit 2937f5e

Please sign in to comment.