- 04 Feb, 2021 18 commits
-
-
Barnabás Pőcze authored
Bit 9 in the return value of the HALS ACPI method is set if Fn-lock is supported. Change ideapad_check_features() to check it. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-20-pobrn@protonmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Store the supported features in the driver private data, and modify the is_visible() callback to use it, and create ideapad_check_features() to populate it. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-19-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Create dedicated helper functions for accessing the main ACPI methods: GBMD, SMBC, HALS, SALS; and utilize them. Use `unsigned long` consistently in every ACPI helper wherever possible. Change names to better express purpose. Do not assign values to output parameters in case of failure. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-18-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Group and rename constants depending on which ACPI interface they pertain to, and rename CFG_X constants to CFG_CAP_X. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-17-pobrn@protonmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Do not handle zero length buffer separately. Use kstrtouint() instead of sscanf(). Use kstrtobool() in store_ideapad_cam(). These introduce minor ABI changes, but it is expected that no users rely on the previous behavior. Thus the change is deemed justifed. Additionally, use `!!` to convert to `int` and use the "%d" format specifier in sysfs_emit() for boolean-like attributes. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-16-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Consumers can differentiate an error from a successful read much more easily if the read() call fails with an appropriate errno instead of returning a magic string like "-1". This introduces an ABI change, but not many users are expected to be relying on the previous behavior, and this change makes this module conforming to the standard behavior that sysfs attribute show/store callbacks return an appropriate errno in case of failure. Thus the ABI breakage is deemed justified. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-15-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
ACPI helpers returned -1 in case of failure. Convert these functions to return appropriate error codes, and convert their users to propagate these error codes accordingly. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-14-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Having the device name in the log message makes it easier to determine in the context of which device the message was printed, so utilize the appropriate variants of dev_{err,warn,...} when printing log messages. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-12-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
The current code used a hand-crafted formula to convert milliseconds to jiffies, replace it with the msecs_to_jiffies() function. Furthermore, use a while loop instead of for loop for shorter lines and simplicity. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-11-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
The current code used the combination of a for loop + test_bit, which can be simplified using for_each_set_bit(), so utilize that. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-10-pobrn@protonmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Use kobj_to_dev() instead of open-coding the container_of() macro. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-9-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Use device_{add,remove}_group instead of sysfs_{add,remove}_group. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-8-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
sysfs_emit() has been introduced to make it less ambiguous which function is preferred when writing to the output buffer in a device attribute's show() callback. Convert the ideapad-laptop module to utilize this new helper function. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-7-pobrn@protonmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
ideapad_dytc_profile_exit() is not called in ideapad_acpi_add() in the error path. Add the missing call. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-6-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Managing includes is easier when they are sorted, so sort them lexicographically. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-5-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
platform/x86: ideapad-laptop: use appropriately typed variable to store the return value of ACPI methods Use a variable with type `acpi_status` to store the return value of ACPI methods instead of a plain `int`. And use ACPI_{SUCCESS,FAILURE} macros where possible instead of direct comparison. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-4-pobrn@protonmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
The checks that are removed test pointers which should not be NULL. If they are NULL, that indicates a bug in a different part of the kernel. Instead of silently bailing out, let it fail loudly. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-3-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
The driver core already sets the driver specific data on bind failure or removal. Thus the call is unnecessary. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-2-pobrn@protonmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
- 03 Feb, 2021 7 commits
-
-
Artem Bityutskiy authored
Sapphire Rapids uncore frequency control is the same as Skylake and Ice Lake. Add the Sapphire Rapids CPU model number to the match array. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Reviewed-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/r/20210203114320.1398801-1-dedekind1@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Hans de Goede authored
Add touchscreen info for the Jumper EZpad 7 tablet. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210128113653.5442-1-hdegoede@redhat.com
-
David E. Box authored
All devices that expose Intel Platform Monitoring Technology (PMT) crashlog are currently owned by the intel_pmt MFD driver. Therefore make the crashlog driver depend on the MFD driver for build. Fixes: 5ef9998c ("platform/x86: Intel PMT Crashlog capability driver") Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: https://lore.kernel.org/r/20210126205508.30907-3-david.e.box@linux.intel.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
David E. Box authored
All devices that expose Intel Platform Monitoring Technology (PMT) telemetry are currently owned by the intel_pmt MFD driver. Therefore make the telemetry driver depend on the MFD driver for build. Fixes: 68fe8e6e ("platform/x86: Intel PMT Telemetry capability driver") Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: https://lore.kernel.org/r/20210126205508.30907-2-david.e.box@linux.intel.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
David E. Box authored
Fix error in Kconfig that exposed INTEL_PMT_CLASS as a user selectable option. It is already selected by INTEL_PMT_TELEMETRY and INTEL_PMT_CRASHLOG which are user selectable. Fixes: e2729113 ("platform/x86: Intel PMT class driver") Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: https://lore.kernel.org/r/20210126205508.30907-1-david.e.box@linux.intel.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Maximilian Luz authored
The braces of the unlikely() macro inside the if condition only cover the subtraction part, not the whole statement. This causes the result of the subtraction to be converted to zero or one. While that still works in this context, it causes static analysis tools to complain (and is just plain wrong). Fix the bracket placement and, while at it, simplify the if-condition. Also add a comment to the if-condition explaining what we expect the result to be and what happens on the failure path, as it seems to have caused a bit of confusion. This commit should not cause any difference in behavior or generated code. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: c167b9c7 ("platform/surface: Add Surface Aggregator subsystem") Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20210126172202.1428367-1-luzmaximilian@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Hans de Goede authored
ib-drm-gpio-pdx86-rtc-wdt for v5.12-1 First part of Intel MID outdated platforms removal. The following is an automated git shortlog grouped by driver: drm/gma500: - Get rid of duplicate NULL checks - Convert to use new SCU IPC API gpio: - msic: Remove driver for deprecated platform - intel-mid: Remove driver for deprecated platform intel_mid_powerbtn: - Remove driver for deprecated platform intel_mid_thermal: - Remove driver for deprecated platform intel_scu_wdt: - Get rid of custom x86 model comparison - Drop SCU notification - Move driver from arch/x86 rtc: - mrst: Remove driver for deprecated platform watchdog: - intel-mid_wdt: Postpone IRQ handler registration till SCU is ready - intel_scu_watchdog: Remove driver for deprecated platform
-
- 02 Feb, 2021 10 commits
-
-
Lubomir Rintel authored
Determined empirically. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Link: https://lore.kernel.org/r/20210126073740.10232-4-lkundrak@v3.skReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Lubomir Rintel authored
It is not needed. Use a local variable instead. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Link: https://lore.kernel.org/r/20210126073740.10232-3-lkundrak@v3.skReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Lubomir Rintel authored
Reset ec_priv if probe ends unsuccessfully. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Link: https://lore.kernel.org/r/20210126073740.10232-2-lkundrak@v3.skReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Pan Bian authored
Put the PCI device rdev on error paths to fix potential reference count leaks. Signed-off-by: Pan Bian <bianpan2016@163.com> Link: https://lore.kernel.org/r/20210121045005.73342-1-bianpan2016@163.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Jiaxun Yang authored
Add support to ideapad-laptop for Lenovo platforms that have DYTC version 5 support or newer to use the platform profile feature. Mostly based on Mark Pearson <markpearson@lenovo.com>'s thinkpad-acpi work but massaged to fit ideapad driver. Note that different from ThinkPads, IdeaPads's Thermal Hotkey won't trigger profile switch itself, we'll leave it for userspace programs. Tested on Lenovo Yoga-14S ARE Chinese Edition. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210105131447.38036-3-jiaxun.yang@flygoat.com [hdegoede@redhat.com s/QUIET/LOW_POWER/] Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Mark Pearson authored
Add support to thinkpad_acpi for Lenovo platforms that have DYTC version 5 support or newer to use the platform profile feature. This will allow users to determine and control the platform modes between low-power, balanced operation and performance modes. Signed-off-by: Mark Pearson <markpearson@lenovo.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210111162237.3469-1-markpearson@lenovo.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Hans de Goede authored
-
Nitin Joshi authored
The previous commit adding new sysfs for keyboard language has warning and few code correction has to be done as per new review comments. Below changes has been addressed in this version: - corrected warning. Many thanks to kernel test robot <lkp@intel.com> for reporting and determining this warning. - used sysfs_emit_at() API instead of strcat. - sorted keyboard language array. - removed unwanted space and corrected sentences. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Nitin Joshi <njoshi1@lenovo.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210202003210.91773-1-njoshi1@lenovo.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Lukas Bulwahn authored
Commit d7cbe277 ("platform/x86: thinkpad_acpi: set keyboard language") adds information on keyboard setting to the thinkpad documentation, but made the subsection title underline too short. Hence, make htmldocs warns: Documentation/admin-guide/laptops/thinkpad-acpi.rst:1472: \ WARNING: Title underline too short. Rectify length of subsection title underline. Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> Link: https://lore.kernel.org/r/20210129040849.26740-1-lukas.bulwahn@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Hans de Goede authored
All recent ThinkPad BIOS-es support the GSKL method used to query the keyboard-layout used by the ECFW for the SHIFT + other-key key-press emulation for special keys such as e.g. the '=', '(' and ')' keys above the numpad on 15" models. So just checking for the method is not a good indicator of the model supporting getting/setting the keyboard_lang. On models where this is not supported GSKL succeeds, but it returns METHOD_ERR in the returned integer to indicate that this is not supported on this model. Add a check for METHOD_ERR and return -ENODEV if it is set to avoid registering a non-working keyboard_lang sysfs-attr on models where this is not supported. Cc: Nitin Joshi <njoshi1@lenovo.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210125205258.135664-1-hdegoede@redhat.com
-
- 31 Jan, 2021 1 commit
-
-
Mario Limonciello authored
An upcoming Dell platform is causing a NULL pointer dereference in dell-wmi-sysman initialization. Validate that the input from BIOS matches correct ACPI types and abort module initialization if it fails. Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Tested-by: Perry Yuan <perry_yuan@dell.com> Link: https://lore.kernel.org/r/20210129172654.2326751-1-mario.limonciello@dell.com [hdegoede@redhat.com: Drop redundant release_attributes_data() call] Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
- 27 Jan, 2021 2 commits
-
-
Hans de Goede authored
After a rmmod thinkpad_acpi, lockdep pointed out this possible deadlock: Our _show and _store sysfs attr functions get called with the kn->active lock held for the sysfs attr and then take the profile_lock. sysfs_remove_group() also takes the kn->active lock for the sysfs attr, so if we call it with the profile_lock held, then we get an ABBA deadlock. platform_profile_remove() must only be called by drivers which have first *successfully* called platform_profile_register(). Anything else is a driver bug. So the check for cur_profile being set before calling sysfs_remove_group() is not necessary and it can be dropped. It is safe to call sysfs_remove_group() without holding the profile_lock since the attr-group group cannot be re-added until after we clear cur_profile. Change platform_profile_remove() to only hold the profile_lock while clearing the cur_profile, fixing the deadlock. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-
Jiaxun Yang authored
Add an object pointer to handler callbacks to avoid the need for drivers to have a global variable to get to their driver-data struct. Link: https://lore.kernel.org/linux-acpi/6a29f338-d9e4-150c-81dd-2ffb54f5bc35@redhat.com/ Link: https://lore.kernel.org/r/20210114073429.176462-3-jiaxun.yang@flygoat.comSigned-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Suggested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 25 Jan, 2021 2 commits
-
-
Nitin Joshi authored
This patch is to create sysfs entry for setting keyboard language using ASL method. Some thinkpads models like T580 , T590 , T15 Gen 1 etc. has "=", "(',")" numeric keys, which are not displaying correctly, when keyboard language is other than "english". This patch fixes this issue by setting keyboard language to ECFW. Signed-off-by: Nitin Joshi <njoshi1@lenovo.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210125025916.180831-1-nitjoshi@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Andy Shevchenko authored
Intel Moorestown and Medfield are quite old Intel Atom based 32-bit platforms, which were in limited use in some Android phones, tablets and consumer electronics more than eight years ago. There are no bugs or problems ever reported outside from Intel for breaking any of that platforms for years. It seems no real users exists who run a more or less fresh kernel on it. Commit 05f4434b ("ASoC: Intel: remove mfld_machine") which has been upstream for a while now confirms this theory. Due to above and to reduce a burden of supporting outdated drivers we remove the support of outdated platforms completely. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210122114145.38813-1-andriy.shevchenko@linux.intel.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-