Commit 776ba3ad authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'platform-drivers-x86-v5.14-1' of...

Merge tag 'platform-drivers-x86-v5.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver updates from Hans de Goede:
 "Highlights:

   - New think-lmi driver adding support for changing Lenovo Thinkpad
     BIOS settings from within Linux using the standard firmware-
     attributes class sysfs API

   - MS Surface aggregator-cdev now also supports forwarding events to
     user-space (for debugging / new driver development purposes only)

   - New intel_skl_int3472 driver this provides the necessary glue to
     translate ACPI table information to GPIOs, regulators, etc. for
     camera sensors on Intel devices with IPU3 attached MIPI cameras

   - A whole bunch of other fixes + device-specific quirk additions

   - New devm_work_autocancel() devm-helpers.h function"

* tag 'platform-drivers-x86-v5.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (83 commits)
  platform/x86: dell-wmi-sysman: Change user experience when Admin/System Password is modified
  platform/x86: intel_skl_int3472: Uninitialized variable in skl_int3472_handle_gpio_resources()
  platform/x86: think-lmi: Move kfree(setting->possible_values) to tlmi_attr_setting_release()
  platform/x86: think-lmi: Split current_value to reflect only the value
  platform/x86: think-lmi: Fix issues with duplicate attributes
  platform/x86: think-lmi: Return EINVAL when kbdlang gets set to a 0 length string
  platform/x86: intel_cht_int33fe: Move to its own subfolder
  platform/x86: intel_skl_int3472: Move to intel/ subfolder
  platform/x86: intel_skl_int3472: Provide skl_int3472_unregister_clock()
  platform/x86: intel_skl_int3472: Provide skl_int3472_unregister_regulator()
  platform/x86: intel_skl_int3472: Use ACPI GPIO resource directly
  platform/x86: intel_skl_int3472: Fix dependencies (drop CLKDEV_LOOKUP)
  platform/x86: intel_skl_int3472: Free ACPI device resources after use
  platform/x86: Remove "default n" entries
  platform/x86: ISST: Use numa node id for cpu pci dev mapping
  platform/x86: ISST: Optimize CPU to PCI device mapping
  tools/power/x86/intel-speed-select: v1.10 release
  tools/power/x86/intel-speed-select: Fix uncore memory frequency display
  extcon: extcon-max8997: Simplify driver using devm
  extcon: extcon-max8997: Fix IRQ freeing at error path
  ...
parents ebb81c14 0e695c3f
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -197,8 +197,24 @@ Description:
		Drivers may emit a CHANGE uevent when a password is set or unset
		userspace may check it again.

		On Dell systems, if Admin password is set, then all BIOS attributes
		On Dell and Lenovo systems, if Admin password is set, then all BIOS attributes
		require password validation.
		On Lenovo systems if you change the Admin password the new password is not active until
		the next boot.

		Lenovo specific class extensions
		------------------------------

		On Lenovo systems the following additional settings are available:

		lenovo_encoding:
					The encoding method that is used. This can be either "ascii"
					or "scancode". Default is set to "ascii"

		lenovo_kbdlang:
					The keyboard language method that is used. This is generally a
					two char code (e.g. "us", "fr", "gr") and may vary per platform.
					Default is set to "us"

What:		/sys/class/firmware-attributes/*/attributes/pending_reboot
Date:		February 2021
+55 −0
Original line number Diff line number Diff line
What:		/sys/bus/wmi/devices/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_supported_type
Date:		Apr 2021
KernelVersion:	5.13
Contact:	"perry.yuan@dell.com>"
Description:
		Display which dell hardware level privacy devices are supported
		“Dell Privacy” is a set of HW, FW, and SW features to enhance
		Dell’s commitment to platform privacy for MIC, Camera, and
		ePrivacy screens.
		The supported hardware privacy devices are:
Attributes:
		Microphone Mute:
				Identifies the local microphone can be muted by hardware, no applications
				is available to capture system mic sound

		Camera Shutter:
				Identifies camera shutter controlled by hardware, which is a micromechanical
				shutter assembly that is built onto the camera module to block capturing images
				from outside the laptop

		supported:
				The privacy device is supported by this system

		unsupported:
				The privacy device is not supported on this system

		For example to check which privacy devices are supported:

		# cat /sys/bus/wmi/drivers/dell-privacy/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_supported_type
		[Microphone Mute] [supported]
		[Camera Shutter] [supported]
		[ePrivacy Screen] [unsupported]

What:		/sys/bus/wmi/devices/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_current_state
Date:		Apr 2021
KernelVersion:	5.13
Contact:	"perry.yuan@dell.com>"
Description:
		Allow user space to check current dell privacy device state.
		Describes the Device State class exposed by BIOS which can be
		consumed by various applications interested in knowing the Privacy
		feature capabilities
Attributes:
		muted:
			Identifies the privacy device is turned off and cannot send stream to OS applications

		unmuted:
			Identifies the privacy device is turned on ,audio or camera driver can get
			stream from mic and camera module to OS applications

		For example to check all supported current privacy device states:

		# cat /sys/bus/wmi/drivers/dell-privacy/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_current_state
		[Microphone] [unmuted]
		[Camera Shutter] [unmuted]
+122 −5
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0+

.. |u8| replace:: :c:type:`u8 <u8>`
.. |u16| replace:: :c:type:`u16 <u16>`
.. |ssam_cdev_request| replace:: :c:type:`struct ssam_cdev_request <ssam_cdev_request>`
.. |ssam_cdev_request_flags| replace:: :c:type:`enum ssam_cdev_request_flags <ssam_cdev_request_flags>`
.. |ssam_cdev_event| replace:: :c:type:`struct ssam_cdev_event <ssam_cdev_event>`

==============================
User-Space EC Interface (cdev)
@@ -23,6 +22,40 @@ These IOCTLs and their respective input/output parameter structs are defined in
A small python library and scripts for accessing this interface can be found
at https://github.com/linux-surface/surface-aggregator-module/tree/master/scripts/ssam.

.. contents::


Receiving Events
================

Events can be received by reading from the device-file. The are represented by
the |ssam_cdev_event| datatype.

Before events are available to be read, however, the desired notifiers must be
registered via the ``SSAM_CDEV_NOTIF_REGISTER`` IOCTL. Notifiers are, in
essence, callbacks, called when the EC sends an event. They are, in this
interface, associated with a specific target category and device-file-instance.
They forward any event of this category to the buffer of the corresponding
instance, from which it can then be read.

Notifiers themselves do not enable events on the EC. Thus, it may additionally
be necessary to enable events via the ``SSAM_CDEV_EVENT_ENABLE`` IOCTL. While
notifiers work per-client (i.e. per-device-file-instance), events are enabled
globally, for the EC and all of its clients (regardless of userspace or
non-userspace). The ``SSAM_CDEV_EVENT_ENABLE`` and ``SSAM_CDEV_EVENT_DISABLE``
IOCTLs take care of reference counting the events, such that an event is
enabled as long as there is a client that has requested it.

Note that enabled events are not automatically disabled once the client
instance is closed. Therefore any client process (or group of processes) should
balance their event enable calls with the corresponding event disable calls. It
is, however, perfectly valid to enable and disable events on different client
instances. For example, it is valid to set up notifiers and read events on
client instance ``A``, enable those events on instance ``B`` (note that these
will also be received by A since events are enabled/disabled globally), and
after no more events are desired, disable the previously enabled events via
instance ``C``.


Controller IOCTLs
=================
@@ -45,9 +78,33 @@ The following IOCTLs are provided:
     - ``REQUEST``
     - Perform synchronous SAM request.

   * - ``0xA5``
     - ``2``
     - ``W``
     - ``NOTIF_REGISTER``
     - Register event notifier.

``REQUEST``
-----------
   * - ``0xA5``
     - ``3``
     - ``W``
     - ``NOTIF_UNREGISTER``
     - Unregister event notifier.

   * - ``0xA5``
     - ``4``
     - ``W``
     - ``EVENT_ENABLE``
     - Enable event source.

   * - ``0xA5``
     - ``5``
     - ``W``
     - ``EVENT_DISABLE``
     - Disable event source.


``SSAM_CDEV_REQUEST``
---------------------

Defined as ``_IOWR(0xA5, 1, struct ssam_cdev_request)``.

@@ -82,6 +139,66 @@ submitted, and completed (i.e. handed back to user-space) successfully from
inside the IOCTL, but the request ``status`` member may still be negative in
case the actual execution of the request failed after it has been submitted.

A full definition of the argument struct is provided below:
A full definition of the argument struct is provided below.

``SSAM_CDEV_NOTIF_REGISTER``
----------------------------

Defined as ``_IOW(0xA5, 2, struct ssam_cdev_notifier_desc)``.

Register a notifier for the event target category specified in the given
notifier description with the specified priority. Notifiers registration is
required to receive events, but does not enable events themselves. After a
notifier for a specific target category has been registered, all events of that
category will be forwarded to the userspace client and can then be read from
the device file instance. Note that events may have to be enabled, e.g. via the
``SSAM_CDEV_EVENT_ENABLE`` IOCTL, before the EC will send them.

Only one notifier can be registered per target category and client instance. If
a notifier has already been registered, this IOCTL will fail with ``-EEXIST``.

Notifiers will automatically be removed when the device file instance is
closed.

``SSAM_CDEV_NOTIF_UNREGISTER``
------------------------------

Defined as ``_IOW(0xA5, 3, struct ssam_cdev_notifier_desc)``.

Unregisters the notifier associated with the specified target category. The
priority field will be ignored by this IOCTL. If no notifier has been
registered for this client instance and the given category, this IOCTL will
fail with ``-ENOENT``.

``SSAM_CDEV_EVENT_ENABLE``
--------------------------

Defined as ``_IOW(0xA5, 4, struct ssam_cdev_event_desc)``.

Enable the event associated with the given event descriptor.

Note that this call will not register a notifier itself, it will only enable
events on the controller. If you want to receive events by reading from the
device file, you will need to register the corresponding notifier(s) on that
instance.

Events are not automatically disabled when the device file is closed. This must
be done manually, via a call to the ``SSAM_CDEV_EVENT_DISABLE`` IOCTL.

``SSAM_CDEV_EVENT_DISABLE``
---------------------------

Defined as ``_IOW(0xA5, 5, struct ssam_cdev_event_desc)``.

Disable the event associated with the given event descriptor.

Note that this will not unregister any notifiers. Events may still be received
and forwarded to user-space after this call. The only safe way of stopping
events from being received is unregistering all previously registered
notifiers.


Structures and Enums
====================

.. kernel-doc:: include/uapi/linux/surface_aggregator/cdev.h
+1 −1
Original line number Diff line number Diff line
@@ -325,7 +325,7 @@ Code Seq# Include File Comments
0xA3  90-9F  linux/dtlk.h
0xA4  00-1F  uapi/linux/tee.h                                        Generic TEE subsystem
0xA4  00-1F  uapi/asm/sgx.h                                          <mailto:linux-sgx@vger.kernel.org>
0xA5  01     linux/surface_aggregator/cdev.h                         Microsoft Surface Platform System Aggregator
0xA5  01-05  linux/surface_aggregator/cdev.h                         Microsoft Surface Platform System Aggregator
                                                                     <mailto:luzmaximilian@gmail.com>
0xA5  20-2F  linux/surface_aggregator/dtx.h                          Microsoft Surface DTX driver
                                                                     <mailto:luzmaximilian@gmail.com>
+22 −3
Original line number Diff line number Diff line
@@ -5187,7 +5187,14 @@ DELL WMI NOTIFICATIONS DRIVER
M:	Matthew Garrett <mjg59@srcf.ucam.org>
M:	Pali Rohár <pali@kernel.org>
S:	Maintained
F:	drivers/platform/x86/dell/dell-wmi.c
F:	drivers/platform/x86/dell/dell-wmi-base.c
DELL WMI HARDWARE PRIVACY SUPPORT
M:	Perry Yuan <Perry.Yuan@dell.com>
L:	Dell.Client.Kernel@dell.com
L:	platform-driver-x86@vger.kernel.org
S:	Maintained
F:	drivers/platform/x86/dell/dell-wmi-privacy.c
DELTA ST MEDIA DRIVER
M:	Hugues Fruchet <hugues.fruchet@foss.st.com>
@@ -9397,6 +9404,11 @@ S: Maintained
F:	arch/x86/include/asm/intel_scu_ipc.h
F:	drivers/platform/x86/intel_scu_*
INTEL SKYLAKE INT3472 ACPI DEVICE DRIVER
M:	Daniel Scally <djrscally@gmail.com>
S:	Maintained
F:	drivers/platform/x86/intel/int3472/
INTEL SPEED SELECT TECHNOLOGY
M:	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
L:	platform-driver-x86@vger.kernel.org
@@ -9417,7 +9429,7 @@ F: include/linux/firmware/intel/stratix10-smc.h
F:	include/linux/firmware/intel/stratix10-svc-client.h
INTEL TELEMETRY DRIVER
M:	Rajneesh Bhardwaj <rajneesh.bhardwaj@linux.intel.com>
M:	Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>
M:	"David E. Box" <david.e.box@linux.intel.com>
L:	platform-driver-x86@vger.kernel.org
S:	Maintained
@@ -12209,7 +12221,7 @@ M: Maximilian Luz <luzmaximilian@gmail.com>
L:	platform-driver-x86@vger.kernel.org
S:	Maintained
W:	https://github.com/linux-surface/surface-aggregator-module
C:	irc://chat.freenode.net/##linux-surface
C:	irc://irc.libera.chat/linux-surface
F:	Documentation/driver-api/surface_aggregator/
F:	drivers/platform/surface/aggregator/
F:	drivers/platform/surface/surface_acpi_notify.c
@@ -18215,6 +18227,13 @@ W: http://thinkwiki.org/wiki/Ibm-acpi
T:	git git://repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git
F:	drivers/platform/x86/thinkpad_acpi.c
THINKPAD LMI DRIVER
M:	Mark Pearson <markpearson@lenovo.com>
L:	platform-driver-x86@vger.kernel.org
S:	Maintained
F:	Documentation/ABI/testing/sysfs-class-firmware-attributes
F:	drivers/platform/x86/think-lmi.?
THUNDERBOLT DMA TRAFFIC TEST DRIVER
M:	Isaac Hazan <isaac.hazan@intel.com>
L:	linux-usb@vger.kernel.org
Loading