Skip to content

Commit 776ba3a

Browse files
committed
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 ...
2 parents ebb81c1 + 0e695c3 commit 776ba3a

File tree

95 files changed

+4285
-692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+4285
-692
lines changed

Documentation/ABI/testing/sysfs-class-firmware-attributes

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,24 @@ Description:
197197
Drivers may emit a CHANGE uevent when a password is set or unset
198198
userspace may check it again.
199199

200-
On Dell systems, if Admin password is set, then all BIOS attributes
200+
On Dell and Lenovo systems, if Admin password is set, then all BIOS attributes
201201
require password validation.
202+
On Lenovo systems if you change the Admin password the new password is not active until
203+
the next boot.
204+
205+
Lenovo specific class extensions
206+
------------------------------
207+
208+
On Lenovo systems the following additional settings are available:
209+
210+
lenovo_encoding:
211+
The encoding method that is used. This can be either "ascii"
212+
or "scancode". Default is set to "ascii"
213+
214+
lenovo_kbdlang:
215+
The keyboard language method that is used. This is generally a
216+
two char code (e.g. "us", "fr", "gr") and may vary per platform.
217+
Default is set to "us"
202218

203219
What: /sys/class/firmware-attributes/*/attributes/pending_reboot
204220
Date: February 2021
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
What: /sys/bus/wmi/devices/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_supported_type
2+
Date: Apr 2021
3+
KernelVersion: 5.13
4+
Contact: "[email protected]>"
5+
Description:
6+
Display which dell hardware level privacy devices are supported
7+
“Dell Privacy” is a set of HW, FW, and SW features to enhance
8+
Dell’s commitment to platform privacy for MIC, Camera, and
9+
ePrivacy screens.
10+
The supported hardware privacy devices are:
11+
Attributes:
12+
Microphone Mute:
13+
Identifies the local microphone can be muted by hardware, no applications
14+
is available to capture system mic sound
15+
16+
Camera Shutter:
17+
Identifies camera shutter controlled by hardware, which is a micromechanical
18+
shutter assembly that is built onto the camera module to block capturing images
19+
from outside the laptop
20+
21+
supported:
22+
The privacy device is supported by this system
23+
24+
unsupported:
25+
The privacy device is not supported on this system
26+
27+
For example to check which privacy devices are supported:
28+
29+
# cat /sys/bus/wmi/drivers/dell-privacy/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_supported_type
30+
[Microphone Mute] [supported]
31+
[Camera Shutter] [supported]
32+
[ePrivacy Screen] [unsupported]
33+
34+
What: /sys/bus/wmi/devices/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_current_state
35+
Date: Apr 2021
36+
KernelVersion: 5.13
37+
Contact: "[email protected]>"
38+
Description:
39+
Allow user space to check current dell privacy device state.
40+
Describes the Device State class exposed by BIOS which can be
41+
consumed by various applications interested in knowing the Privacy
42+
feature capabilities
43+
Attributes:
44+
muted:
45+
Identifies the privacy device is turned off and cannot send stream to OS applications
46+
47+
unmuted:
48+
Identifies the privacy device is turned on ,audio or camera driver can get
49+
stream from mic and camera module to OS applications
50+
51+
For example to check all supported current privacy device states:
52+
53+
# cat /sys/bus/wmi/drivers/dell-privacy/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_current_state
54+
[Microphone] [unmuted]
55+
[Camera Shutter] [unmuted]

Documentation/driver-api/surface_aggregator/clients/cdev.rst

Lines changed: 122 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
.. SPDX-License-Identifier: GPL-2.0+
22
3-
.. |u8| replace:: :c:type:`u8 <u8>`
4-
.. |u16| replace:: :c:type:`u16 <u16>`
53
.. |ssam_cdev_request| replace:: :c:type:`struct ssam_cdev_request <ssam_cdev_request>`
64
.. |ssam_cdev_request_flags| replace:: :c:type:`enum ssam_cdev_request_flags <ssam_cdev_request_flags>`
5+
.. |ssam_cdev_event| replace:: :c:type:`struct ssam_cdev_event <ssam_cdev_event>`
76

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

25+
.. contents::
26+
27+
28+
Receiving Events
29+
================
30+
31+
Events can be received by reading from the device-file. The are represented by
32+
the |ssam_cdev_event| datatype.
33+
34+
Before events are available to be read, however, the desired notifiers must be
35+
registered via the ``SSAM_CDEV_NOTIF_REGISTER`` IOCTL. Notifiers are, in
36+
essence, callbacks, called when the EC sends an event. They are, in this
37+
interface, associated with a specific target category and device-file-instance.
38+
They forward any event of this category to the buffer of the corresponding
39+
instance, from which it can then be read.
40+
41+
Notifiers themselves do not enable events on the EC. Thus, it may additionally
42+
be necessary to enable events via the ``SSAM_CDEV_EVENT_ENABLE`` IOCTL. While
43+
notifiers work per-client (i.e. per-device-file-instance), events are enabled
44+
globally, for the EC and all of its clients (regardless of userspace or
45+
non-userspace). The ``SSAM_CDEV_EVENT_ENABLE`` and ``SSAM_CDEV_EVENT_DISABLE``
46+
IOCTLs take care of reference counting the events, such that an event is
47+
enabled as long as there is a client that has requested it.
48+
49+
Note that enabled events are not automatically disabled once the client
50+
instance is closed. Therefore any client process (or group of processes) should
51+
balance their event enable calls with the corresponding event disable calls. It
52+
is, however, perfectly valid to enable and disable events on different client
53+
instances. For example, it is valid to set up notifiers and read events on
54+
client instance ``A``, enable those events on instance ``B`` (note that these
55+
will also be received by A since events are enabled/disabled globally), and
56+
after no more events are desired, disable the previously enabled events via
57+
instance ``C``.
58+
2659

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

81+
* - ``0xA5``
82+
- ``2``
83+
- ``W``
84+
- ``NOTIF_REGISTER``
85+
- Register event notifier.
4886

49-
``REQUEST``
50-
-----------
87+
* - ``0xA5``
88+
- ``3``
89+
- ``W``
90+
- ``NOTIF_UNREGISTER``
91+
- Unregister event notifier.
92+
93+
* - ``0xA5``
94+
- ``4``
95+
- ``W``
96+
- ``EVENT_ENABLE``
97+
- Enable event source.
98+
99+
* - ``0xA5``
100+
- ``5``
101+
- ``W``
102+
- ``EVENT_DISABLE``
103+
- Disable event source.
104+
105+
106+
``SSAM_CDEV_REQUEST``
107+
---------------------
51108

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

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

85-
A full definition of the argument struct is provided below:
142+
A full definition of the argument struct is provided below.
143+
144+
``SSAM_CDEV_NOTIF_REGISTER``
145+
----------------------------
146+
147+
Defined as ``_IOW(0xA5, 2, struct ssam_cdev_notifier_desc)``.
148+
149+
Register a notifier for the event target category specified in the given
150+
notifier description with the specified priority. Notifiers registration is
151+
required to receive events, but does not enable events themselves. After a
152+
notifier for a specific target category has been registered, all events of that
153+
category will be forwarded to the userspace client and can then be read from
154+
the device file instance. Note that events may have to be enabled, e.g. via the
155+
``SSAM_CDEV_EVENT_ENABLE`` IOCTL, before the EC will send them.
156+
157+
Only one notifier can be registered per target category and client instance. If
158+
a notifier has already been registered, this IOCTL will fail with ``-EEXIST``.
159+
160+
Notifiers will automatically be removed when the device file instance is
161+
closed.
162+
163+
``SSAM_CDEV_NOTIF_UNREGISTER``
164+
------------------------------
165+
166+
Defined as ``_IOW(0xA5, 3, struct ssam_cdev_notifier_desc)``.
167+
168+
Unregisters the notifier associated with the specified target category. The
169+
priority field will be ignored by this IOCTL. If no notifier has been
170+
registered for this client instance and the given category, this IOCTL will
171+
fail with ``-ENOENT``.
172+
173+
``SSAM_CDEV_EVENT_ENABLE``
174+
--------------------------
175+
176+
Defined as ``_IOW(0xA5, 4, struct ssam_cdev_event_desc)``.
177+
178+
Enable the event associated with the given event descriptor.
179+
180+
Note that this call will not register a notifier itself, it will only enable
181+
events on the controller. If you want to receive events by reading from the
182+
device file, you will need to register the corresponding notifier(s) on that
183+
instance.
184+
185+
Events are not automatically disabled when the device file is closed. This must
186+
be done manually, via a call to the ``SSAM_CDEV_EVENT_DISABLE`` IOCTL.
187+
188+
``SSAM_CDEV_EVENT_DISABLE``
189+
---------------------------
190+
191+
Defined as ``_IOW(0xA5, 5, struct ssam_cdev_event_desc)``.
192+
193+
Disable the event associated with the given event descriptor.
194+
195+
Note that this will not unregister any notifiers. Events may still be received
196+
and forwarded to user-space after this call. The only safe way of stopping
197+
events from being received is unregistering all previously registered
198+
notifiers.
199+
200+
201+
Structures and Enums
202+
====================
86203

87204
.. kernel-doc:: include/uapi/linux/surface_aggregator/cdev.h

Documentation/userspace-api/ioctl/ioctl-number.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ Code Seq# Include File Comments
325325
0xA3 90-9F linux/dtlk.h
326326
0xA4 00-1F uapi/linux/tee.h Generic TEE subsystem
327327
0xA4 00-1F uapi/asm/sgx.h <mailto:[email protected]>
328-
0xA5 01 linux/surface_aggregator/cdev.h Microsoft Surface Platform System Aggregator
328+
0xA5 01-05 linux/surface_aggregator/cdev.h Microsoft Surface Platform System Aggregator
329329
330330
0xA5 20-2F linux/surface_aggregator/dtx.h Microsoft Surface DTX driver
331331

MAINTAINERS

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5187,7 +5187,14 @@ DELL WMI NOTIFICATIONS DRIVER
51875187
M: Matthew Garrett <[email protected]>
51885188
M: Pali Rohár <[email protected]>
51895189
S: Maintained
5190-
F: drivers/platform/x86/dell/dell-wmi.c
5190+
F: drivers/platform/x86/dell/dell-wmi-base.c
5191+
5192+
DELL WMI HARDWARE PRIVACY SUPPORT
5193+
M: Perry Yuan <[email protected]>
5194+
5195+
5196+
S: Maintained
5197+
F: drivers/platform/x86/dell/dell-wmi-privacy.c
51915198

51925199
DELTA ST MEDIA DRIVER
51935200
M: Hugues Fruchet <[email protected]>
@@ -9397,6 +9404,11 @@ S: Maintained
93979404
F: arch/x86/include/asm/intel_scu_ipc.h
93989405
F: drivers/platform/x86/intel_scu_*
93999406

9407+
INTEL SKYLAKE INT3472 ACPI DEVICE DRIVER
9408+
M: Daniel Scally <[email protected]>
9409+
S: Maintained
9410+
F: drivers/platform/x86/intel/int3472/
9411+
94009412
INTEL SPEED SELECT TECHNOLOGY
94019413
M: Srinivas Pandruvada <[email protected]>
94029414
@@ -9417,7 +9429,7 @@ F: include/linux/firmware/intel/stratix10-smc.h
94179429
F: include/linux/firmware/intel/stratix10-svc-client.h
94189430

94199431
INTEL TELEMETRY DRIVER
9420-
M: Rajneesh Bhardwaj <[email protected].com>
9432+
M: Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>
94219433
M: "David E. Box" <[email protected]>
94229434
94239435
S: Maintained
@@ -12209,7 +12221,7 @@ M: Maximilian Luz <[email protected]>
1220912221
1221012222
S: Maintained
1221112223
W: https://github.com/linux-surface/surface-aggregator-module
12212-
C: irc://chat.freenode.net/##linux-surface
12224+
C: irc://irc.libera.chat/linux-surface
1221312225
F: Documentation/driver-api/surface_aggregator/
1221412226
F: drivers/platform/surface/aggregator/
1221512227
F: drivers/platform/surface/surface_acpi_notify.c
@@ -18215,6 +18227,13 @@ W: http://thinkwiki.org/wiki/Ibm-acpi
1821518227
T: git git://repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git
1821618228
F: drivers/platform/x86/thinkpad_acpi.c
1821718229

18230+
THINKPAD LMI DRIVER
18231+
M: Mark Pearson <[email protected]>
18232+
18233+
S: Maintained
18234+
F: Documentation/ABI/testing/sysfs-class-firmware-attributes
18235+
F: drivers/platform/x86/think-lmi.?
18236+
1821818237
THUNDERBOLT DMA TRAFFIC TEST DRIVER
1821918238
M: Isaac Hazan <[email protected]>
1822018239

drivers/acpi/pmic/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ endif # PMIC_OPREGION
5252

5353
config TPS68470_PMIC_OPREGION
5454
bool "ACPI operation region support for TPS68470 PMIC"
55-
depends on MFD_TPS68470
55+
depends on INTEL_SKL_INT3472
5656
help
5757
This config adds ACPI operation region support for TI TPS68470 PMIC.
5858
TPS68470 device is an advanced power management unit that powers

drivers/extcon/extcon-max14577.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Chanwoo Choi <[email protected]>
77
// Krzysztof Kozlowski <[email protected]>
88

9+
#include <linux/devm-helpers.h>
910
#include <linux/kernel.h>
1011
#include <linux/module.h>
1112
#include <linux/i2c.h>
@@ -673,7 +674,10 @@ static int max14577_muic_probe(struct platform_device *pdev)
673674
platform_set_drvdata(pdev, info);
674675
mutex_init(&info->mutex);
675676

676-
INIT_WORK(&info->irq_work, max14577_muic_irq_work);
677+
ret = devm_work_autocancel(&pdev->dev, &info->irq_work,
678+
max14577_muic_irq_work);
679+
if (ret)
680+
return ret;
677681

678682
switch (max14577->dev_type) {
679683
case MAXIM_DEVICE_TYPE_MAX77836:
@@ -766,15 +770,6 @@ static int max14577_muic_probe(struct platform_device *pdev)
766770
return ret;
767771
}
768772

769-
static int max14577_muic_remove(struct platform_device *pdev)
770-
{
771-
struct max14577_muic_info *info = platform_get_drvdata(pdev);
772-
773-
cancel_work_sync(&info->irq_work);
774-
775-
return 0;
776-
}
777-
778773
static const struct platform_device_id max14577_muic_id[] = {
779774
{ "max14577-muic", MAXIM_DEVICE_TYPE_MAX14577, },
780775
{ "max77836-muic", MAXIM_DEVICE_TYPE_MAX77836, },
@@ -797,7 +792,6 @@ static struct platform_driver max14577_muic_driver = {
797792
.of_match_table = of_max14577_muic_dt_match,
798793
},
799794
.probe = max14577_muic_probe,
800-
.remove = max14577_muic_remove,
801795
.id_table = max14577_muic_id,
802796
};
803797

0 commit comments

Comments
 (0)