summaryrefslogtreecommitdiff
path: root/drivers/platform/x86
AgeCommit message (Collapse)AuthorFilesLines
2021-07-05Merge tag 'driver-core-5.14-rc1' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core changes from Greg KH: "Here is the small set of driver core and debugfs updates for 5.14-rc1. Included in here are: - debugfs api cleanups (touched some drivers) - devres updates - tiny driver core updates and tweaks Nothing major in here at all, and all have been in linux-next for a while with no reported issues" * tag 'driver-core-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (27 commits) docs: ABI: testing: sysfs-firmware-memmap: add some memmap types. devres: Enable trace events devres: No need to call remove_nodes() when there none present devres: Use list_for_each_safe_from() in remove_nodes() devres: Make locking straight forward in release_nodes() kernfs: move revalidate to be near lookup drivers/base: Constify static attribute_group structs firmware_loader: remove unneeded 'comma' macro devcoredump: remove contact information driver core: Drop helper devm_platform_ioremap_resource_wc() component: Rename 'dev' to 'parent' component: Drop 'dev' argument to component_match_realloc() device property: Don't check for NULL twice in the loops driver core: auxiliary bus: Fix typo in the docs drivers/base/node.c: make CACHE_ATTR define static DEVICE_ATTR_RO debugfs: remove return value of debugfs_create_ulong() debugfs: remove return value of debugfs_create_bool() scsi: snic: debugfs: remove local storage of debugfs files b43: don't save dentries for debugfs b43legacy: don't save dentries for debugfs ...
2021-06-28platform/x86: dell-wmi-sysman: Change user experience when Admin/System ↵Prasanth KSR1-2/+2
Password is modified Whenever user has changed an Admin/System Password using the sysfs, then we are automatically copying the new password to existing password field. Co-developed-by: Divya Bharathi <divya.bharathi@dell.com> Signed-off-by: Divya Bharathi <divya.bharathi@dell.com> Signed-off-by: Prasanth KSR <prasanth.ksr@dell.com> Link: https://lore.kernel.org/r/20210628084906.4233-1-prasanth.ksr@dell.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-28platform/x86: intel_skl_int3472: Uninitialized variable in ↵Dan Carpenter1-2/+2
skl_int3472_handle_gpio_resources() This function returns negative error codes, zero (to indicate that everything has been completed successfully) and one (to indicate that more resources need to be handled still). This code prints an uninitialized error message when the function returns one which potentially leads to an Oops. Fixes: 5de691bffe57 ("platform/x86: Add intel_skl_int3472 driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Daniel Scally <djrscally@gmail.com> Link: https://lore.kernel.org/r/YNXTkLNtiTDlFlZa@mwanda Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-28platform/x86: think-lmi: Move kfree(setting->possible_values) to ↵Hans de Goede1-1/+1
tlmi_attr_setting_release() We must not free the possible_values string before we have called sysfs_remove_group(kobj, &tlmi_attr_group) otherwise there is a race where a sysfs read of possible_values could reference the free-ed memory. Move the kfree(setting->possible_values) together with the free of the actual tlmi_attr_setting struct to avoid this race. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-28platform/x86: think-lmi: Split current_value to reflect only the valueMario Limonciello1-2/+7
Currently attributes will show things like: `BootOrderLock,Disable` rather than just `Disable`. Of course this works, but the attribute is intended to be read by userspace tools and not require further processing. That is a userspace tool can display a drop down of `possible_values` and `current_value` is one of them from the list. This also aligns `think-lmi` with how `dell-wmi-sysman` works. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20210622200755.12379-3-mario.limonciello@amd.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-28platform/x86: think-lmi: Fix issues with duplicate attributesMario Limonciello1-0/+11
On an AMD based Lenovo T14, I find that the module doesn't work at all, and instead has a traceback with messages like: ``` sysfs: cannot create duplicate filename '/devices/virtual/firmware-attributes/thinklmi/attributes/Reserved' ``` Duplicate and reserved values showing up appear to be a firmware bug, but they shouldn't make the driver explode. So catch them and skip them. Fixes: a40cd7ef22fb ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms") Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20210622200755.12379-2-mario.limonciello@amd.com [hdegoede@redhat.com: Add missing kfree(tlmi_priv.setting[i])] Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-22platform/x86: think-lmi: Return EINVAL when kbdlang gets set to a 0 length ↵Hans de Goede1-8/+3
string Commit 0ddcf3a6b442 ("platform/x86: think-lmi: Avoid potential read before start of the buffer") moved the length == 0 up to before stripping the '\n' which typically gets added when users echo a value to a sysfs-attribute from the shell. This avoids a potential buffer-underrun, but it also causes a behavioral change, prior to this change "echo > kbdlang", iow writing just a single '\n' would result in an EINVAL error, but after the change this gets accepted setting kbdlang to an empty string. Fix this by replacing the manual '\n' check with using strchrnul() to get the length till '\n' or terminating 0 in one go; and then do the length != 0 check after this. Fixes: 0ddcf3a6b442 ("platform/x86: think-lmi: Avoid potential read before start of the buffer") Reported-by: Juha Leppänen <juha_efku@dnainternet.net> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210621193648.44138-1-hdegoede@redhat.com
2021-06-22platform/x86: intel_cht_int33fe: Move to its own subfolderAndy Shevchenko10-28/+31
Since we have started collecting Intel x86 specific drivers in their own folder, move intel_cht_int33fe to its own subfolder there. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210618125516.53510-8-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-22platform/x86: intel_skl_int3472: Move to intel/ subfolderAndy Shevchenko11-3/+32
Start collecting Intel x86 related drivers in its own subfolder. Move intel_skl_int3472 first. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210618125516.53510-7-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-22platform/x86: intel_skl_int3472: Provide skl_int3472_unregister_clock()Andy Shevchenko3-3/+10
For the sake of APIs to be properly layered provide skl_int3472_unregister_clock(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Daniel Scally <djrscally@gmail.com> Tested-by: Daniel Scally <djrscally@gmail.com> Link: https://lore.kernel.org/r/20210618125516.53510-6-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-22platform/x86: intel_skl_int3472: Provide skl_int3472_unregister_regulator()Andy Shevchenko3-2/+10
For the sake of APIs to be properly layered provide skl_int3472_unregister_regulator(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Daniel Scally <djrscally@gmail.com> Tested-by: Daniel Scally <djrscally@gmail.com> Link: https://lore.kernel.org/r/20210618125516.53510-5-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-22platform/x86: intel_skl_int3472: Use ACPI GPIO resource directlyAndy Shevchenko3-20/+17
When we call acpi_gpio_get_io_resource(), the output will be the pointer to the ACPI GPIO resource. Use it directly instead of dereferencing the generic resource. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Daniel Scally <djrscally@gmail.com> Tested-by: Daniel Scally <djrscally@gmail.com> Link: https://lore.kernel.org/r/20210618125516.53510-4-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-22platform/x86: intel_skl_int3472: Fix dependencies (drop CLKDEV_LOOKUP)Andy Shevchenko1-1/+1
Besides the fact that COMMON_CLK selects CLKDEV_LOOKUP, the latter is going to be removed from clock framework. Reviewed-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210618125516.53510-3-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-22platform/x86: intel_skl_int3472: Free ACPI device resources after useAndy Shevchenko1-7/+6
We may free ACPI device resources immediately after use. Refactor skl_int3472_parse_crs() accordingly. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Daniel Scally <djrscally@gmail.com> Tested-by: Daniel Scally <djrscally@gmail.com> Link: https://lore.kernel.org/r/20210618125516.53510-2-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-22platform/x86: Remove "default n" entriesAndy Shevchenko2-2/+0
Linus already once did that for PDx86, don't repeat our mistakes. TL;DR: 'n' *is* the default 'default'. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210618125516.53510-1-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-18platform/x86: ISST: Use numa node id for cpu pci dev mappingSrinivas Pandruvada1-2/+46
There is a problem in mapping CPU to a PCI device instance when the bus numbers are reused in different packages. This was observed on some Sapphire Rapids systems. The current implementation reads bus number assigned to a CPU package via MSR 0x128. This allows to establish relationship between a CPU and a PCI device. This allows to update power related parameters to a MMIO offset in a PCI device space which is unique to a CPU. But if two packages uses same bus number then this mapping will not be unique. When bus number is reused, PCI device will use different domain number or segment number. So we need to be aware of this domain information while matching CPU to PCI bus number. This domain information is not available via any MSR. So need to use ACPI numa node information. There is an interface already available in the Linux to read numa node for a CPU and a PCI device. This change uses this interface to check the numa node of a match PCI device with bus number. If the bus number and numa node matches with the CPU's assigned bus number and numa node, the matched PCI device instance will be returned to the caller. It is possible that before Sapphire Rapids, the numa node is not defined for the Speed Select PCI device in some OEM systems. In this case to restore old behavior, return the last matched PCI device for domain 0 unlsess there are more than one matches. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/r/20210616221329.1909276-2-srinivas.pandruvada@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-18platform/x86: ISST: Optimize CPU to PCI device mappingSrinivas Pandruvada1-5/+24
It was observed that some of the high performance benchmarks are spending more time in kernel depending on which CPU package they are executing. The difference is significant and benchmark scores varies more than 10%. These benchmarks adjust class of service to improve thread performance which run in parallel. This class of service change causes access to MMIO region of Intel Speed Select PCI devices depending on the CPU package they are executing. This mapping from CPU to PCI device instance uses a standard Linux PCI interface "pci_get_domain_bus_and_slot()". This function does a linear search to get to a PCI device. Since these platforms have 100+ PCI devices, this search can be expensive in fast path for benchmarks. Since the device and function of PCI device is fixed for Intel Speed Select PCI devices, the CPU to PCI device information can be cached at the same time when bus number for the CPU is read. In this way during runtime the cached information can be used. This improves performance of these benchmarks significantly. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/r/20210616221329.1909276-1-srinivas.pandruvada@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: Add intel_skl_int3472 driverDaniel Scally9-0/+1012
ACPI devices with _HID INT3472 are currently matched to the tps68470 driver, however this does not cover all situations in which that _HID occurs. We've encountered three possibilities: 1. On Chrome OS devices, an ACPI device with _HID INT3472 (representing a physical TPS68470 device) that requires a GPIO and OpRegion driver 2. On devices designed for Windows, an ACPI device with _HID INT3472 (again representing a physical TPS68470 device) which requires GPIO, Clock and Regulator drivers. 3. On other devices designed for Windows, an ACPI device with _HID INT3472 which does **not** represent a physical TPS68470, and is instead used as a dummy device to group some system GPIO lines which are meant to be consumed by the sensor that is dependent on this entry. This commit adds a new module, registering a platform driver to deal with the 3rd scenario plus an i2c driver to deal with #1 and #2, by querying the CLDB buffer found against INT3472 entries to determine which is most appropriate. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Daniel Scally <djrscally@gmail.com> Link: https://lore.kernel.org/r/20210603224007.120560-6-djrscally@gmail.com [hdegoede@redhat.com Make skl_int3472_tps68470_calc_type() static] Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16Merge tag 'platform-drivers-x86-goodix-v5.14-1' into review-hansHans de Goede1-0/+85
Signed tag for the immutable platform-drivers-x86-goodix branch for merging into the input subsystem.
2021-06-16platform/x86: think-lmi: Add missing MODULE_DEVICE_TABLEZou Wei1-0/+1
This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Link: https://lore.kernel.org/r/1623811809-65099-1-git-send-email-zou_wei@huawei.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: think-lmi: Avoid potential read before start of the bufferHans de Goede1-1/+4
If length equals 0 then reading buf[length-1] will read before the start of the buffer. Avoid this by moving the length == 0 check up. Cc: Mark Pearson <markpearson@lenovo.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210609151752.156902-2-hdegoede@redhat.com
2021-06-16platform/x86: think-lmi: Fix check for admin password being setHans de Goede1-2/+2
tlmi_priv.pwd_admin->password is an array (not a pointer), so the correct way to check for the password being set is to check for tlmi_priv.pwd_admin->password[0] != 0. For the second check, replace the check with checking that auth_str is set instead. Cc: Mark Pearson <markpearson@lenovo.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reported-by: coverity-bot <keescook+coverity-bot@chromium.org> Addresses-Coverity-ID: 1505158 ("NO_EFFECT") Fixes: a7314b3b1d8a ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210609151752.156902-1-hdegoede@redhat.com
2021-06-16platform/x86: dell-wmi-sysman/think-lmi: Make fw_attr_class global staticHans de Goede2-2/+2
The dell-wmi-sysman and think-lmi kernel modules both have a global struct class *fw_attr_class variable, leading to the following compile errors when both are builtin: ld: drivers/platform/x86/think-lmi.o:(.bss+0x0): multiple definition of `fw_attr_class'; drivers/platform/x86/dell/dell-wmi-sysman/sysman.o:(.bss+0x0): first defined here In both cases the variable is only used in the file where it is declared. Make both declarations static to avoid the linker error. Cc: Mark Pearson <markpearson@lenovo.com> Cc: Dell.Client.Kernel@dell.com Reported-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210609145952.113393-1-hdegoede@redhat.com
2021-06-16platform/x86: intel_ips: fix set but unused warning in read_mgtvyangerkun1-1/+1
drivers/platform/x86/intel_ips.c:832:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] 832 | u16 ret; | ^~~ Fix it by mark ret as '__maybe_unused'. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: yangerkun <yangerkun@huawei.com> Link: https://lore.kernel.org/r/20210607014702.2981097-1-yangerkun@huawei.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16x86/platform/uv: Constify static attribute_group structRikard Falkeborn1-2/+2
The only use of base_attr_group and hubless_base_attr_group is to pass their addresses to sysfs_create_group() and sysfs_remove_group(), both which takes pointers to const attribute_group structs. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Reviewed-by: Justin Ernst <justin.ernst@hpe.com> Link: https://lore.kernel.org/r/20210605203807.60547-5-rikard.falkeborn@gmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: tc1100-wmi: Constify static attribute_group structRikard Falkeborn1-1/+1
The only use of tc1100_attribute_group is to pass its address to sysfs_create_group() and sysfs_remove_group(), both which takes pointer to const attribute_group structs. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Link: https://lore.kernel.org/r/20210605203807.60547-4-rikard.falkeborn@gmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: intel_pmt_crashlog: Constify static attribute_group structRikard Falkeborn1-1/+1
The only use of pmt_crashlog_group is to assign its address to the attr_grp field in the intel_pmt_namespace struct, which is a pointer to const attribute_group. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Link: https://lore.kernel.org/r/20210605203807.60547-3-rikard.falkeborn@gmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: hdaps: Constify static attribute_group structRikard Falkeborn1-1/+1
The only use of hdaps_attribute_group is to pass its address to sysfs_create_group() and sysfs_remove_group(), both which takes pointers to const attribute_group structs. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Reviewed-by: Frank Seidel <frank@f-seidel.de> Link: https://lore.kernel.org/r/20210605203807.60547-2-rikard.falkeborn@gmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: dell-wmi-sysman: fw_attr_inuse can be statickernel test robot1-1/+1
drivers/platform/x86/firmware_attributes_class.c:11:5: warning: symbol 'fw_attr_inuse' was not declared. Should it be static? Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/20210603153936.GA65404@7832cb195c0b Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: thinkpad-lmi: Remove unused display_name member from struct ↵Hans de Goede2-11/+0
tlmi_pwd_setting The struct tlmi_pwd_setting display_name member is initialized, but never read. Remove it and the TLMI_PWDTYPE_MAXLEN define. While at it also remove some other unused [MAX]LEN defines. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210531135911.82582-1-hdegoede@redhat.com
2021-06-16platform/x86: think-lmi: Add WMI interface support on Lenovo platformsMark Pearson4-0/+984
For Lenovo platforms that support a WMI interface to the BIOS add support, using the firmware-attributes class, to allow users to access and modify various BIOS related settings. Signed-off-by: Mark Pearson <markpearson@lenovo.com> Link: https://lore.kernel.org/r/20210530223111.25929-3-markpearson@lenovo.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: dell-wmi-sysman: Use firmware_attributes_class helperMark Pearson2-10/+9
Update Dell WMI sysman driver to use newly implemented helper module. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Pearson <markpearson@lenovo.com> Link: https://lore.kernel.org/r/20210530223111.25929-2-markpearson@lenovo.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: firmware_attributes_class: Create helper file for handling ↵Mark Pearson4-0/+68
firmware-attributes class registration events This offers shared code for registering the firmware_attributes_class, which is used by the Dell and Lenovo WMI management drivers. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Mark Pearson <markpearson@lenovo.com> Link: https://lore.kernel.org/r/20210530223111.25929-1-markpearson@lenovo.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: toshiba_acpi: Fix missing error code in ↵Jiapeng Chong1-0/+1
toshiba_acpi_setup_keyboard() The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'error'. Eliminate the follow smatch warning: drivers/platform/x86/toshiba_acpi.c:2834 toshiba_acpi_setup_keyboard() warn: missing error code 'error'. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Link: https://lore.kernel.org/r/1622628348-87035-1-git-send-email-jiapeng.chong@linux.alibaba.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: touchscreen_dmi: Fix Chuwi Hi10 Pro commentHans de Goede1-1/+1
Fix the comment on the entry for the Chuwi Hi10 Pro tablet: 1. Replace "Prus" type with "Pro". 2. Fix the model number, the Chuwi Hi10 Pro is the CWI529, not the CWI597. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210530104744.6720-1-hdegoede@redhat.com
2021-06-16platform/x86: dell-privacy: Add support for Dell hardware privacyPerry Yuan6-4/+460
add support for Dell privacy driver for the Dell units equipped hardware privacy design, which protect users privacy of audio and camera from hardware level. Once the audio or camera privacy mode activated, any applications will not get any audio or video stream when user pressed ctrl+F4 hotkey, audio privacy mode will be enabled, micmute led will be also changed accordingly The micmute led is fully controlled by hardware & EC(embedded controller) and camera mute hotkey is Ctrl+F9. Currently design only emits SW_CAMERA_LENS_COVER event while the camera lens shutter will be changed by EC & HW(hardware) control *The flow is like this: 1) User presses key. HW does stuff with this key (timeout timer is started) 2) WMI event is emitted from BIOS to kernel 3) WMI event is received by dell-privacy 4) KEY_MICMUTE emitted from dell-privacy 5) Userland picks up key and modifies kcontrol for SW mute 6) Codec kernel driver catches and calls ledtrig_audio_set 7) dell-privacy notifies EC, the timeout is cancelled and the HW mute is activated. If the EC is not notified then the HW mic mute will activate when the timeout triggers, just a bit later than with the active ack. Signed-off-by: Perry Yuan <perry_yuan@dell.com> Link: https://lore.kernel.org/r/20210506115605.1504-1-Perry_Yuan@Dell.com [hdegoede@redhat.com: Rework Kconfig/Makefile bits + other small fixups] Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: dell-wmi: Rename dell-wmi.c to dell-wmi-base.cHans de Goede2-0/+1
Rename dell-wmi.c to dell-wmi-base.c, so that we can have other dell-wmi-foo.c files which can be added to dell-wmi.ko as "plugins" controlled by separate boolean Kconfig options. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: thinkpad_acpi: Add X1 Carbon Gen 9 second fan supportTil Jasper Ullrich1-0/+1
The X1 Carbon Gen 9 uses two fans instead of one like the previous generation. This adds support for the second fan. It has been tested on my X1 Carbon Gen 9 (20XXS00100) and works fine. Signed-off-by: Til Jasper Ullrich <tju@tju.me> Link: https://lore.kernel.org/r/20210525150950.14805-1-tju@tju.me Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: thinkpad_acpi: Fix inconsistent indentingJiapeng Chong1-1/+1
Eliminate the follow smatch warning: drivers/platform/x86/thinkpad_acpi.c:7942 volume_write() warn: inconsistent indenting. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Link: https://lore.kernel.org/r/1621837438-70790-1-git-send-email-jiapeng.chong@linux.alibaba.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: ideapad-laptop: Ignore VPC event bit 10Hans de Goede1-0/+12
VPC event bit 10 gets set on a Yoga 300-11IBR when the EC believes that the device has changed between laptop/tent/stand/tablet mode. The EC relies on getting angle info from 2 accelerometers through a special windows service calling a DSM on the DUAL250E ACPI-device. Linux does not do this, making the laptop/tent/stand/tablet mode info unreliable. Ignore VPC event bit 10 to avoid the warnings triggered by the default case in ideapad_acpi_notify(). Note that the plan for Linux is to have iio-sensor-proxy read the 2 accelerometers and have it provide info about which mode 360° hinges 2-in-1s to the rest of userspace: https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/issues/216 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210523172331.177834-1-hdegoede@redhat.com
2021-06-16platform/x86: asus-nb-wmi: Revert "add support for ASUS ROG Zephyrus G14 and ↵Luke D. Jones1-82/+0
G15" The quirks added to asus-nb-wmi for the ASUS ROG Zephyrus G14 and G15 are wrong, they tell the asus-wmi code to use the vendor specific WMI backlight interface. But there is no such interface on these laptops. As a side effect, these quirks stop the acpi_video driver to register since they make acpi_video_get_backlight_type() return acpi_backlight_vendor, leaving only the native AMD backlight driver in place, which is the one we want. This happy coincidence is being replaced with a new quirk in drivers/acpi/video_detect.c which actually sets the backlight_type to acpi_backlight_native fixinf this properly. This reverts commit 13bceda68fb9 ("platform/x86: asus-nb-wmi: add support for ASUS ROG Zephyrus G14 and G15"). Signed-off-by: Luke D. Jones <luke@ljones.dev> Link: https://lore.kernel.org/r/20210419074915.393433-3-luke@ljones.dev Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: asus-nb-wmi: Revert "Drop duplicate DMI quirk structures"Luke D. Jones1-9/+14
This is a preparation revert for reverting the "add support for ASUS ROG Zephyrus G14 and G15" change. This reverts commit 67186653c903 ("platform/x86: asus-nb-wmi: Drop duplicate DMI quirk structures") Signed-off-by: Luke D. Jones <luke@ljones.dev> Link: https://lore.kernel.org/r/20210419074915.393433-2-luke@ljones.dev Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: Rename hp-wireless to wireless-hotkeyMario Limonciello4-107/+109
This driver was originally intended to support some HP laptops, but later support was added for Xioami and AMD laptops. Rename it to make it clear that it supports a larger variety of systems. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20210519174405.30155-1-mario.limonciello@amd.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: toshiba_haps: Fix missing newline in pr_debug call in ↵Hans de Goede1-1/+1
toshiba_haps_notify The pr_debug() call in toshiba_haps_notify() is missing a newline at the end of the string, add this. BugLink: https://bugs.debian.org/799193 Reported-by: Salvatore Bonaccorso <carnil@debian.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210519135618.139701-1-hdegoede@redhat.com
2021-06-16platform/x86: samsung-laptop: set debugfs blobs to read onlyWolfram Sang1-4/+4
Those blobs can only be read. So, don't confuse users with 'writable' flags. Also, remove S_IFREG because debugfs takes care of that. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20210517100746.29663-2-wsa+renesas@sang-engineering.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: samsung-laptop: use octal numbers for rwx file permissionsWolfram Sang1-21/+14
Andy asked me to do it before working further on the code. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20210517100746.29663-1-wsa+renesas@sang-engineering.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: dcdbas: drop unneeded assignment in host_control_smi()Yang Li1-2/+1
Making '==' operation with ESM_STATUS_CMD_UNSUCCESSFUL directly after calling the function inb() is more efficient, so assignment to 'cmd_status' is redundant. Eliminate the following clang_analyzer warning: drivers/platform/x86/dell/dcdbas.c:397:11: warning: Although the value stored to 'cmd_status' is used in the enclosing expression, the value is never actually read from 'cmd_status' No functional change. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/1620809825-84105-1-git-send-email-yang.lee@linux.alibaba.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-16platform/x86: intel_cht_int33fe: Correct "displayport" fwnode referenceHans de Goede1-2/+2
The Type-C connector on these devices is connected to DP-2 not DP-1, so the reference must be to the DD04 child-node of the GPU, rather then the DD02 child-node. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210503154647.142551-10-hdegoede@redhat.com
2021-06-16platform/x86: dell-wmi-sysman: Make populate_foo_data functions more robustPrasanth KSR6-8/+77
1. Check acpi type before assignment of each property value 2. Add boundary check for properties count Co-developed-by: Divya Bharathi <divya.bharathi@dell.com> Signed-off-by: Divya Bharathi <divya.bharathi@dell.com> Signed-off-by: Prasanth KSR <prasanth.ksr@dell.com> Link: https://lore.kernel.org/r/20210512102530.9704-1-prasanth.ksr@dell.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-14Merge tag 'v5.13-rc6' into driver-core-nextGreg Kroah-Hartman1-0/+1
We need the driver core fix in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>