Wolfram Sang
f11c35e181
platform/chrome: cros_ec_sensorhub: simplify getting .driver_data
...
We should get 'driver_data' from 'struct device' directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com >
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com >
Link: https://lore.kernel.org/r/20210920090522.23784-9-wsa+renesas@sang-engineering.com
2021-09-27 09:18:58 +02:00
Prashant Malani
73eff8602a
platform/chrome: cros-ec-typec: Cleanup use of check_features
...
cros_ec_check_features() now returns a boolean. Remove the double NOT
operator since it's not required anymore.
No functional changes are expected with this patch.
Signed-off-by: Prashant Malani <pmalani@chromium.org >
Reviewed-by: Guenter Roeck <groeck@chromium.org >
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com >
Link: https://lore.kernel.org/r/20210923200321.3623222-1-pmalani@chromium.org
2021-09-24 08:47:36 +02:00
Prashant Malani
d50497c4a0
platform/chrome: cros_ec_proto: Fix check_features ret val
...
The kerneldoc for cros_ec_check_features() states that it returns 1 or 0
depedending on whether a feature is supported or not, but it instead
returns a negative error number in one case, and a non-1 bitmask in
other cases.
Since all call-sites only check for a 1 or 0 return value, update
the function to return boolean values.
Signed-off-by: Prashant Malani <pmalani@chromium.org >
Reviewed-by: Guenter Roeck <groeck@chromium.org >
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com >
Link: https://lore.kernel.org/r/20210916014632.2662612-1-pmalani@chromium.org
2021-09-23 17:41:30 +02:00
Tobias Jakobi
6f6aab1caf
platform/x86: gigabyte-wmi: add support for B550I Aorus Pro AX
...
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.de
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-21 15:49:23 +02:00
José Expósito
b201cb0ebe
platform/x86/intel: hid: Add DMI switches allow list
...
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/662
Reported-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>
2021-09-21 15:49:16 +02:00
Randy Dunlap
5b72dafaca
platform/x86: dell: fix DELL_WMI_PRIVACY dependencies & build error
...
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: 8af9fa37b8 ("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.org
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-21 15:49:09 +02:00
Troy Rollo
5fbd827eb9
platform/x86: dell-wmi: Recognise or support new switches
...
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.name
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-21 15:21:06 +02:00
Tobias Jakobi
6ffd963938
platform/x86: gigabyte-wmi: add support for B550I Aorus Pro AX
...
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.de
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-21 15:15:35 +02:00
José Expósito
cf5585f921
platform/x86/intel: hid: Add DMI switches allow list
...
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/662
Reported-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>
2021-09-21 15:05:08 +02:00
Randy Dunlap
d24236cb7c
platform/x86: dell: fix DELL_WMI_PRIVACY dependencies & build error
...
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: 8af9fa37b8 ("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.org
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-21 14:52:09 +02:00
Krzysztof Kozlowski
8f84a3973c
platform: lg-laptop: drop unneeded MODULE_ALIAS
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-21 14:50:35 +02:00
Sanket Goswami
f6045de1f5
platform/x86: amd-pmc: Export Idlemask values based on the APU
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-16 15:29:13 +02:00
Sanket Goswami
9cfe02023c
platform/x86: amd-pmc: Check s0i3 cycle status
...
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.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-16 15:26:36 +02:00
K Naduvalath, Sumesh
7b6bf51de9
platform/x86: Add Intel ishtp eclite driver
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-16 15:25:44 +02:00
Jules Irenge
1f88e0a22f
platform/x86: acer-wmi: use __packed instead of __attribute__((packed))
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:27:15 +02:00
Barnabás Pőcze
b0179b805e
platform/x86: wmi: more detailed error reporting in find_guid()
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:03 +02:00
Barnabás Pőcze
25be44f6e2
platform/x86: wmi: introduce helper to retrieve event data
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:03 +02:00
Barnabás Pőcze
51142a0886
platform/x86: wmi: introduce helper to determine type
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:02 +02:00
Barnabás Pőcze
57f2ce8921
platform/x86: wmi: introduce helper to generate method names
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:02 +02:00
Barnabás Pőcze
e7b2e33449
platform/x86: wmi: introduce helper to convert driver to WMI driver
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:02 +02:00
Barnabás Pőcze
736b48aae5
platform/x86: wmi: simplify error handling logic
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:02 +02:00
Barnabás Pőcze
1975718c48
platform/x86: wmi: do not fail if disabling fails
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:02 +02:00
Barnabás Pőcze
1c23ab9128
platform/x86: wmi: improve debug messages
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:02 +02:00
Barnabás Pőcze
bba08f358f
platform/x86: wmi: align arguments of functions
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:02 +02:00
Barnabás Pőcze
f5431bf1e6
platform/x86: wmi: move variables
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:02 +02:00
Barnabás Pőcze
1ce69d2b96
platform/x86: wmi: remove variable
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:02 +02:00
Barnabás Pőcze
7410b8e634
platform/x86: wmi: use sizeof(*p) in allocation
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:02 +02:00
Barnabás Pőcze
6e0bc588a0
platform/x86: wmi: use !p to check for NULL
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:01 +02:00
Barnabás Pőcze
6133913a82
platform/x86: wmi: use sysfs_emit()
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:01 +02:00
Barnabás Pőcze
dea878d88f
platform/x86: wmi: make GUID block packed
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:01 +02:00
Barnabás Pőcze
67f472fdac
platform/x86: wmi: use guid_t and guid_equal()
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:01 +02:00
Barnabás Pőcze
285dd01a6c
platform/x86: wmi: use bool instead of int
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:01 +02:00
Barnabás Pőcze
1c95ace78b
platform/x86: wmi: use BIT() macro
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:01 +02:00
Barnabás Pőcze
1ebe62bec4
platform/x86: wmi: remove unnecessary checks
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:01 +02:00
Barnabás Pőcze
e83c799270
platform/x86: wmi: remove stray empty line
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:01 +02:00
Barnabás Pőcze
c06a2fde79
platform/x86: wmi: remove unnecessary casts
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:01 +02:00
Mario Limonciello
3c3c8e88c8
platform/x86: amd-pmc: Increase the response register timeout
...
There have been reports of approximately a 0.9%-1.7% failure rate in SMU
communication timeouts with s0i3 entry on some OEM designs. Currently
the design in amd-pmc is to try every 100us for up to 20ms.
However the GPU driver which also communicates with the SMU using a
mailbox register which the driver polls every 1us for up to 2000ms.
In the GPU driver this was increased by commit 055162645a ("drm/amd/pm:
increase time out value when sending msg to SMU")
Increase the maximum timeout used by amd-pmc to 2000ms to match this
behavior. This has been shown to improve the stability for machines
that randomly have failures.
Cc: stable@kernel.org
Reported-by: Julian Sikorski <belegdol@gmail.com >
BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1629
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com >
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com >
Link: https://lore.kernel.org/r/20210914020115.655-1-mario.limonciello@amd.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:00 +02:00
Barnabás Pőcze
84eacf7e64
platform/x86: wmi: remove unnecessary argument
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:00 +02:00
Barnabás Pőcze
21397cac5d
platform/x86: wmi: remove unnecessary variable
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:00 +02:00
Barnabás Pőcze
43aacf838e
platform/x86: wmi: remove unnecessary initializations
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:00 +02:00
Barnabás Pőcze
9bf9ca95a1
platform/x86: wmi: remove unnecessary initialization
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:00 +02:00
Barnabás Pőcze
cd3e3d294e
platform/x86: wmi: remove commas
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:00 +02:00
Barnabás Pőcze
3ecace310f
platform/x86: wmi: fix checkpatch warnings
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:00 +02:00
Barnabás Pőcze
07ce4cfd29
platform/x86: wmi: fix kernel doc
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:00 +02:00
Daniel Dadap
ad62cd9319
platform/x86: Add driver for ACPI WMAA EC-based backlight control
...
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.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:00 +02:00
Enver Balalic
4c51ba9af4
platform/x86: hp-wmi: add support for omen laptops
...
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.localdomain
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-14 12:26:00 +02:00
Hans de Goede
196159d278
platform/x86: touchscreen_dmi: Update info for the Chuwi Hi10 Plus (CWI527) tablet
...
Add info for getting the firmware directly from the UEFI for the Chuwi Hi10
Plus (CWI527), so that the user does not need to manually install the
firmware in /lib/firmware/silead.
This change will make the touchscreen on these devices work OOTB,
without requiring any manual setup.
Also tweak the min and width/height values a bit for more accurate position
reporting.
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
Link: https://lore.kernel.org/r/20210905130210.32810-2-hdegoede@redhat.com
2021-09-13 10:41:56 +02:00
Hans de Goede
3bf1669b0e
platform/x86: touchscreen_dmi: Add info for the Chuwi HiBook (CWI514) tablet
...
Add touchscreen info for the Chuwi HiBook (CWI514) tablet. This includes
info for getting the firmware directly from the UEFI, so that the user does
not need to manually install the firmware in /lib/firmware/silead.
This change will make the touchscreen on these devices work OOTB,
without requiring any manual setup.
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
Link: https://lore.kernel.org/r/20210905130210.32810-1-hdegoede@redhat.com
2021-09-13 10:41:56 +02:00
Matan Ziv-Av
4c4a3d7cff
lg-laptop: Correctly handle dmi_get_system_info() returning NULL
...
The laptop model is identified by parsing the product name. If no
product name is available, do not try to parse it.
Default model is 2017.
Signed-off-by: Matan Ziv-Av <matan@svgalib.org >
Link: https://lore.kernel.org/r/93ff3bb-503b-f73-bf18-87bae1699ed@svgalib.org
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-13 10:38:52 +02:00
Andy Shevchenko
349bff48ae
platform/x86/intel: punit_ipc: Drop wrong use of ACPI_PTR()
...
ACPI_PTR() is more harmful than helpful. For example, in this case
if CONFIG_ACPI=n, the ID table left unused which is not what we want.
Instead of adding ifdeffery here and there, drop ACPI_PTR()
and unused acpi.h.
Fixes: fdca4f16f5 ("platform:x86: add Intel P-Unit mailbox IPC driver")
Reported-by: kernel test robot <lkp@intel.com >
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20210827145310.76239-1-andriy.shevchenko@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2021-09-13 10:36:52 +02:00