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

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

Merge tag 'platform-drivers-x86-v4.4-1' of...

Merge tag 'platform-drivers-x86-v4.4-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull x86 platform driver update from Darren Hart:
 "Various toshiba hotkey and keyboard related fixes and a new WMI
  driver.  Several intel_scu_ipc cleanups and a locking fix.  A
  spattering of small single fixes across various platforms.

  I was asked to pick up an OLPC cleanup as the driver appeared
  unmaintained and it seemed similar to what is maintained in
  platform/drivers/x86.  I have included the patch and an update to the
  MAINTAINERS file.

  toshiba_acpi:
   - Initialize hotkey_event_type variable
   - Remove unneeded u32 variables from *setup_keyboard
   - Add 0x prefix to available_kbd_modes_show function
   - Change default Hotkey enabling value
   - Unify hotkey enabling functions

  toshiba-wmi:
   - Toshiba WMI Hotkey Driver

  intel_scu_ipc:
   - Protect dev member assignment on ->remove()
   - Switch to use module_pci_driver() macro
   - Convert to use struct device *
   - Propagate pointer to struct intel_scu_ipc_dev
   - Fix error path by turning to devm_* / pcim_*

  acer-wmi:
   - remove threeg and interface sysfs interfaces

  OLPC:
   - Use %*ph specifier instead of passing direct values

  MAINTAINERS:
   - Add drivers/platform/olpc to drivers/platform/x86

  sony-laptop:
   - Fix handling sony_nc_hotkeys_decode result

  intel_mid_powerbtn:
   - Remove misuse of IRQF_NO_SUSPEND flag

  compal-laptop:
   - Add charge control limit

  asus-wmi:
   - restore kbd led level after resume"

* tag 'platform-drivers-x86-v4.4-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
  toshiba_acpi: Initialize hotkey_event_type variable
  intel_scu_ipc: Protect dev member assignment on ->remove()
  intel_scu_ipc: Switch to use module_pci_driver() macro
  intel_scu_ipc: Convert to use struct device *
  intel_scu_ipc: Propagate pointer to struct intel_scu_ipc_dev
  intel_scu_ipc: Fix error path by turning to devm_* / pcim_*
  acer-wmi: remove threeg and interface sysfs interfaces
  OLPC: Use %*ph specifier instead of passing direct values
  MAINTAINERS: Add drivers/platform/olpc to drivers/platform/x86
  platform/x86: Toshiba WMI Hotkey Driver
  sony-laptop: Fix handling sony_nc_hotkeys_decode result
  intel_mid_powerbtn: Remove misuse of IRQF_NO_SUSPEND flag
  compal-laptop: Add charge control limit
  asus-wmi: restore kbd led level after resume
  toshiba_acpi: Remove unneeded u32 variables from *setup_keyboard
  toshiba_acpi: Add 0x prefix to available_kbd_modes_show function
  toshiba_acpi: Change default Hotkey enabling value
  toshiba_acpi: Unify hotkey enabling functions
parents 2f4bf528 d2f20619
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -10699,6 +10699,12 @@ L: platform-driver-x86@vger.kernel.org
S:	Maintained
F:	drivers/platform/x86/toshiba_haps.c

TOSHIBA WMI HOTKEYS DRIVER
M:	Azael Avalos <coproscefalo@gmail.com>
L:	platform-driver-x86@vger.kernel.org
S:	Maintained
F:	drivers/platform/x86/toshiba-wmi.c

TOSHIBA SMM DRIVER
M:	Jonathan Buzzard <jonathan@buzzard.org.uk>
W:	http://www.buzzard.org.uk/toshiba/
@@ -11621,6 +11627,7 @@ L: platform-driver-x86@vger.kernel.org
T:	git git://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git
S:	Maintained
F:	drivers/platform/x86/
F:	drivers/platform/olpc/

X86 MCE INFRASTRUCTURE
M:	Tony Luck <tony.luck@intel.com>
+5 −8
Original line number Diff line number Diff line
@@ -192,18 +192,15 @@ static ssize_t ec_dbgfs_cmd_write(struct file *file, const char __user *buf,
	for (i = 0; i <= ec_cmd_bytes; i++)
		ec_cmd[i] = ec_cmd_int[i];

	pr_debug("olpc-ec: debugfs cmd 0x%02x with %d args %02x %02x %02x %02x %02x, want %d returns\n",
			ec_cmd[0], ec_cmd_bytes, ec_cmd[1], ec_cmd[2],
			ec_cmd[3], ec_cmd[4], ec_cmd[5], ec_dbgfs_resp_bytes);
	pr_debug("olpc-ec: debugfs cmd 0x%02x with %d args %5ph, want %d returns\n",
			ec_cmd[0], ec_cmd_bytes, ec_cmd + 1,
			ec_dbgfs_resp_bytes);

	olpc_ec_cmd(ec_cmd[0], (ec_cmd_bytes == 0) ? NULL : &ec_cmd[1],
			ec_cmd_bytes, ec_dbgfs_resp, ec_dbgfs_resp_bytes);

	pr_debug("olpc-ec: response %02x %02x %02x %02x %02x %02x %02x %02x (%d bytes expected)\n",
			ec_dbgfs_resp[0], ec_dbgfs_resp[1], ec_dbgfs_resp[2],
			ec_dbgfs_resp[3], ec_dbgfs_resp[4], ec_dbgfs_resp[5],
			ec_dbgfs_resp[6], ec_dbgfs_resp[7],
			ec_dbgfs_resp_bytes);
	pr_debug("olpc-ec: response %8ph (%d bytes expected)\n",
			ec_dbgfs_resp, ec_dbgfs_resp_bytes);

out:
	mutex_unlock(&ec_dbgfs_lock);
+20 −2
Original line number Diff line number Diff line
@@ -309,8 +309,8 @@ config COMPAL_LAPTOP
	  This is a driver for laptops built by Compal, and some models by
	  other brands (e.g. Dell, Toshiba).

	  It adds support for rfkill, Bluetooth, WLAN and LCD brightness
	  control.
	  It adds support for rfkill, Bluetooth, WLAN, LCD brightness, hwmon
	  and battery charging level control.

	  For a (possibly incomplete) list of supported laptops, please refer
	  to: Documentation/platform/x86-laptop-drivers.txt
@@ -700,6 +700,24 @@ config TOSHIBA_HAPS
	  If you have a recent Toshiba laptop with a built-in accelerometer
	  device, say Y.

config TOSHIBA_WMI
	tristate "Toshiba WMI Hotkeys Driver (EXPERIMENTAL)"
	default n
	depends on ACPI_WMI
	depends on INPUT
	select INPUT_SPARSEKMAP
	---help---
	  This driver adds hotkey monitoring support to some Toshiba models
	  that manage the hotkeys via WMI events.

	  WARNING: This driver is incomplete as it lacks a proper keymap and the
	  *notify function only prints the ACPI event type value. Be warned that
	  you will need to provide some information if you have a Toshiba model
	  with WMI event hotkeys and want to help with the develpment of this
	  driver.

	  If you have a WMI-based hotkeys Toshiba laptop, say Y or M here.

config ACPI_CMPC
	tristate "CMPC Laptop Extras"
	depends on X86 && ACPI
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o

obj-$(CONFIG_TOSHIBA_BT_RFKILL)	+= toshiba_bluetooth.o
obj-$(CONFIG_TOSHIBA_HAPS)	+= toshiba_haps.o
obj-$(CONFIG_TOSHIBA_WMI)	+= toshiba-wmi.o
obj-$(CONFIG_INTEL_SCU_IPC)	+= intel_scu_ipc.o
obj-$(CONFIG_INTEL_SCU_IPC_UTIL) += intel_scu_ipcutil.o
obj-$(CONFIG_INTEL_MFLD_THERMAL) += intel_mid_thermal.o
+0 −92
Original line number Diff line number Diff line
@@ -1662,58 +1662,6 @@ static void acer_rfkill_exit(void)
	return;
}

/*
 * sysfs interface
 */
static ssize_t show_bool_threeg(struct device *dev,
	struct device_attribute *attr, char *buf)
{
	u32 result; \
	acpi_status status;

	pr_info("This threeg sysfs will be removed in 2014 - used by: %s\n",
		current->comm);
	status = get_u32(&result, ACER_CAP_THREEG);
	if (ACPI_SUCCESS(status))
		return sprintf(buf, "%u\n", result);
	return sprintf(buf, "Read error\n");
}

static ssize_t set_bool_threeg(struct device *dev,
	struct device_attribute *attr, const char *buf, size_t count)
{
	u32 tmp = simple_strtoul(buf, NULL, 10);
	acpi_status status = set_u32(tmp, ACER_CAP_THREEG);
	pr_info("This threeg sysfs will be removed in 2014 - used by: %s\n",
		current->comm);
	if (ACPI_FAILURE(status))
		return -EINVAL;
	return count;
}
static DEVICE_ATTR(threeg, S_IRUGO | S_IWUSR, show_bool_threeg,
	set_bool_threeg);

static ssize_t show_interface(struct device *dev, struct device_attribute *attr,
	char *buf)
{
	pr_info("This interface sysfs will be removed in 2014 - used by: %s\n",
		current->comm);
	switch (interface->type) {
	case ACER_AMW0:
		return sprintf(buf, "AMW0\n");
	case ACER_AMW0_V2:
		return sprintf(buf, "AMW0 v2\n");
	case ACER_WMID:
		return sprintf(buf, "WMID\n");
	case ACER_WMID_v2:
		return sprintf(buf, "WMID v2\n");
	default:
		return sprintf(buf, "Error!\n");
	}
}

static DEVICE_ATTR(interface, S_IRUGO, show_interface, NULL);

static void acer_wmi_notify(u32 value, void *context)
{
	struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -2127,39 +2075,6 @@ static struct platform_driver acer_platform_driver = {

static struct platform_device *acer_platform_device;

static int remove_sysfs(struct platform_device *device)
{
	if (has_cap(ACER_CAP_THREEG))
		device_remove_file(&device->dev, &dev_attr_threeg);

	device_remove_file(&device->dev, &dev_attr_interface);

	return 0;
}

static int __init create_sysfs(void)
{
	int retval = -ENOMEM;

	if (has_cap(ACER_CAP_THREEG)) {
		retval = device_create_file(&acer_platform_device->dev,
			&dev_attr_threeg);
		if (retval)
			goto error_sysfs;
	}

	retval = device_create_file(&acer_platform_device->dev,
		&dev_attr_interface);
	if (retval)
		goto error_sysfs;

	return 0;

error_sysfs:
		remove_sysfs(acer_platform_device);
	return retval;
}

static void remove_debugfs(void)
{
	debugfs_remove(interface->debug.devices);
@@ -2290,10 +2205,6 @@ static int __init acer_wmi_init(void)
	if (err)
		goto error_device_add;

	err = create_sysfs();
	if (err)
		goto error_create_sys;

	if (wmi_has_guid(WMID_GUID2)) {
		interface->debug.wmid_devices = get_wmid_devices();
		err = create_debugfs();
@@ -2307,8 +2218,6 @@ static int __init acer_wmi_init(void)
	return 0;

error_create_debugfs:
	remove_sysfs(acer_platform_device);
error_create_sys:
	platform_device_del(acer_platform_device);
error_device_add:
	platform_device_put(acer_platform_device);
@@ -2331,7 +2240,6 @@ static void __exit acer_wmi_exit(void)
	if (has_cap(ACER_CAP_ACCEL))
		acer_wmi_accel_destroy();

	remove_sysfs(acer_platform_device);
	remove_debugfs();
	platform_device_unregister(acer_platform_device);
	platform_driver_unregister(&acer_platform_driver);
Loading