- 28 Sep, 2021 1 commit
-
-
Hans de Goede authored
The amd_pmc_get_smu_version() and amd_pmc_idlemask_read() functions are used in the probe / suspend/resume code, so they are also used when CONFIG_DEBUGFS is disabled, move them outside of the #ifdef CONFIG_DEBUGFS block. Note this purely moves the code to above the #ifdef CONFIG_DEBUGFS, the code is completely unchanged. Fixes: f6045de1 ("platform/x86: amd-pmc: Export Idlemask values based on the APU") Cc: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Cc: Sanket Goswami <Sanket.Goswami@amd.com> Reported-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
- 21 Sep, 2021 5 commits
-
-
Troy Rollo authored
Adds support for: - Dell Inspiron 2in1 tablet mode switch notifications. These are delivered by a type 0x0011 message with code 0xe070, followed by a flag (1 for laptop mode, 0 for tablet mode). - Recognising (but not otherwise processing) the Dell Ultra Performance mode request switch. This is delivered by a type 0x0012 message with code 0x000d, followed by a parameter that is either 1 or 2. It is not clear what (if anything) should be done with this notification, so it is ignored. Signed-off-by: Troy Rollo <linux2021@troy.rollo.name> Link: https://lore.kernel.org/r/20210918073131.2966942-1-linux2021@troy.rollo.nameReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Tobias Jakobi authored
Tested with a AMD Ryzen 7 5800X. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Thomas Weißschuh <thomas@weissschuh.net> Link: https://lore.kernel.org/r/20210921100702.3838-1-tjakobi@math.uni-bielefeld.deSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
José Expósito authored
Some devices, even non convertible ones, can send incorrect SW_TABLET_MODE reports. Add an allow list and accept such reports only from devices in it. Bug reported for Dell XPS 17 9710 on: https://gitlab.freedesktop.org/libinput/libinput/-/issues/662Reported-by: Tobias Gurtzick <magic@wizardtales.com> Suggested-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Tobias Gurtzick <magic@wizardtales.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://lore.kernel.org/r/20210920160312.9787-1-jose.exposito89@gmail.com [hdegoede@redhat.com: Check dmi_switches_auto_add_allow_list only once] Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Randy Dunlap authored
When DELL_WMI=y, DELL_WMI_PRIVACY=y, and LEDS_TRIGGER_AUDIO=m, there is a linker error since the LEDS trigger code is built as a loadable module. This happens because DELL_WMI_PRIVACY is a bool that depends on a tristate (LEDS_TRIGGER_AUDIO=m), which can be dangerous. ld: drivers/platform/x86/dell/dell-wmi-privacy.o: in function `dell_privacy_wmi_probe': dell-wmi-privacy.c:(.text+0x3df): undefined reference to `ledtrig_audio_get' Fixes: 8af9fa37 ("platform/x86: dell-privacy: Add support for Dell hardware privacy") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Perry Yuan <Perry.Yuan@dell.com> Cc: Dell.Client.Kernel@dell.com Cc: platform-driver-x86@vger.kernel.org Cc: Hans de Goede <hdegoede@redhat.com> Cc: Mark Gross <mgross@linux.intel.com> Link: https://lore.kernel.org/r/20210918044829.19222-1-rdunlap@infradead.orgReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Krzysztof Kozlowski authored
The MODULE_DEVICE_TABLE already creates proper alias for ACPI driver. Having another MODULE_ALIAS causes the alias to be duplicated. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Link: https://lore.kernel.org/r/20210916170054.136790-1-krzysztof.kozlowski@canonical.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
- 16 Sep, 2021 3 commits
-
-
Sanket Goswami authored
IdleMask is the metric used by the PM firmware to know the status of each of the Hardware IP blocks monitored by the PM firmware. Knowing this value is key to get the information of s2idle suspend/resume status. This value is mapped to PMC scratch registers, retrieve them accordingly based on the CPU family and the underlying firmware support. Co-developed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20210916124002.2529-1-Sanket.Goswami@amd.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Sanket Goswami authored
As the PM firmware returns the status of the last s0i3 in the smu_metrics structure, the existing name "s0i3_cyclecount" seems to be a misnomer. Change it accordingly to "s0i3_last_entry_status". Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com> Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://lore.kernel.org/r/20210916124130.2581-1-Sanket.Goswami@amd.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
K Naduvalath, Sumesh authored
This driver is for accessing the PSE (Programmable Service Engine) - an Embedded Controller like IP - using ISHTP (Integratd Sensor Hub Transport Protocol) to get battery, thermal and UCSI (USB Type-C Connector System Software Interface) related data from the platform. Signed-off-by: K Naduvalath, Sumesh <sumesh.k.naduvalath@intel.com> Reviewed-by: Mark Gross <mgross@linux.intel.com> Link: https://lore.kernel.org/r/20210913051056.28736-1-sumesh.k.naduvalath@intel.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
- 14 Sep, 2021 31 commits
-
-
Jules Irenge authored
checkpatch.pl tool warns about using __attribute__((packed)) "WARNING: __packed is preferred over __attribute__((packed))" To fix this __attribute__((packed)) is replaced by __packed Signed-off-by: Jules Irenge <jbi.octave@gmail.com> Link: https://lore.kernel.org/r/20210912011741.30495-1-jbi.octave@gmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Make `find_guid()` return an acpi_status, and make it handle NULL pointer GUID strings; and adapt users accordingly. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-31-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Previously, `acpi_wmi_notify_handler()` and `wmi_get_event_data()` shared more or less the exact same code to query the data for a particular event. Introduce a function to get rid of the duplication, and use it from `acpi_wmi_notify_handler()` and `wmi_get_event_data()`. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-30-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Introduce helper function to determine the appropriate ACPI type for the input parameter. This also fixes the following checkpatch warning: "braces {} are not necessary for any arm of this statement". Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-29-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Instead of "manually" constructing the ACPI method name and hard-coding sizes in WMI functions, introduce a helper method which generates the method name for an arbitrary WMI block. Furthermore, save the appropriate buffer size into a macro. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-28-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Introduce a helper function which wraps the appropriate `container_of()` macro invocation to convert a `struct device_driver` to `struct wmi_driver`. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-27-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 carries out the following ACPI status mapping: AE_NOT_FOUND -> AE_OK AE_OK -> AE_OK AE_$X -> AE_$X That is, everything is mapped to itself, except AE_NOT_FOUND. The current code does not do it in the most straighforward way. Simplify the logic. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-26-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Previously, `__query_block()` would fail if the second WCxx method call failed. However, the WQxx method might have succeeded, and potentially allocated memory for the result. Instead of throwing away the result and potentially leaking memory, ignore the result of the second WCxx call. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-25-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Print the event identifier number in addition to the already printed information, and use %u for printing unsigned values in `wmi_notify_debug()`. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-24-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Align the arguments of * wmi_evaluate_method() * wmi_install_notify_handler() * wmidev_evaluate_method() * find_guid_context() * acpi_wmi_ec_space_handler() * wmi_char_read() Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-23-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Move some variables in order to keep them in the narrowest possible scope. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-22-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 `block` variable is assigned and only used once, the code shorter and probably clearer without it; so remove it. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-21-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
As per the coding style guide, the preferred way to pass the size of objects to allocator functions is `sizeof(*p)`. Use that. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-20-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Other parts of the code use the `!p` idiom to check for NULL pointers, convert `find_guid_context()` to do the same. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-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
Instead of `sprintf()` use the new `sysfs_emit()` function. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-17-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 `guid_block` struct is overlaid onto a buffer coming from the _WDG ACPI object of the device. For this reason mark the struct packed and add assertions about sizes. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-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
Instead of hard-coding a 16 long byte array, use the available `guid_t` type and related methods. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-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
The `bool` type is more expressive for a yes/no kind of value, so use that as the type of the `enable` parameter of `wmi_method_enable()`. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-13-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Instead of manually creating the bit masks, use the `BIT()` macro to do it. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-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 `find_guid_context()` is only called from one place, and `wblock` and `wdriver` cannot be NULL there. So remove the currently redundant checks. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-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
Remove an empty line after the last statement in `acpi_wmi_notify_handler()` which serves no purpose. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-10-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Void pointers are implictly cast to arbitrary pointer types, so remove superfluous casts. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-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
The GUID block is available for `wmi_create_device()` through `wblock->gblock`. Use that consistently in the function instead of using a mix of `gblock` and `wblock->gblock`. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-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
The `status` variable was assigned at the end, and then immediately returned. Remove it altogether, and return the previously assigned value directly. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-7-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Some pointers are initialized when they are defined, but they are almost immediately reassigned in the following lines. Remove these superfluous assignments. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-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
The empty initializer `{ }` is enough to properly initialize the terminating acpi_device_id entry in the device table, so use that. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-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
Remove commas that are after terminating entries in arrays. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-4-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Barnabás Pőcze authored
Fix the following two checkpatch warnings: * "space required before the open parenthesis '('" * "that open brace { should be on the previous line" Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-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 kernel doc erroneously specified `wmi_uninstall_notify_handler()` for the `wmi_remove_notify_handler()` function. Fix that. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-2-pobrn@protonmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Daniel Dadap authored
A number of upcoming notebook computer designs drive the internal display panel's backlight PWM through the Embedded Controller (EC). This EC-based backlight control can be plumbed through to an ACPI "WMAA" method interface, which in turn can be wrapped by WMI with the GUID handle 603E9613-EF25-4338-A3D0-C46177516DB7. Add a new driver, aliased to the WMAA WMI GUID, to expose a sysfs backlight class driver to control backlight levels on systems with EC-driven backlights. Signed-off-by: Daniel Dadap <ddadap@nvidia.com> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20210903003838.15797-1-ddadap@nvidia.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Enver Balalic authored
This patch adds support for HP Omen laptops. It adds support for most things that can be controlled via the Windows Omen Command Center application. - Fan speed monitoring through hwmon - Platform Profile support (cool, balanced, performance) - Max fan speed function toggle Also exposes the existing HDD temperature through hwmon since this driver didn't use hwmon before this patch. This patch has been tested on a 2020 HP Omen 15 (AMD) 15-en0023dx. - V1 Initial Patch - V2 Use standard hwmon ABI attributes Add existing non-standard "hddtemp" to hwmon - V3 Fix overflow issue in "hp_wmi_get_fan_speed" Map max fan speed value back to hwmon values on read Code style fixes Fix issue with returning values from "hp_wmi_hwmon_read", the value to return should be written to val and not just returned from the function - V4 Use DMI Board names to detect if a device should use the omen specific thermal profile method. Select HWMON instead of depending on it. Code style fixes. Replace some error codes with more specific/meaningful ones. Remove the HDD temperature from HWMON since we don't know what unit it's expressed in. Handle error from hp_wmi_hwmon_init - V5 Handle possible NULL from dmi_get_system_info() Use match_string function instead of manually checking Directly use is_omen_thermal_profile() without the static variable. Signed-off-by: Enver Balalic <balalic.enver@gmail.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210902182234.vtwl72n5rjql22qa@omen.localdomainReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-