Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a77c0058 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86

Pull x86 platform drivers from Matthew Garrett:
 "Small set of updates, mainly trivial bugfixes and some small updates
  to deal with newer hardware.

  There's also a new driver that allows qemu guests to notify the
  hypervisor that they've just paniced, which seems useful."

* 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86:
  Add support for fan button on Ideapad Z580
  pvpanic: pvpanic device driver
  asus-nb-wmi: set wapf=4 for ASUSTeK COMPUTER INC. X75A
  drivers: platform: x86: Use PTR_RET function
  sony-laptop: SVS151290S kbd backlight and gfx switch support
  hp-wmi: add more definitions for new event_id's
  dell-laptop: Fix krealloc() misuse in parse_da_table()
  hp_accel: Ignore the error from lis3lv02d_poweron() at resume
  dell: add new dell WMI format for the AIO machines
parents 3644bc2e a1ec56ed
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -781,4 +781,12 @@ config APPLE_GMUX
	  graphics as well as the backlight. Currently only backlight
	  control is supported by the driver.

config PVPANIC
	tristate "pvpanic device support"
	depends on ACPI
	---help---
	  This driver provides support for the pvpanic device.  pvpanic is
	  a paravirtualized device provided by QEMU; it lets a virtual machine
	  (guest) communicate panic events to the host.

endif # X86_PLATFORM_DEVICES
+2 −0
Original line number Diff line number Diff line
@@ -51,3 +51,5 @@ obj-$(CONFIG_INTEL_OAKTRAIL) += intel_oaktrail.o
obj-$(CONFIG_SAMSUNG_Q10)	+= samsung-q10.o
obj-$(CONFIG_APPLE_GMUX)	+= apple-gmux.o
obj-$(CONFIG_CHROMEOS_LAPTOP)	+= chromeos_laptop.o

obj-$(CONFIG_PVPANIC)           += pvpanic.o
+9 −0
Original line number Diff line number Diff line
@@ -171,6 +171,15 @@ static struct dmi_system_id asus_quirks[] = {
		},
		.driver_data = &quirk_asus_x401u,
	},
	{
		.callback = dmi_matched,
		.ident = "ASUSTeK COMPUTER INC. X75A",
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
			DMI_MATCH(DMI_PRODUCT_NAME, "X75A"),
		},
		.driver_data = &quirk_asus_x401u,
	},
	{},
};

+48 −5
Original line number Diff line number Diff line
@@ -34,6 +34,14 @@ MODULE_LICENSE("GPL");
#define EVENT_GUID1 "284A0E6B-380E-472A-921F-E52786257FB4"
#define EVENT_GUID2 "02314822-307C-4F66-BF0E-48AEAEB26CC8"

struct dell_wmi_event {
	u16	length;
	/* 0x000: A hot key pressed or an event occurred
	 * 0x00F: A sequence of hot keys are pressed */
	u16	type;
	u16	event[];
};

static const char *dell_wmi_aio_guids[] = {
	EVENT_GUID1,
	EVENT_GUID2,
@@ -46,15 +54,41 @@ MODULE_ALIAS("wmi:"EVENT_GUID2);
static const struct key_entry dell_wmi_aio_keymap[] = {
	{ KE_KEY, 0xc0, { KEY_VOLUMEUP } },
	{ KE_KEY, 0xc1, { KEY_VOLUMEDOWN } },
	{ KE_KEY, 0xe030, { KEY_VOLUMEUP } },
	{ KE_KEY, 0xe02e, { KEY_VOLUMEDOWN } },
	{ KE_KEY, 0xe020, { KEY_MUTE } },
	{ KE_KEY, 0xe027, { KEY_DISPLAYTOGGLE } },
	{ KE_KEY, 0xe006, { KEY_BRIGHTNESSUP } },
	{ KE_KEY, 0xe005, { KEY_BRIGHTNESSDOWN } },
	{ KE_KEY, 0xe00b, { KEY_SWITCHVIDEOMODE } },
	{ KE_END, 0 }
};

static struct input_dev *dell_wmi_aio_input_dev;

/*
 * The new WMI event data format will follow the dell_wmi_event structure
 * So, we will check if the buffer matches the format
 */
static bool dell_wmi_aio_event_check(u8 *buffer, int length)
{
	struct dell_wmi_event *event = (struct dell_wmi_event *)buffer;

	if (event == NULL || length < 6)
		return false;

	if ((event->type == 0 || event->type == 0xf) &&
			event->length >= 2)
		return true;

	return false;
}

static void dell_wmi_aio_notify(u32 value, void *context)
{
	struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
	union acpi_object *obj;
	struct dell_wmi_event *event;
	acpi_status status;

	status = wmi_get_event_data(value, &response);
@@ -65,7 +99,7 @@ static void dell_wmi_aio_notify(u32 value, void *context)

	obj = (union acpi_object *)response.pointer;
	if (obj) {
		unsigned int scancode;
		unsigned int scancode = 0;

		switch (obj->type) {
		case ACPI_TYPE_INTEGER:
@@ -75,13 +109,22 @@ static void dell_wmi_aio_notify(u32 value, void *context)
				scancode, 1, true);
			break;
		case ACPI_TYPE_BUFFER:
			/* Broken machines return the scancode in a buffer */
			if (obj->buffer.pointer && obj->buffer.length > 0) {
			if (dell_wmi_aio_event_check(obj->buffer.pointer,
						obj->buffer.length)) {
				event = (struct dell_wmi_event *)
					obj->buffer.pointer;
				scancode = event->event[0];
			} else {
				/* Broken machines return the scancode in a
				   buffer */
				if (obj->buffer.pointer &&
						obj->buffer.length > 0)
					scancode = obj->buffer.pointer[0];
			}
			if (scancode)
				sparse_keymap_report_event(
					dell_wmi_aio_input_dev,
					scancode, 1, true);
			}
			break;
		}
	}
+24 −0
Original line number Diff line number Diff line
@@ -71,6 +71,14 @@ enum hp_wmi_event_ids {
	HPWMI_WIRELESS = 5,
	HPWMI_CPU_BATTERY_THROTTLE = 6,
	HPWMI_LOCK_SWITCH = 7,
	HPWMI_LID_SWITCH = 8,
	HPWMI_SCREEN_ROTATION = 9,
	HPWMI_COOLSENSE_SYSTEM_MOBILE = 0x0A,
	HPWMI_COOLSENSE_SYSTEM_HOT = 0x0B,
	HPWMI_PROXIMITY_SENSOR = 0x0C,
	HPWMI_BACKLIT_KB_BRIGHTNESS = 0x0D,
	HPWMI_PEAKSHIFT_PERIOD = 0x0F,
	HPWMI_BATTERY_CHARGE_PERIOD = 0x10,
};

struct bios_args {
@@ -536,6 +544,22 @@ static void hp_wmi_notify(u32 value, void *context)
		break;
	case HPWMI_LOCK_SWITCH:
		break;
	case HPWMI_LID_SWITCH:
		break;
	case HPWMI_SCREEN_ROTATION:
		break;
	case HPWMI_COOLSENSE_SYSTEM_MOBILE:
		break;
	case HPWMI_COOLSENSE_SYSTEM_HOT:
		break;
	case HPWMI_PROXIMITY_SENSOR:
		break;
	case HPWMI_BACKLIT_KB_BRIGHTNESS:
		break;
	case HPWMI_PEAKSHIFT_PERIOD:
		break;
	case HPWMI_BATTERY_CHARGE_PERIOD:
		break;
	default:
		pr_info("Unknown event_id - %d - 0x%x\n", event_id, event_data);
		break;
Loading