diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-03-14 20:44:09 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-03-14 20:44:09 +0300 |
commit | 66fd6d0bd7572fcb7859ebd4dbfb133881e1cd66 (patch) | |
tree | 53e7a8837794e12512a2b5f23783eef54af3ea3c /drivers/platform/x86/asus-wmi.c | |
parent | f5c31bcf604db54470868f3118a60dc4a9ba8813 (diff) | |
parent | 16f8091b49175f327120cdbbdde135d38a853ae1 (diff) | |
download | linux-66fd6d0bd7572fcb7859ebd4dbfb133881e1cd66.tar.xz |
Merge tag 'platform-drivers-x86-v6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver updates from Ilpo Järvinen:
- New acer-wmi HW support
- Support for new revision of amd/pmf heartbeat notify
- Correctly handle asus-wmi HW without LEDs
- fujitsu-laptop battery charge control support
- Support for new hp-wmi thermal profiles
- Support ideapad-laptop refresh rate key
- Put intel/pmc AI accelerator (GNA) into D3 if it has no driver to
allow entry into low-power modes, and temporarily removed Lunar Lake
SSRAM support due to breaking FW changes causing probe fail (further
breaking FW changes are still pending)
- Report pmc/punit_atom devices that prevent reacing low power levels
- Surface Fan speed function support
- Support for more sperial keys and complete the list of models with
non-standard fan registers in thinkpad_acpi
- New DMI touchscreen HW support
- Continued modernization efforts of wmi
- Removal of obsoleted ledtrig-audio call and the related dependency
- Debug & metrics interface improvements
- Miscellaneous cleanups / fixes / improvements
* tag 'platform-drivers-x86-v6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (87 commits)
platform/x86/intel/pmc: Improve PKGC residency counters debug
platform/x86: asus-wmi: Consider device is absent when the read is ~0
Documentation/x86/amd/hsmp: Updating urls
platform/mellanox: mlxreg-hotplug: Remove redundant NULL-check
platform/x86/amd/pmf: Update sps power thermals according to the platform-profiles
platform/x86/amd/pmf: Add support to get sps default APTS index values
platform/x86/amd/pmf: Add support to get APTS index numbers for static slider
platform/x86/amd/pmf: Add support to notify sbios heart beat event
platform/x86/amd/pmf: Add support to get sbios requests in PMF driver
platform/x86/amd/pmf: Disable debugfs support for querying power thermals
platform/x86/amd/pmf: Differentiate PMF ACPI versions
x86/platform/atom: Check state of Punit managed devices on s2idle
platform/x86: pmc_atom: Check state of PMC clocks on s2idle
platform/x86: pmc_atom: Check state of PMC managed devices on s2idle
platform/x86: pmc_atom: Annotate d3_sts register bit defines
clk: x86: Move clk-pmc-atom register defines to include/linux/platform_data/x86/pmc_atom.h
platform/x86: make fw_attr_class constant
platform/x86/intel/tpmi: Change vsec offset to u64
platform/x86: intel_scu_pcidrv: Remove unused intel-mid.h
platform/x86: intel_scu_wdt: Remove unused intel-mid.h
...
Diffstat (limited to 'drivers/platform/x86/asus-wmi.c')
-rw-r--r-- | drivers/platform/x86/asus-wmi.c | 84 |
1 files changed, 16 insertions, 68 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 18be35fdb381..3f07bbf809ef 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -101,13 +101,6 @@ module_param(fnlock_default, bool, 0444); #define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31 #define ASUS_ACPI_UID_ASUSWMI "ASUSWMI" -#define ASUS_ACPI_UID_ATK "ATK" - -#define WMI_EVENT_QUEUE_SIZE 0x10 -#define WMI_EVENT_QUEUE_END 0x1 -#define WMI_EVENT_MASK 0xFFFF -/* The WMI hotkey event value is always the same. */ -#define WMI_EVENT_VALUE_ATK 0xFF #define WMI_EVENT_MASK 0xFFFF @@ -219,7 +212,6 @@ struct asus_wmi { int dsts_id; int spec; int sfun; - bool wmi_event_queue; struct input_dev *inputdev; struct backlight_device *backlight_device; @@ -489,7 +481,17 @@ static int asus_wmi_evaluate_method_agfn(const struct acpi_buffer args) static int asus_wmi_get_devstate(struct asus_wmi *asus, u32 dev_id, u32 *retval) { - return asus_wmi_evaluate_method(asus->dsts_id, dev_id, 0, retval); + int err; + + err = asus_wmi_evaluate_method(asus->dsts_id, dev_id, 0, retval); + + if (err) + return err; + + if (*retval == ~0) + return -ENODEV; + + return 0; } static int asus_wmi_set_devstate(u32 dev_id, u32 ctrl_param, @@ -1620,7 +1622,6 @@ static int asus_wmi_led_init(struct asus_wmi *asus) if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MICMUTE_LED)) { asus->micmute_led.name = "platform::micmute"; asus->micmute_led.max_brightness = 1; - asus->micmute_led.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE); asus->micmute_led.brightness_set_blocking = micmute_led_set; asus->micmute_led.default_trigger = "audio-micmute"; @@ -4020,50 +4021,14 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus) static void asus_wmi_notify(u32 value, void *context) { struct asus_wmi *asus = context; - int code; - int i; - - for (i = 0; i < WMI_EVENT_QUEUE_SIZE + 1; i++) { - code = asus_wmi_get_event_code(value); - if (code < 0) { - pr_warn("Failed to get notify code: %d\n", code); - return; - } - - if (code == WMI_EVENT_QUEUE_END || code == WMI_EVENT_MASK) - return; + int code = asus_wmi_get_event_code(value); - asus_wmi_handle_event_code(code, asus); - - /* - * Double check that queue is present: - * ATK (with queue) uses 0xff, ASUSWMI (without) 0xd2. - */ - if (!asus->wmi_event_queue || value != WMI_EVENT_VALUE_ATK) - return; - } - - pr_warn("Failed to process event queue, last code: 0x%x\n", code); -} - -static int asus_wmi_notify_queue_flush(struct asus_wmi *asus) -{ - int code; - int i; - - for (i = 0; i < WMI_EVENT_QUEUE_SIZE + 1; i++) { - code = asus_wmi_get_event_code(WMI_EVENT_VALUE_ATK); - if (code < 0) { - pr_warn("Failed to get event during flush: %d\n", code); - return code; - } - - if (code == WMI_EVENT_QUEUE_END || code == WMI_EVENT_MASK) - return 0; + if (code < 0) { + pr_warn("Failed to get notify code: %d\n", code); + return; } - pr_warn("Failed to flush event queue\n"); - return -EIO; + asus_wmi_handle_event_code(code, asus); } /* Sysfs **********************************************************************/ @@ -4303,23 +4268,6 @@ static int asus_wmi_platform_init(struct asus_wmi *asus) asus->dsts_id = ASUS_WMI_METHODID_DSTS; } - /* - * Some devices can have multiple event codes stored in a queue before - * the module load if it was unloaded intermittently after calling - * the INIT method (enables event handling). The WMI notify handler is - * expected to retrieve all event codes until a retrieved code equals - * queue end marker (One or Ones). Old codes are flushed from the queue - * upon module load. Not enabling this when it should be has minimal - * visible impact so fall back if anything goes wrong. - */ - wmi_uid = wmi_get_acpi_device_uid(asus->driver->event_guid); - if (wmi_uid && !strcmp(wmi_uid, ASUS_ACPI_UID_ATK)) { - dev_info(dev, "Detected ATK, enable event queue\n"); - - if (!asus_wmi_notify_queue_flush(asus)) - asus->wmi_event_queue = true; - } - /* CWAP allow to define the behavior of the Fn+F2 key, * this method doesn't seems to be present on Eee PCs */ if (asus->driver->quirks->wapf >= 0) |