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

Commit 99a7583d authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull x86 platform-drivers update from Darren Hart:
 "This represents a significantly larger and more complex set of changes
  than those of prior merge windows.

  In particular, we had several changes with dependencies on other
  subsystems which we felt were best managed through merges of immutable
  branches, including one each from input, i2c, and leds. Two patches
  for the watchdog subsystem are included after discussion with Wim and
  Guenter following a collision in linux-next (this should be resolved
  and you should only see these two appear in this pull request). These
  are called out in the "External" section below.

  Summary of changes:
   - significant further cleanup of fujitsu-laptop and hp-wmi
   - new model support for ideapad, asus, silead, and xiaomi
   - new hotkeys for thinkpad and models using intel-vbtn
   - dell keyboard backlight improvements
   - build and dependency improvements
   - intel * ipc fixes, cleanups, and api updates
   - single isolated fixes noted below

  External:
   - watchdog: iTCO_wdt: Add PMC specific noreboot update api
   - watchdog: iTCO_wdt: cleanup set/unset no_reboot_bit functions
   - Merge branch 'ib/4.10-sparse-keymap-managed'
   - Merge branch 'i2c/for-INT33FE'
   - Merge branch 'linux-leds/dell-laptop-changes-for-4.12'

  platform/x86:
   - Add Intel Cherry Trail ACPI INT33FE device driver
   - remove sparse_keymap_free() calls
   - Make SILEAD_DMI depend on TOUCHSCREEN_SILEAD

  asus-wmi:
   - try to set als by default
   - fix cpufv sysfs file permission

  acer-wmi:
   - setup accelerometer when ACPI device was found

  ideapad-laptop:
   - Add IdeaPad V310-15ISK to no_hw_rfkill
   - Add IdeaPad 310-15IKB to no_hw_rfkill

  intel_pmc_ipc:
   - use gcr mem base for S0ix counter read
   - Fix iTCO_wdt GCS memory mapping failure
   - Add pmc gcr read/write/update api's
   - fix gcr offset

  dell-laptop:
   - Add keyboard backlight timeout AC settings
   - Handle return error form dell_get_intensity.
   - Protect kbd_state against races
   - Refactor kbd_led_triggers_store()

  hp-wireless:
   - reuse module_acpi_driver
   - add Xiaomi's hardware id to the supported list

  intel-vbtn:
   - add volume up and down

  INT33FE:
   - add i2c dependency

  hp-wmi:
   - Cleanup exit paths
   - Do not shadow errors in sysfs show functions
   - Use DEVICE_ATTR_(RO|RW) helper macros
   - Refactor dock and tablet state fetchers
   - Cleanup wireless get_(hw|sw)state functions
   - Refactor redundant HPWMI_READ functions
   - Standardize enum usage for constants
   - Cleanup local variable declarations
   - Do not shadow error values
   - Fix detection for dock and tablet mode
   - Fix error value for hp_wmi_tablet_state

  fujitsu-laptop:
   - simplify error handling in acpi_fujitsu_laptop_add()
   - do not log LED registration failures
   - switch to managed LED class devices
   - reorganize LED-related code
   - refactor LED registration
   - select LEDS_CLASS
   - remove redundant fields from struct fujitsu_bl
   - account for backlight power when determining brightness
   - do not log set_lcd_level() failures in bl_update_status()
   - ignore errors when setting backlight power
   - make disable_brightness_adjust a boolean
   - clean up use_alt_lcd_levels handling
   - sync brightness in set_lcd_level()
   - simplify set_lcd_level()
   - merge set_lcd_level_alt() into set_lcd_level()
   - switch to a managed backlight device
   - only handle backlight when appropriate
   - update debug message logged by call_fext_func()
   - rename call_fext_func() arguments
   - simplify call_fext_func()
   - clean up local variables in call_fext_func()
   - remove keycode fields from struct fujitsu_bl
   - model-dependent sparse keymap overrides
   - use a sparse keymap for hotkey event generation
   - switch to a managed hotkey input device
   - refactor hotkey input device setup
   - use a sparse keymap for brightness key events
   - switch to a managed backlight input device
   - refactor backlight input device setup
   - remove pf_device field from struct fujitsu_bl
   - only register platform device if FUJ02E3 is present
   - add and remove platform device in separate functions
   - simplify platform device attribute definitions
   - remove backlight-related attributes from the platform device
   - cleanup error labels in fujitsu_init()
   - only register backlight device if FUJ02B1 is present
   - sync backlight power status in acpi_fujitsu_laptop_add()
   - register backlight device in a separate function
   - simplify brightness key event generation logic
   - decrease indentation in acpi_fujitsu_bl_notify()

  intel-hid:
   - Add missing ->thaw callback
   - do not set parents of input devices explicitly
   - remove redundant set_bit() call
   - use devm_input_allocate_device() for HID events input device
   - make intel_hid_set_enable() take a boolean argument
   - simplify enabling/disabling HID events

  silead_dmi:
   - Add touchscreen info for Surftab Wintron 7.0
   - Abort early if DMI does not match
   - Do not treat all devices as i2c_clients
   - Add entry for Insyde 7W tablets
   - Constify properties arrays

  intel_scu_ipc:
   - Introduce intel_scu_ipc_raw_command()
   - Introduce SCU_DEVICE() macro
   - Remove redundant subarch check
   - Rearrange init sequence
   - Platform data is mandatory

  asus-nb-wmi:
   - Add wapf4 quirk for the X302UA

  dell-*:
   - Call new led hw_changed API on kbd brightness change
   - Add a generic dell-laptop notifier chain

  eeepc-laptop:
   - Skip unknown key messages 0x50 0x51

  thinkpad_acpi:
   - add mapping for new hotkeys
   - guard generic hotkey case"

* tag 'platform-drivers-x86-v4.12-1' of git://git.infradead.org/linux-platform-drivers-x86: (108 commits)
  platform/x86: Make SILEAD_DMI depend on TOUCHSCREEN_SILEAD
  platform/x86: asus-wmi: try to set als by default
  platform/x86: asus-wmi: fix cpufv sysfs file permission
  platform/x86: acer-wmi: setup accelerometer when ACPI device was found
  platform/x86: ideapad-laptop: Add IdeaPad V310-15ISK to no_hw_rfkill
  platform/x86: intel_pmc_ipc: use gcr mem base for S0ix counter read
  platform/x86: intel_pmc_ipc: Fix iTCO_wdt GCS memory mapping failure
  watchdog: iTCO_wdt: Add PMC specific noreboot update api
  watchdog: iTCO_wdt: cleanup set/unset no_reboot_bit functions
  platform/x86: intel_pmc_ipc: Add pmc gcr read/write/update api's
  platform/x86: intel_pmc_ipc: fix gcr offset
  platform/x86: dell-laptop: Add keyboard backlight timeout AC settings
  platform/x86: dell-laptop: Handle return error form dell_get_intensity.
  platform/x86: hp-wireless: reuse module_acpi_driver
  platform/x86: intel-vbtn: add volume up and down
  platform/x86: INT33FE: add i2c dependency
  platform/x86: hp-wmi: Cleanup exit paths
  platform/x86: hp-wmi: Do not shadow errors in sysfs show functions
  platform/x86: hp-wmi: Use DEVICE_ATTR_(RO|RW) helper macros
  platform/x86: hp-wmi: Refactor dock and tablet state fetchers
  ...
parents c336bf8e 6df97f85
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -23,6 +23,11 @@
#define IPC_ERR_EMSECURITY		6
#define IPC_ERR_UNSIGNEDKERNEL		7

/* GCR reg offsets from gcr base*/
#define PMC_GCR_PMC_CFG_REG		0x08
#define PMC_GCR_TELEM_DEEP_S0IX_REG	0x78
#define PMC_GCR_TELEM_SHLW_S0IX_REG	0x80

#if IS_ENABLED(CONFIG_INTEL_PMC_IPC)

int intel_pmc_ipc_simple_command(int cmd, int sub);
@@ -31,6 +36,9 @@ int intel_pmc_ipc_raw_cmd(u32 cmd, u32 sub, u8 *in, u32 inlen,
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);
int intel_pmc_gcr_read(u32 offset, u32 *data);
int intel_pmc_gcr_write(u32 offset, u32 data);
int intel_pmc_gcr_update(u32 offset, u32 mask, u32 val);

#else

@@ -56,6 +64,21 @@ static inline int intel_pmc_s0ix_counter_read(u64 *data)
	return -EINVAL;
}

static inline int intel_pmc_gcr_read(u32 offset, u32 *data)
{
	return -EINVAL;
}

static inline int intel_pmc_gcr_write(u32 offset, u32 data)
{
	return -EINVAL;
}

static inline int intel_pmc_gcr_update(u32 offset, u32 mask, u32 val)
{
	return -EINVAL;
}

#endif /*CONFIG_INTEL_PMC_IPC*/

#endif
+7 −1
Original line number Diff line number Diff line
@@ -3,6 +3,9 @@

#include <linux/notifier.h>

#define IPCMSG_INDIRECT_READ	0x02
#define IPCMSG_INDIRECT_WRITE	0x05

#define IPCMSG_COLD_OFF		0x80	/* Only for Tangier */

#define IPCMSG_WARM_RESET	0xF0
@@ -46,6 +49,9 @@ int intel_scu_ipc_update_register(u16 addr, u8 data, u8 mask);
int intel_scu_ipc_simple_command(int cmd, int sub);
int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen,
			  u32 *out, int outlen);
int intel_scu_ipc_raw_command(int cmd, int sub, u8 *in, int inlen,
			      u32 *out, int outlen, u32 dptr, u32 sptr);

/* I2C control api */
int intel_scu_ipc_i2c_cntrl(u32 addr, u32 *data);

+16 −2
Original line number Diff line number Diff line
@@ -182,7 +182,8 @@ config FUJITSU_LAPTOP
	depends on INPUT
	depends on BACKLIGHT_CLASS_DEVICE
	depends on ACPI_VIDEO || ACPI_VIDEO = n
	depends on LEDS_CLASS || LEDS_CLASS=n
	select INPUT_SPARSEKMAP
	select LEDS_CLASS
	---help---
	  This is a driver for laptops built by Fujitsu:

@@ -780,6 +781,19 @@ config ACPI_CMPC
	  keys as input device, backlight device, tablet and accelerometer
	  devices.

config INTEL_CHT_INT33FE
	tristate "Intel Cherry Trail ACPI INT33FE Driver"
	depends on X86 && ACPI && I2C
	---help---
	  This driver add support for the INT33FE ACPI device found on
	  some Intel Cherry Trail devices.

	  The INT33FE ACPI device has a CRS table with I2cSerialBusV2
	  resources for 3 devices: Maxim MAX17047 Fuel Gauge Controller,
	  FUSB302 USB Type-C Controller and PI3USB30532 USB switch.
	  This driver instantiates i2c-clients for these, so that standard
	  i2c drivers for these chips can bind to the them.

config INTEL_HID_EVENT
	tristate "INTEL HID Event"
	depends on ACPI
@@ -1087,7 +1101,7 @@ config INTEL_TURBO_MAX_3

config SILEAD_DMI
	bool "Tablets with Silead touchscreens"
	depends on ACPI && DMI && I2C=y && INPUT
	depends on ACPI && DMI && I2C=y && TOUCHSCREEN_SILEAD
	---help---
	  Certain ACPI based tablets with Silead touchscreens do not have
	  enough data in ACPI tables for the touchscreen driver to handle
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,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_CHT_INT33FE)	+= intel_cht_int33fe.o
obj-$(CONFIG_INTEL_HID_EVENT)	+= intel-hid.o
obj-$(CONFIG_INTEL_VBTN)	+= intel-vbtn.o
obj-$(CONFIG_INTEL_SCU_IPC)	+= intel_scu_ipc.o
+5 −9
Original line number Diff line number Diff line
@@ -1896,7 +1896,7 @@ static acpi_status __init acer_wmi_get_handle_cb(acpi_handle ah, u32 level,
	if (!strcmp(ctx, "SENR")) {
		if (acpi_bus_get_device(ah, &dev))
			return AE_OK;
		if (!strcmp(ACER_WMID_ACCEL_HID, acpi_device_hid(dev)))
		if (strcmp(ACER_WMID_ACCEL_HID, acpi_device_hid(dev)))
			return AE_OK;
	} else
		return AE_OK;
@@ -1917,8 +1917,7 @@ static int __init acer_wmi_get_handle(const char *name, const char *prop,
	handle = NULL;
	status = acpi_get_devices(prop, acer_wmi_get_handle_cb,
					(void *)name, &handle);

	if (ACPI_SUCCESS(status)) {
	if (ACPI_SUCCESS(status) && handle) {
		*ah = handle;
		return 0;
	} else {
@@ -1987,7 +1986,7 @@ static int __init acer_wmi_input_setup(void)
						acer_wmi_notify, NULL);
	if (ACPI_FAILURE(status)) {
		err = -EIO;
		goto err_free_keymap;
		goto err_free_dev;
	}

	err = input_register_device(acer_wmi_input_dev);
@@ -1998,8 +1997,6 @@ static int __init acer_wmi_input_setup(void)

err_uninstall_notifier:
	wmi_remove_notify_handler(ACERWMID_EVENT_GUID);
err_free_keymap:
	sparse_keymap_free(acer_wmi_input_dev);
err_free_dev:
	input_free_device(acer_wmi_input_dev);
	return err;
@@ -2008,7 +2005,6 @@ static int __init acer_wmi_input_setup(void)
static void acer_wmi_input_destroy(void)
{
	wmi_remove_notify_handler(ACERWMID_EVENT_GUID);
	sparse_keymap_free(acer_wmi_input_dev);
	input_unregister_device(acer_wmi_input_dev);
}

@@ -2290,8 +2286,8 @@ static int __init acer_wmi_init(void)
		if (err)
			return err;
		err = acer_wmi_accel_setup();
		if (err)
			return err;
		if (err && err != -ENODEV)
			pr_warn("Cannot enable accelerometer\n");
	}

	err = platform_driver_register(&acer_platform_driver);
Loading