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

Commit 94eae803 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull x86 platform driver updates from Darren Hart:
 "Big picture:

   - New intel_turbo_max_3 driver, providing max core frequency
     information to the scheduler. Intel PMC APL support, s0ix read API,
     and fixes.

   - New Silead touchscreen platform touchscreen descriptions.
     Additional hotkey support for the intel-hid driver.

   - New model support for dell-laptop and hp_accel.

   - Several cleanups, especially to the fujitsu-laptop and
     intel_mid_powerbtn drivers.

  Detail summary:

  platorm/x86:
   - silead depends on I2C being built-in
   - add support for devices with Silead touchscreens
   - Support Turbo Boost Max 3.0 for non HWP systems

  intel_turbo_max_3:
   - make it explicitly non-modular

  dell-laptop:
   - Add Latitude 7480 and others to the DMI whitelist

  intel-hid:
   - Support 5 button array

  thinkpad_acpi:
   - Call led_classdev_notify_brightness_hw_changed on kbd brightness change
   - Use brightness_set_blocking callback for LEDs
   - Stop setting led_classdev brightness directly

  acer-wmi:
   - add another KEY_WLAN keycode
   - Inform firmware that RF Button Driver is active
   - setup accelerometer when machine has appropriate notify event

  asus-wireless:
   - Fix indentation
   - Use per-HID HSWC parameters

  intel_pmc_ipc:
   - Add APL PMC PCI Id
   - read s0ix residency API
   - Remove unused iTCO_version variable

  alienware-wmi:
   - Remove header duplicate

  intel_pmc_core:
   - fix out-of-bounds accesses on stack

  intel_mid_powerbtn:
   - Use SCU IPC directly
   - Unify IRQ acknowledgment
   - Move comment to where it belongs
   - Unify PBSTATUS access
   - Remove snail address
   - Sort headers alphabetically
   - Join string literals
   - Enable driver for Merrifield
   - Acknowledge interrupts
   - Factor out mfld_ack()
   - Introduce driver data
   - Substitute mfld by mid
   - Convert to use devm_*()

  fujitsu-laptop:
   - make hotkey handling functions more similar
   - break up complex loop condition
   - move keycode processing to separate functions
   - decrease indentation in acpi_fujitsu_hotkey_notify()
   - simplify logolamp_get()
   - rework logolamp_set() to properly handle errors
   - set default trigger for radio LED to rfkill-any

  dell-smbios:
   - Auto-select as needed

  intel_mid_thermal:
   - Fix module autoload
   - Remove duplicated platform device ID

  mlx-platform:
   - mlxcpld-hotplug driver style fixes

  hp_accel:
   - Add support for HP ZBook 17"

* tag 'platform-drivers-x86-v4.11-1' of git://git.infradead.org/linux-platform-drivers-x86: (45 commits)
  platform/x86: intel_turbo_max_3: make it explicitly non-modular
  platform/x86: dell-laptop: Add Latitude 7480 and others to the DMI whitelist
  platform/x86: intel-hid: Support 5 button array
  platform/x86: thinkpad_acpi: Call led_classdev_notify_brightness_hw_changed on kbd brightness change
  platform/x86: thinkpad_acpi: Use brightness_set_blocking callback for LEDs
  platform/x86: thinkpad_acpi: Stop setting led_classdev brightness directly
  leds: class: Add new optional brightness_hw_changed attribute
  platform/x86: acer-wmi: add another KEY_WLAN keycode
  platform/x86: acer-wmi: Inform firmware that RF Button Driver is active
  platform/x86: asus-wireless: Fix indentation
  platform/x86: asus-wireless: Use per-HID HSWC parameters
  platform/x86: intel_pmc_ipc: Add APL PMC PCI Id
  platform/x86: intel_pmc_ipc: read s0ix residency API
  platform/x86: alienware-wmi: Remove header duplicate
  platform/x86: intel_mid_powerbtn: Use SCU IPC directly
  platform/x86: intel_mid_powerbtn: Unify IRQ acknowledgment
  platform/x86: intel_mid_powerbtn: Move comment to where it belongs
  platform/x86: intel_mid_powerbtn: Unify PBSTATUS access
  platform/x86: intel_pmc_core: fix out-of-bounds accesses on stack
  platform/x86: silead depends on I2C being built-in
  ...
parents 5d8a00ee af050abb
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -11456,6 +11456,14 @@ F: drivers/media/usb/siano/
F:	drivers/media/usb/siano/
F:	drivers/media/mmc/siano/

SILEAD TOUCHSCREEN DRIVER
M:	Hans de Goede <hdegoede@redhat.com>
L:	linux-input@vger.kernel.org
L:	platform-driver-x86@vger.kernel.org
S:	Maintained
F:	drivers/input/touchscreen/silead.c
F:	drivers/platform/x86/silead_dmi.c

SIMPLEFB FB DRIVER
M:	Hans de Goede <hdegoede@redhat.com>
L:	linux-fbdev@vger.kernel.org
+6 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ int intel_pmc_ipc_raw_cmd(u32 cmd, u32 sub, u8 *in, u32 inlen,
		u32 *out, u32 outlen, u32 dptr, u32 sptr);
int intel_pmc_ipc_command(u32 cmd, u32 sub, u8 *in, u32 inlen,
		u32 *out, u32 outlen);
int intel_pmc_s0ix_counter_read(u64 *data);

#else

@@ -50,6 +51,11 @@ static inline int intel_pmc_ipc_command(u32 cmd, u32 sub, u8 *in, u32 inlen,
	return -EINVAL;
}

static inline int intel_pmc_s0ix_counter_read(u64 *data)
{
	return -EINVAL;
}

#endif /*CONFIG_INTEL_PMC_IPC*/

#endif
+25 −6
Original line number Diff line number Diff line
@@ -92,9 +92,8 @@ config ASUS_LAPTOP
	  If you have an ACPI-compatible ASUS laptop, say Y or M here.

config DELL_SMBIOS
	tristate "Dell SMBIOS Support"
	depends on DCDBAS
	default n
	tristate
	select DCDBAS
	---help---
	This module provides common functions for kernel modules using
	Dell SMBIOS.
@@ -103,16 +102,15 @@ config DELL_SMBIOS

config DELL_LAPTOP
	tristate "Dell Laptop Extras"
	depends on DELL_SMBIOS
	depends on DMI
	depends on BACKLIGHT_CLASS_DEVICE
	depends on ACPI_VIDEO || ACPI_VIDEO = n
	depends on RFKILL || RFKILL = n
	depends on SERIO_I8042
	select DELL_SMBIOS
	select POWER_SUPPLY
	select LEDS_CLASS
	select NEW_LEDS
	default n
	---help---
	This driver adds support for rfkill and backlight control to Dell
	laptops (except for some models covered by the Compal driver).
@@ -123,7 +121,7 @@ config DELL_WMI
	depends on DMI
	depends on INPUT
	depends on ACPI_VIDEO || ACPI_VIDEO = n
	depends on DELL_SMBIOS
	select DELL_SMBIOS
	select INPUT_SPARSEKMAP
	---help---
	  Say Y here if you want to support WMI-based hotkeys on Dell laptops.
@@ -1069,6 +1067,27 @@ config MLX_CPLD_PLATFORM
	  This driver handles hot-plug events for the power suppliers, power
	  cables and fans on the wide range Mellanox IB and Ethernet systems.

config INTEL_TURBO_MAX_3
	bool "Intel Turbo Boost Max Technology 3.0 enumeration driver"
	depends on X86_64 && SCHED_MC_PRIO
	---help---
	  This driver reads maximum performance ratio of each CPU and set up
	  the scheduler priority metrics. In this way scheduler can prefer
	  CPU with higher performance to schedule tasks.
	  This driver is only required when the system is not using Hardware
	  P-States (HWP). In HWP mode, priority can be read from ACPI tables.

config SILEAD_DMI
	bool "Tablets with Silead touchscreens"
	depends on ACPI && DMI && I2C=y && INPUT
	---help---
	  Certain ACPI based tablets with Silead touchscreens do not have
	  enough data in ACPI tables for the touchscreen driver to handle
	  the touchscreen properly, as OEMs expected the data to be baked
	  into the tablet model specific version of the driver shipped
	  with the OS-image for the device. This option supplies the missing
	  information. Enable this for x86 tablets with Silead touchscreens.

endif # X86_PLATFORM_DEVICES

config PMC_ATOM
+2 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ obj-$(CONFIG_INTEL_SMARTCONNECT) += intel-smartconnect.o
obj-$(CONFIG_PVPANIC)           += pvpanic.o
obj-$(CONFIG_ALIENWARE_WMI)	+= alienware-wmi.o
obj-$(CONFIG_INTEL_PMC_IPC)	+= intel_pmc_ipc.o
obj-$(CONFIG_SILEAD_DMI)	+= silead_dmi.o
obj-$(CONFIG_SURFACE_PRO3_BUTTON)	+= surfacepro3_button.o
obj-$(CONFIG_SURFACE_3_BUTTON)	+= surface3_button.o
obj-$(CONFIG_INTEL_PUNIT_IPC)  += intel_punit_ipc.o
@@ -76,3 +77,4 @@ obj-$(CONFIG_INTEL_PMC_CORE) += intel_pmc_core.o
obj-$(CONFIG_PMC_ATOM)		+= pmc_atom.o
obj-$(CONFIG_MLX_PLATFORM)	+= mlx-platform.o
obj-$(CONFIG_MLX_CPLD_PLATFORM)	+= mlxcpld-hotplug.o
obj-$(CONFIG_INTEL_TURBO_MAX_3) += intel_turbo_max_3.o
+77 −20
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@ static const struct key_entry acer_wmi_keymap[] __initconst = {
	{KE_KEY, KEY_TOUCHPAD_OFF, {KEY_TOUCHPAD_OFF} },
	{KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} },
	{KE_KEY, 0x85, {KEY_TOUCHPAD_TOGGLE} },
	{KE_KEY, 0x86, {KEY_WLAN} },
	{KE_END, 0}
};

@@ -150,15 +151,30 @@ struct event_return_value {
#define ACER_WMID3_GDS_BLUETOOTH	(1<<11)	/* BT */
#define ACER_WMID3_GDS_TOUCHPAD		(1<<1)	/* Touchpad */

struct lm_input_params {
/* Hotkey Customized Setting and Acer Application Status.
 * Set Device Default Value and Report Acer Application Status.
 * When Acer Application starts, it will run this method to inform
 * BIOS/EC that Acer Application is on.
 * App Status
 *	Bit[0]: Launch Manager Status
 *	Bit[1]: ePM Status
 *	Bit[2]: Device Control Status
 *	Bit[3]: Acer Power Button Utility Status
 *	Bit[4]: RF Button Status
 *	Bit[5]: ODD PM Status
 *	Bit[6]: Device Default Value Control
 *	Bit[7]: Hall Sensor Application Status
 */
struct func_input_params {
	u8 function_num;        /* Function Number */
	u16 commun_devices;     /* Communication type devices default status */
	u16 devices;            /* Other type devices default status */
	u8 lm_status;           /* Launch Manager Status */
	u16 reserved;
	u8 app_status;          /* Acer Device Status. LM, ePM, RF Button... */
	u8 app_mask;		/* Bit mask to app_status */
	u8 reserved;
} __attribute__((packed));

struct lm_return_value {
struct func_return_value {
	u8 error_code;          /* Error Code */
	u8 ec_return_value;     /* EC Return Value */
	u16 reserved;
@@ -1769,13 +1785,13 @@ static void acer_wmi_notify(u32 value, void *context)
}

static acpi_status __init
wmid3_set_lm_mode(struct lm_input_params *params,
		  struct lm_return_value *return_value)
wmid3_set_function_mode(struct func_input_params *params,
			struct func_return_value *return_value)
{
	acpi_status status;
	union acpi_object *obj;

	struct acpi_buffer input = { sizeof(struct lm_input_params), params };
	struct acpi_buffer input = { sizeof(struct func_input_params), params };
	struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };

	status = wmi_evaluate_method(WMID_GUID3, 0, 0x1, &input, &output);
@@ -1796,7 +1812,7 @@ wmid3_set_lm_mode(struct lm_input_params *params,
		return AE_ERROR;
	}

	*return_value = *((struct lm_return_value *)obj->buffer.pointer);
	*return_value = *((struct func_return_value *)obj->buffer.pointer);
	kfree(obj);

	return status;
@@ -1804,16 +1820,17 @@ wmid3_set_lm_mode(struct lm_input_params *params,

static int __init acer_wmi_enable_ec_raw(void)
{
	struct lm_return_value return_value;
	struct func_return_value return_value;
	acpi_status status;
	struct lm_input_params params = {
	struct func_input_params params = {
		.function_num = 0x1,
		.commun_devices = 0xFFFF,
		.devices = 0xFFFF,
		.lm_status = 0x00,            /* Launch Manager Deactive */
		.app_status = 0x00,		/* Launch Manager Deactive */
		.app_mask = 0x01,
	};

	status = wmid3_set_lm_mode(&params, &return_value);
	status = wmid3_set_function_mode(&params, &return_value);

	if (return_value.error_code || return_value.ec_return_value)
		pr_warn("Enabling EC raw mode failed: 0x%x - 0x%x\n",
@@ -1827,16 +1844,17 @@ static int __init acer_wmi_enable_ec_raw(void)

static int __init acer_wmi_enable_lm(void)
{
	struct lm_return_value return_value;
	struct func_return_value return_value;
	acpi_status status;
	struct lm_input_params params = {
	struct func_input_params params = {
		.function_num = 0x1,
		.commun_devices = 0xFFFF,
		.devices = 0xFFFF,
		.lm_status = 0x01,            /* Launch Manager Active */
		.app_status = 0x01,            /* Launch Manager Active */
		.app_mask = 0x01,
	};

	status = wmid3_set_lm_mode(&params, &return_value);
	status = wmid3_set_function_mode(&params, &return_value);

	if (return_value.error_code || return_value.ec_return_value)
		pr_warn("Enabling Launch Manager failed: 0x%x - 0x%x\n",
@@ -1846,11 +1864,46 @@ static int __init acer_wmi_enable_lm(void)
	return status;
}

static int __init acer_wmi_enable_rf_button(void)
{
	struct func_return_value return_value;
	acpi_status status;
	struct func_input_params params = {
		.function_num = 0x1,
		.commun_devices = 0xFFFF,
		.devices = 0xFFFF,
		.app_status = 0x10,            /* RF Button Active */
		.app_mask = 0x10,
	};

	status = wmid3_set_function_mode(&params, &return_value);

	if (return_value.error_code || return_value.ec_return_value)
		pr_warn("Enabling RF Button failed: 0x%x - 0x%x\n",
			return_value.error_code,
			return_value.ec_return_value);

	return status;
}

#define ACER_WMID_ACCEL_HID	"BST0001"

static acpi_status __init acer_wmi_get_handle_cb(acpi_handle ah, u32 level,
						void *ctx, void **retval)
{
	*(acpi_handle *)retval = ah;
	struct acpi_device *dev;

	if (!strcmp(ctx, "SENR")) {
		if (acpi_bus_get_device(ah, &dev))
			return AE_OK;
		if (!strcmp(ACER_WMID_ACCEL_HID, acpi_device_hid(dev)))
			return AE_OK;
	} else
		return AE_OK;

	*(acpi_handle *)retval = ah;

	return AE_CTRL_TERMINATE;
}

static int __init acer_wmi_get_handle(const char *name, const char *prop,
@@ -1877,7 +1930,7 @@ static int __init acer_wmi_accel_setup(void)
{
	int err;

	err = acer_wmi_get_handle("SENR", "BST0001", &gsensor_handle);
	err = acer_wmi_get_handle("SENR", ACER_WMID_ACCEL_HID, &gsensor_handle);
	if (err)
		return err;

@@ -2216,6 +2269,9 @@ static int __init acer_wmi_init(void)
		interface->capability &= ~ACER_CAP_BRIGHTNESS;

	if (wmi_has_guid(WMID_GUID3)) {
		if (ACPI_FAILURE(acer_wmi_enable_rf_button()))
			pr_warn("Cannot enable RF Button Driver\n");

		if (ec_raw_mode) {
			if (ACPI_FAILURE(acer_wmi_enable_ec_raw())) {
				pr_err("Cannot enable EC raw mode\n");
@@ -2233,10 +2289,11 @@ static int __init acer_wmi_init(void)
		err = acer_wmi_input_setup();
		if (err)
			return err;
		err = acer_wmi_accel_setup();
		if (err)
			return err;
	}

	acer_wmi_accel_setup();

	err = platform_driver_register(&acer_platform_driver);
	if (err) {
		pr_err("Unable to register platform driver\n");
Loading