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

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

Merge branch 'for_linus' of...

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86:
  hp-wmi: fix use after free
  dell-laptop - using buffer without mutex_lock
  Revert: "dell-laptop: Toggle the unsupported hardware killswitch"
  platform-drivers-x86: set backlight type to BACKLIGHT_PLATFORM
  thinkpad-acpi: handle HKEY 0x4010, 0x4011 events
  drivers/platform/x86: Fix memory leak
  thinkpad-acpi: handle some new HKEY 0x60xx events
  acer-wmi: fix bitwise bug when set device state
  acer-wmi: Only update rfkill status for associated hotkey events
parents 83e95697 0401846c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -534,6 +534,8 @@ Events that are never propagated by the driver:
0x2404		System is waking up from hibernation to undock
0x2405		System is waking up from hibernation to eject bay
0x5010		Brightness level changed/control event
0x6000		KEYBOARD: Numlock key pressed
0x6005		KEYBOARD: Fn key pressed (TO BE VERIFIED)

Events that are propagated by the driver to userspace:

@@ -545,6 +547,8 @@ Events that are propagated by the driver to userspace:
0x3006		Bay hotplug request (hint to power up SATA link when
		the optical drive tray is ejected)
0x4003		Undocked (see 0x2x04), can sleep again
0x4010		Docked into hotplug port replicator (non-ACPI dock)
0x4011		Undocked from hotplug port replicator (non-ACPI dock)
0x500B		Tablet pen inserted into its storage bay
0x500C		Tablet pen removed from its storage bay
0x6011		ALARM: battery is too hot
@@ -552,6 +556,7 @@ Events that are propagated by the driver to userspace:
0x6021		ALARM: a sensor is too hot
0x6022		ALARM: a sensor is extremely hot
0x6030		System thermal table changed
0x6040		Nvidia Optimus/AC adapter related (TO BE VERIFIED)

Battery nearly empty alarms are a last resort attempt to get the
operating system to hibernate or shutdown cleanly (0x2313), or shutdown
+29 −18
Original line number Diff line number Diff line
@@ -1156,9 +1156,9 @@ static acpi_status wmid3_set_device_status(u32 value, u16 device)
	struct wmid3_gds_input_param params = {
		.function_num = 0x1,
		.hotkey_number = 0x01,
		.devices = ACER_WMID3_GDS_WIRELESS &
				ACER_WMID3_GDS_THREEG &
				ACER_WMID3_GDS_WIMAX &
		.devices = ACER_WMID3_GDS_WIRELESS |
				ACER_WMID3_GDS_THREEG |
				ACER_WMID3_GDS_WIMAX |
				ACER_WMID3_GDS_BLUETOOTH,
	};
	struct acpi_buffer input = {
@@ -1445,6 +1445,8 @@ static void acer_wmi_notify(u32 value, void *context)
	union acpi_object *obj;
	struct event_return_value return_value;
	acpi_status status;
	u16 device_state;
	const struct key_entry *key;

	status = wmi_get_event_data(value, &response);
	if (status != AE_OK) {
@@ -1472,23 +1474,32 @@ static void acer_wmi_notify(u32 value, void *context)

	switch (return_value.function) {
	case WMID_HOTKEY_EVENT:
		if (return_value.device_state) {
			u16 device_state = return_value.device_state;
		device_state = return_value.device_state;
		pr_debug("device state: 0x%x\n", device_state);

		key = sparse_keymap_entry_from_scancode(acer_wmi_input_dev,
							return_value.key_num);
		if (!key) {
			pr_warn("Unknown key number - 0x%x\n",
				return_value.key_num);
		} else {
			switch (key->keycode) {
			case KEY_WLAN:
			case KEY_BLUETOOTH:
				if (has_cap(ACER_CAP_WIRELESS))
					rfkill_set_sw_state(wireless_rfkill,
						!(device_state & ACER_WMID3_GDS_WIRELESS));
			if (has_cap(ACER_CAP_BLUETOOTH))
				rfkill_set_sw_state(bluetooth_rfkill,
				!(device_state & ACER_WMID3_GDS_BLUETOOTH));
				if (has_cap(ACER_CAP_THREEG))
					rfkill_set_sw_state(threeg_rfkill,
						!(device_state & ACER_WMID3_GDS_THREEG));
				if (has_cap(ACER_CAP_BLUETOOTH))
					rfkill_set_sw_state(bluetooth_rfkill,
						!(device_state & ACER_WMID3_GDS_BLUETOOTH));
				break;
			}
			sparse_keymap_report_entry(acer_wmi_input_dev, key,
						   1, true);
		}
		if (!sparse_keymap_report_event(acer_wmi_input_dev,
				return_value.key_num, 1, true))
			pr_warn("Unknown key number - 0x%x\n",
				return_value.key_num);
		break;
	default:
		pr_warn("Unknown function number - %d - %d\n",
+1 −0
Original line number Diff line number Diff line
@@ -1025,6 +1025,7 @@ static int asus_wmi_backlight_init(struct asus_wmi *asus)
		return power;

	memset(&props, 0, sizeof(struct backlight_properties));
	props.type = BACKLIGHT_PLATFORM;
	props.max_brightness = max;
	bd = backlight_device_register(asus->driver->name,
				       &asus->platform_device->dev, asus,
+3 −1
Original line number Diff line number Diff line
@@ -1030,8 +1030,10 @@ static int __devinit compal_probe(struct platform_device *pdev)
	initialize_fan_control_data(data);

	err = sysfs_create_group(&pdev->dev.kobj, &compal_attribute_group);
	if (err)
	if (err) {
		kfree(data);
		return err;
	}

	data->hwmon_dev = hwmon_device_register(&pdev->dev);
	if (IS_ERR(data->hwmon_dev)) {
+5 −25
Original line number Diff line number Diff line
@@ -292,12 +292,9 @@ static int dell_rfkill_set(void *data, bool blocked)
	dell_send_request(buffer, 17, 11);

	/* If the hardware switch controls this radio, and the hardware
	   switch is disabled, don't allow changing the software state.
	   If the hardware switch is reported as not supported, always
	   fire the SMI to toggle the killswitch. */
	   switch is disabled, don't allow changing the software state */
	if ((hwswitch_state & BIT(hwswitch_bit)) &&
	    !(buffer->output[1] & BIT(16)) &&
	    (buffer->output[1] & BIT(0))) {
	    !(buffer->output[1] & BIT(16))) {
		ret = -EINVAL;
		goto out;
	}
@@ -403,23 +400,6 @@ static const struct file_operations dell_debugfs_fops = {

static void dell_update_rfkill(struct work_struct *ignored)
{
	int status;

	get_buffer();
	dell_send_request(buffer, 17, 11);
	status = buffer->output[1];
	release_buffer();

	/* if hardware rfkill is not supported, set it explicitly */
	if (!(status & BIT(0))) {
		if (wifi_rfkill)
			dell_rfkill_set((void *)1, !((status & BIT(17)) >> 17));
		if (bluetooth_rfkill)
			dell_rfkill_set((void *)2, !((status & BIT(18)) >> 18));
		if (wwan_rfkill)
			dell_rfkill_set((void *)3, !((status & BIT(19)) >> 19));
	}

	if (wifi_rfkill)
		dell_rfkill_query(wifi_rfkill, (void *)1);
	if (bluetooth_rfkill)
@@ -560,11 +540,11 @@ static int dell_get_intensity(struct backlight_device *bd)
	else
		dell_send_request(buffer, 0, 1);

	ret = buffer->output[1];

out:
	release_buffer();
	if (ret)
	return ret;
	return buffer->output[1];
}

static const struct backlight_ops dell_ops = {
Loading