aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-12-07platform/x86: intel-vbtn: Fix SW_TABLET_MODE always reporting 1 on some HP ↵Hans de Goede1-4/+8
x360 models Some HP x360 models have an ACPI VGBS method which sets bit 4 instead of bit 6 when NOT in tablet mode at boot. Inspecting all the DSDTs in my DSDT collection shows only one other model, the Medion E1239T ever setting bit 4 and it always sets this together with bit 6. So lets treat bit 4 as a second bit which when set indicates the device not being in tablet-mode, as we already do for bit 6. While at it also prefix all VGBS constant defines with "VGBS_". Note this wrokaround was first added to the kernel as commit d823346876a9 ("platform/x86: intel-vbtn: Fix SW_TABLET_MODE always reporting 1 on the HP Pavilion 11 x360"). After commit 8169bd3e6e19 ("platform/x86: intel-vbtn: Switch to an allow-list for SW_TABLET_MODE reporting") got added to the kernel this was reverted, because with the new allow-list approach the workaround was no longer necessary for the model on which the issue was first reported. But it turns out that the workaround is still necessary because some affected models report a chassis-type of 31 which is on the allow-list. BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1894017 Fixes: 21d64817c724 ("platform/x86: intel-vbtn: Revert "Fix SW_TABLET_MODE always reporting 1 on the HP Pavilion 11 x360"") Signed-off-by: Hans de Goede <[email protected]>
2020-12-07platform/x86: ISST: Change PCI device macrosSrinivas Pandruvada3-10/+8
Use PCI_VDEVICE and PCI_DEVICE_DATA macros. No functional changes are expected. Signed-off-by: Srinivas Pandruvada <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-12-07platform/x86: ISST: Allow configurable offset rangeSrinivas Pandruvada1-14/+36
The mmio offset range can be different based on the PCI device id. Here for INTEL_RAPL_PRIO_DEVID_1, the range is increased from 45 to 64. Pass the range as the driver_data. Also account for different ranges during save/restore via suspend/resume callbacks. Signed-off-by: Srinivas Pandruvada <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-12-07platform/x86: ISST: Check for unaligned mmio addressSrinivas Pandruvada1-0/+3
The address should be aligned to 4 byte boundary. So send an error for unaligned address. Signed-off-by: Srinivas Pandruvada <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-12-07acer-wireless: send an EV_SYN/SYN_REPORT between state changesDaniel Drake1-0/+1
Sending the switch state change twice within the same frame is invalid evdev protocol and only works if the client handles keys immediately as well. Processing events immediately is incorrect, it forces a fake order of events that does not exist on the device. Recent versions of libinput changed to only process the device state and SYN_REPORT time, so now the key event is lost. Same fix as 'commit <bff5bf9db1c94> ("platform/x86: asus-wireless: send an EV_SYN/SYN_REPORT between state changes")' Signed-off-by: Daniel Drake <[email protected]> Signed-off-by: Chris Chiu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-12-07platform/x86: dell-wmi-sysman: work around for BIOS bugDivya Bharathi1-1/+7
BIOS sets incorrect value (zero) when SET value passed for integer attribute with + sign. Added workaround to remove + sign before passing input to BIOS. Co-developed-by: Mario Limonciello <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Co-developed-by: Prasanth KSR <[email protected]> Signed-off-by: Prasanth KSR <[email protected]> Signed-off-by: Divya Bharathi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-12-07platform/x86: mlx-platform: remove an unused variableArnd Bergmann1-11/+2
The only reference to the mlxplat_mlxcpld_psu[] array got removed, so there is now a warning from clang: drivers/platform/x86/mlx-platform.c:322:30: error: variable 'mlxplat_mlxcpld_psu' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static struct i2c_board_info mlxplat_mlxcpld_psu[] = { Remove the array as well and adapt the ARRAY_SIZE() call accordingly. Fixes: 912b341585e3 ("platform/x86: mlx-platform: Remove PSU EEPROM from MSN274x platform configuration") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Vadim Pasternak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-12-02platform/x86: thinkpad_acpi: remove trailing semicolon in macro definitionTom Rix1-1/+1
The macro use will already have a semicolon. Signed-off-by: Tom Rix <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-12-02platform/x86: dell-smbios-base: Fix error return code in dell_smbios_initQinglang Miao1-0/+1
Fix to return the error code -ENODEV when fails to init wmi and smm. Fixes: 41e36f2f85af ("platform/x86: dell-smbios: Link all dell-smbios-* modules together") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Qinglang Miao <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-12-02platform/x86: intel-vbtn: Allow switch events on Acer Switch Alpha 12Carlos Garnacho1-0/+6
This 2-in-1 model (Product name: Switch SA5-271) features a SW_TABLET_MODE that works as it would be expected, both when detaching the keyboard and when folding it behind the tablet body. It used to work until the introduction of the allow list at commit 8169bd3e6e193 ("platform/x86: intel-vbtn: Switch to an allow-list for SW_TABLET_MODE reporting"). Add this model to it, so that the Virtual Buttons device announces the EV_SW features again. Fixes: 8169bd3e6e193 ("platform/x86: intel-vbtn: Switch to an allow-list for SW_TABLET_MODE reporting") Cc: [email protected] Signed-off-by: Carlos Garnacho <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-26platform/x86: mlx-platform: Remove PSU EEPROM from MSN274x platform ↵Vadim Pasternak1-4/+2
configuration Remove PSU EEPROM configuration for systems class equipped with Mellanox chip Spectrum and ATOM CPU - system types MSN274x. Till now all the systems from this class used few types of power units, all equipped with EEPROM device with address space two bytes. Thus, all these devices have been handled by EEPROM driver "24c02". There is a new requirement is to support power unit replacement by "off the shelf" device, matching electrical required parameters. Such device can be equipped with different EEPROM type, which could be one byte address space addressing or even could be not equipped with EEPROM. In such case "24c02" will not work. Fixes: ef08e14a3 ("platform/x86: mlx-platform: Add support for new msn274x system type") Signed-off-by: Vadim Pasternak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-26platform/x86: mlx-platform: Remove PSU EEPROM from default platform ↵Vadim Pasternak1-4/+2
configuration Remove PSU EEPROM configuration for systems class equipped with Mellanox chip Spectrum and Celeron CPU - system types MSN2700, MSN2100. Till now all the systems from this class used few types of power units, all equipped with EEPROM device with address space two bytes. Thus, all these devices have been handled by EEPROM driver "24c02". There is a new requirement is to support power unit replacement by "off the shelf" device, matching electrical required parameters. Such device can be equipped with different EEPROM type, which could be one byte address space addressing or even could be not equipped with EEPROM. In such case "24c02" will not work. Fixes: c6acad68e ("platform/mellanox: mlxreg-hotplug: Modify to use a regmap interface") Fixes: ba814fdd0 ("platform/x86: mlx-platform: Use defines for bus assignment") Signed-off-by: Vadim Pasternak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-26platform/x86: thinkpad_acpi: Whitelist P15 firmware for dual fan controlMatthias Maier1-0/+1
This commit enables dual fan control for the following new Lenovo models: P15, P15v. Signed-off-by: Matthias Maier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-25platform/x86: thinkpad_acpi: Add palm sensor supportMark Pearson1-59/+103
Add support to thinkpad_acpi for returning the status of the palm sensor. This patch builds on the work done previously for the input device implementation (which was not needed). Both lap and palm sensor are using sysfs and they are combined into the proxsensor block. Note: On some platforms, because of an issue in the HW implementation, the palm sensor presence may be incorrectly advertised as always enabled even if a palm sensor is not present. The palm sensor is intended for WWAN transmission power control and should be available and correct on all WWAN enabled systems. It is not recommended to use this interface for other use cases. Signed-off-by: Mark Pearson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-24platform/x86: asus-wmi: Add userspace notification for performance mode changeVasiliy Kupriakov1-0/+8
When user presses Fn-F5, the driver automatically changes throttle thermal policy (or fan boost mode, depending on laptop model). It would be convenient for userspace software to be able to poll on corresponding sysfs variable. For example, to show a notification about mode change. Note that there is currently no way to handle Fn-F5 from userspace directly, driver does not pass it. Signed-off-by: Vasiliy Kupriakov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-24platform/x86: touchscreen_dmi: Add info for the Irbis TW118 tabletHans de Goede1-0/+23
Add touchscreen info for the Irbis TW118 tablet. Reported-and-tested-by: russianneuromancer <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-11-24platform/x86: intel-vbtn: Support for tablet mode on HP Pavilion 13 x360 PCMax Verevkin1-0/+6
The Pavilion 13 x360 PC has a chassis-type which does not indicate it is a convertible, while it is actually a convertible. Add it to the dmi_switches_allow_list. Signed-off-by: Max Verevkin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-24platform/x86: thinkpad_acpi: Send tablet mode switch at wakeup timeBenjamin Berg1-0/+1
The lid state may change while the machine is suspended. As such, we may need to re-check the state at wake-up time (at least when waking up from hibernation). Add the appropriate call to the resume handler in order to sync the SW_TABLET_MODE switch state with the hardware state. Fixes: dda3ec0aa631 ("platform/x86: thinkpad_acpi: Implement tablet mode using GMMS method") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210269 Signed-off-by: Benjamin Berg <[email protected]> Acked-by: Henrique de Moraes Holschuh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-24platform/x86: acer-wmi: Add ACER_CAP_KBD_DOCK quirk for the Aspire Switch ↵Hans de Goede1-0/+9
10E SW3-016 Add the Acer Aspire Switch 10E SW3-016 to the list of models which use the Acer Switch WMI interface for reporting SW_TABLET_MODE. Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-11-24platform/x86: toshiba_acpi: Fix the wrong variable assignmentKaixu Xia1-2/+1
The commit 78429e55e4057 ("platform/x86: toshiba_acpi: Clean up variable declaration") cleans up variable declaration in video_proc_write(). Seems it does the variable assignment in the wrong place, this results in dead code and changes the source code logic. Fix it by doing the assignment at the beginning of the funciton. Fixes: 78429e55e4057 ("platform/x86: toshiba_acpi: Clean up variable declaration") Reported-by: Tosk Robot <[email protected]> Signed-off-by: Kaixu Xia <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-24platform/surface: gpe: Add support for 15" Intel version of Surface Laptop 3Maximilian Luz1-0/+12
In addition to a 13" version, there is also a 15" (business) version of the Surface Laptop 3 based on Intel CPUs. This version also handles wakeup by lid via (unmarked) GPEs, so add support for it as well. Signed-off-by: Maximilian Luz <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-24platform/x86: pmt: Fix a potential Oops on error in probeDan Carpenter1-1/+2
The "ns->attr_grp" pointer can be NULL so this error handling code needs to check for that to avoid an Oops. Fixes: e2729113ce66 ("platform/x86: Intel PMT class driver") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: David E. Box <[email protected]> Link: https://lore.kernel.org/r/20201117072251.GC1111239@mwanda Signed-off-by: Hans de Goede <[email protected]>
2020-11-24platform/x86: i2c-multi-instantiate: Use device_get_match_data() to get ↵Andy Shevchenko1-4/+3
driver data Use device_get_match_data() to get driver data instead of boilerplate code. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-24platform/x86: i2c-multi-instantiate: Simplify with dev_err_probe()Andy Shevchenko1-3/+2
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-24platform/x86: i2c-multi-instantiate: Drop redundant ACPI_PTR()Andy Shevchenko1-1/+1
The driver depends on ACPI, ACPI_PTR() resolution is always the same. Otherwise a compiler may produce a warning. That said, the rule of thumb either ugly ifdeffery with ACPI_PTR or none should be used in a driver. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-10MAINTAINERS: new panasonic-laptop maintainerKenneth Chan1-1/+1
Take over maintainership of panasonic-laptop from Harald Welte. Signed-off-by: Kenneth Chan <[email protected]> Acked-by: Harald Welte <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-10platform/x86: panasonic-laptop: Add sysfs attributes for firmware brightness ↵Kenneth Chan1-0/+109
registers Panasonic laptops (at least from CF-W4 onwards) have dedicated firmware registers for saving ac/dc and current brightness. They are a bit confusing so here's some explanations: AC_MIN_BRIGHT, AC_MAX_BRIGHT, DC_MIN_BRIGHT, DC_MAX_BRIGHT: Read-only. Values: 0x01 and 0x15 respectively. AC_CUR_BRIGHT, DC_CUR_BRIGHT: Read-Write. 0x00-0xFF. Store user-defined AC/DC brightness. However, they do not represent current brightness so they should be named AC_BRIGHT and DC_BRIGHT instead. CUR_BRIGHT (present since CF-W4): Read-Write. 0x00-0xFF. It sets the current brightness. It won't update itself if brightness is changed via other means, e.g. acpi_video0. Another CUR_BRIGHT (added since CF-W5): Read-Write. 0x01-0x15. Its value always synchronizes with current brightness. Not implemented in this version. Currently the backlight API interacts with AC_CUR_BRIGHT (probably because it's the only bl register available in earlier models?). This patch adds sysfs attributes for AC_CUR_BRIGHT, DC_CUR_BRIGHT and CUR_BRIGHT. It also fixes the error of https://lkml.org/lkml/2020/8/19/1264. PS: I think the backlight API should interact with CUR_BRIGHT instead of AC_CUR_BRIGHT. But it involves complications like mapping between 0x01-0x15 or 0x00-0x14 (the backlight API) and 0x00-0xFF (CUR_BRIGHT). I'll leave the discussion for a later version. Signed-off-by: Kenneth Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-10platform/x86: panasonic-laptop: Add support for battery charging threshold ↵Kenneth Chan1-3/+83
(eco mode) Add battery charging threshold (aka ECO mode) support. NOTE: The state of ECO mode is persistent until the next POST cycle which reset it to previous state. Signed-off-by: Kenneth Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-10platform/x86: panasonic-laptop: Resolve hotkey double trigger bugKenneth Chan1-3/+6
Sometimes double ACPI events are triggered for brightness, vol and mute hotkeys. This patch fixes it. Signed-off-by: Kenneth Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-10platform/x86: panasonic-laptop: Add write support to muteKenneth Chan1-1/+24
Add write support to the mute platform device Signed-off-by: Kenneth Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-10platform/x86: panasonic-laptop: Fix sticky key init bugKenneth Chan1-9/+15
The return value of the sticky key on some models (e.g. CF-W5) do not reflect its state. How to retrieve its state from firmware is unknown. The safest bet is to reset it at module init and store its state in pcc struct. Signed-off-by: Kenneth Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-10platform/x86: panasonic-laptop: Fix naming of platform files for consistency ↵Kenneth Chan1-9/+11
with other modules Change platform device function names for consistency with other modules Signed-off-by: Kenneth Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-10platform/x86: panasonic-laptop: Split MODULE_AUTHOR() by one author per ↵Kenneth Chan1-1/+6
macro call In reply to https://lkml.org/lkml/2020/8/19/186 to split MODULE_AUTHOR() per macro call. Signed-off-by: Kenneth Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-10platform/x86: panasonic-laptop: Replace ACPI prints with pr_*() macrosKenneth Chan1-33/+14
Replace ACPI prints with pr_*() macros for consistency with other platform devices. Clean up obsolete ACPI_HOTKEY_COMPONENT code. Signed-off-by: Kenneth Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-10platform/x86: panasonic-laptop: Add support for optical driver power in Y ↵Kenneth Chan1-0/+190
and W series The physical optical drive switch is present in Y and W series that switches on the drive but fails to turn it off. The idea is to be able to toggle the drive power by software and/or hardware. This patch merges Martin Lucina <[email protected]>'s work that took care of the software part. Code is also added for the physical switch to power off the drive. Signed-off-by: Kenneth Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-10platform/x86: acer-wmi: add automatic keyboard background light toggle key ↵Timo Witte1-0/+1
as KEY_LIGHTS_TOGGLE Got a dmesg message on my AMD Renoir based Acer laptop: "acer_wmi: Unknown key number - 0x84" when toggling keyboard background light Signed-off-by: Timo Witte <[email protected]> Reviewed-by: "Lee, Chun-Yi" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-09platform/x86: intel-hid: fix _DSM function index handlingZhen Gong1-2/+14
According to the ACPI spec 9.1.1 _DSM (Device Specific Method), intel_hid_dsm_fn_mask, acquired from function index 0, is "a buffer containing one bit for each function index". When validitaing fn_index, it should be compared with corresponding bit. This buffer is usually longer than a byte. Depending on whether INTEL_HID_DSM_HEBC_V2_FN exist, it could be either "Buffer (0x02) { 0xFF, 0x01 }" or "Buffer (0x02) { 0xFF, 0x03 }". Probably it won't grow larger according to the description. On older platforms, available functions could be fewer or not supported at all, i.e., "Buffer (One) { 0x00 }". Signed-off-by: Zhen Gong <[email protected]> Link: https://lore.kernel.org/r/CAJCLVRCyp0ASdWTx-PxsrDC9zFBPw0U2AtPip+_Hpj2r5gUPwA@mail.gmail.com Signed-off-by: Hans de Goede <[email protected]>
2020-11-09platform/x86: intel_pmc_core: Assign boolean values to a bool variableKaixu Xia1-1/+1
Fix the following coccinelle warnings: ./drivers/platform/x86/intel_pmc_core.c:932:1-16: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Kaixu Xia <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-09platform/x86: amd-pmc: Add AMD platform support for S2IdleShyam Sundar S K4-0/+309
AMD Power Management Controller driver a.k.a. amd-pmc driver is the controller which is meant for the final S2Idle transaction that goes to the PMFW running on the AMD SMU (System Management Unit) responsible for tuning of the VDD. Once all the monitored list or the idle constraints are met, this driver would go and set the OS_HINT (meaning all the devices have reached to their lowest state possible) via the SMU mailboxes. This driver would also provide some debug capabilities via debugfs. Signed-off-by: Shyam Sundar S K <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-09platform/x86: thinkpad_acpi: Add BAT1 is primary battery quirk for Thinkpad ↵Hans de Goede1-0/+1
Yoga 11e 4th gen The Thinkpad Yoga 11e 4th gen with the N3450 / Celeron CPU only has one battery which is named BAT1 instead of the expected BAT0, add a quirk for this. This fixes not being able to set the charging tresholds on this model; and this alsoe fixes the following errors in dmesg: ACPI: \_SB_.PCI0.LPCB.EC__.HKEY: BCTG evaluated but flagged as error thinkpad_acpi: Error probing battery 2 battery: extension failed to load: ThinkPad Battery Extension battery: extension unregistered: ThinkPad Battery Extension Note that the added quirk is for the "R0K" BIOS versions which are used on the Thinkpad Yoga 11e 4th gen's with a Celeron CPU, there is a separate "R0L" BIOS for the i3/i5 based versions. This may also need the same quirk, but if that really is necessary is unknown. Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-11-09platform/x86: thinkpad_acpi: Do not report SW_TABLET_MODE on Yoga 11eHans de Goede1-1/+8
The Yoga 11e series has 2 accelerometers described by a BOSC0200 ACPI node. This setup relies on a Windows service which reads both accelerometers and then calculates the angle between the 2 halves to determine laptop / tent / tablet mode and then reports the calculated mode back to the EC by calling special ACPI methods on the BOSC0200 node. The bmc150 iio driver does not support this (it involves double calculations requiring sqrt and arccos so this really needs to be done in userspace), as a result of this on the Yoga 11e the thinkpad_acpi code always reports SW_TABLET_MODE=0, starting with GNOME 3.38 reporting SW_TABLET_MODE=0 causes GNOME to: 1. Not show the onscreen keyboard when a text-input field is focussed with the touchscreen. 2. Disable accelerometer based auto display-rotation. This makes sense when in laptop-mode but not when in tablet-mode. But since for the Yoga 11e the thinkpad_acpi code always reports SW_TABLET_MODE=0, GNOME does not know when the device is in tablet-mode. Stop reporting the broken (always 0) SW_TABLET_MODE on Yoga 11e models to fix this. Note there are plans for userspace to support 360 degree hinges style 2-in-1s with 2 accelerometers and figure out the mode by itself, see: https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/issues/216 Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-11-09platform/x86: thinkpad_acpi: add P1 gen3 second fan supportIakov 'Jake' Kirilenko1-0/+1
Tested on my P1 gen3, works fine with `thinkfan`. Since thinkpad_acpi fan control is off by default, it is safe to add 2nd fan control for brave overclockers Signed-off-by: Iakov 'Jake' Kirilenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-09platform/x86: dell-wmi-sysman: fix init_bios_attributes() error handlingDan Carpenter1-4/+6
Calling release_attributes_data() while holding the "wmi_priv.mutex" will lead to a dead lock. The other problem is that if kzalloc() fails then this should return -ENOMEM but currently it returns success. Fixes: e8a60aa7404b ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/20201103101735.GB1127762@mwanda Signed-off-by: Hans de Goede <[email protected]>
2020-11-09platform/surface: Add Driver to set up lid GPEs on MS Surface deviceMaximilian Luz4-0/+326
Conventionally, wake-up events for a specific device, in our case the lid device, are managed via the ACPI _PRW field. While this does not seem strictly necessary based on ACPI spec, the kernel disables GPE wakeups to avoid non-wakeup interrupts preventing suspend by default and only enables GPEs associated via the _PRW field with a wake-up capable device. This behavior has been introduced in commit f941d3e41da7 ("ACPI: EC / PM: Disable non-wakeup GPEs for suspend-to-idle") and is described in more detail in its commit message. Unfortunately, on MS Surface devices, there is no _PRW field present on the lid device, thus no GPE is associated with it, and therefore the GPE responsible for sending the status-change notification to the lid gets disabled during suspend, making it impossible to wake the device via the lid. This patch introduces a pseudo-device and respective driver which, based on some DMI matching, marks the corresponding GPE of the lid device for wake and enables it during suspend. The behavior of this driver models the behavior of the ACPI/PM core for normal wakeup GPEs, properly declared via the _PRW field. Signed-off-by: Maximilian Luz <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-11-09Merge tag 'ib-mfd-x86-v5.11' into review-hansHans de Goede12-0/+1238
Immutable branch between MFD and x86 due for the v5.11 merge window
2020-11-04platform/x86: Intel PMT Crashlog capability driverAlexander Duyck4-0/+405
Add support for the Intel Platform Monitoring Technology crashlog interface. This interface provides a few sysfs values to allow for controlling the crashlog telemetry interface as well as a character driver to allow for mapping the crashlog memory region so that it can be accessed after a crashlog has been recorded. This driver is meant to only support the server version of the crashlog which is identified as crash_type 1 with a version of zero. Currently no other types are supported. Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: David E. Box <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2020-11-04platform/x86: Intel PMT Telemetry capability driverAlexander Duyck3-0/+172
PMT Telemetry is a capability of the Intel Platform Monitoring Technology. The Telemetry capability provides access to device telemetry metrics that provide hardware performance data to users from read-only register spaces. With this driver present the intel_pmt directory can be populated with telem<x> devices. These devices will contain the standard intel_pmt sysfs data and a "telem" binary sysfs attribute which can be used to access the telemetry data. Also create a PCI device id list for early telemetry hardware that require workarounds for known issues. Signed-off-by: Alexander Duyck <[email protected]> Co-developed-by: David E. Box <[email protected]> Signed-off-by: David E. Box <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2020-11-04platform/x86: Intel PMT class driverAlexander Duyck6-0/+417
Intel Platform Monitoring Technology is meant to provide a common way to access telemetry and system metrics. Register mappings are not provided by the driver. Instead, a GUID is read from a header for each endpoint. The GUID identifies the device and is to be used with an XML, provided by the vendor, to discover the available set of metrics and their register mapping. This allows firmware updates to modify the register space without needing to update the driver every time with new mappings. Firmware writes a new GUID in this case to specify the new mapping. Software tools with access to the associated XML file can then interpret the changes. The module manages access to all Intel PMT endpoints on a system, independent of the device exporting them. It creates an intel_pmt class to manage the devices. For each telemetry endpoint, sysfs files provide GUID and size information as well as a pointer to the parent device the telemetry came from. Software may discover the association between endpoints and devices by iterating through the list in sysfs, or by looking for the existence of the class folder under the device of interest. A binary sysfs attribute of the same name allows software to then read or map the telemetry space for direct access. Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: David E. Box <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2020-11-04mfd: Intel Platform Monitoring Technology supportDavid E. Box4-0/+239
Intel Platform Monitoring Technology (PMT) is an architecture for enumerating and accessing hardware monitoring facilities. PMT supports multiple types of monitoring capabilities. This driver creates platform devices for each type so that they may be managed by capability specific drivers (to be introduced). Capabilities are discovered using PCIe DVSEC ids. Support is included for the 3 current capability types, Telemetry, Watcher, and Crashlog. The features are available on new Intel platforms starting from Tiger Lake for which support is added. This patch adds support for Tiger Lake (TGL), Alder Lake (ADL), and Out-of-Band Management Services Module (OOBMSM). Also add a quirk mechanism for several early hardware differences and bugs. For Tiger Lake and Alder Lake, do not support Watcher and Crashlog capabilities since they will not be compatible with future product. Also, fix use a quirk to fix the discovery table offset. Co-developed-by: Alexander Duyck <[email protected]> Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: David E. Box <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2020-11-04PCI: Add defines for Designated Vendor-Specific Extended CapabilityDavid E. Box1-0/+5
Add PCIe Designated Vendor-Specific Extended Capability (DVSEC) and defines for the header offsets. Defined in PCIe r5.0, sec 7.9.6. Signed-off-by: David E. Box <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Lee Jones <[email protected]>