- 16 Jun, 2021 40 commits
-
-
Rikard Falkeborn authored
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.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Rikard Falkeborn authored
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.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Rikard Falkeborn authored
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.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Baokun Li authored
platform/surface: aggregator: Use list_move_tail instead of list_del/list_add_tail in ssh_packet_layer.c Using list_move_tail() instead of list_del() + list_add_tail() in ssh_packet_layer.c. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Baokun Li <libaokun1@huawei.com> Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20210609072448.1357524-1-libaokun1@huawei.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Baokun Li authored
platform/surface: aggregator: Use list_move_tail instead of list_del/list_add_tail in ssh_request_layer.c Using list_move_tail() instead of list_del() + list_add_tail() in ssh_request_layer.c. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Baokun Li <libaokun1@huawei.com> Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20210609072638.1358174-1-libaokun1@huawei.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Maximilian Luz authored
The status variable in ssam_controller_event_disable() is always set, no need to initialize it. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20210604210907.25738-3-luzmaximilian@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Maximilian Luz authored
The status variable in ssam_nf_refcount_disable_free() is only set when the reference count equals zero. Otherwise, it is returned uninitialized. Fix this by always initializing status to zero. Reported-by: kernel test robot <lkp@intel.com> Fixes: 640ee17199e4 ("platform/surface: aggregator: Allow enabling of events without notifiers") Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20210604210907.25738-2-luzmaximilian@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Maximilian Luz authored
Update the controller-device user-space interface (cdev) documentation for the newly introduced IOCTLs and event interface. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210604134755.535590-8-luzmaximilian@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Maximilian Luz authored
Mark functions with locking requirements via the corresponding lockdep calls for debugging and documentary purposes. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210604134755.535590-7-luzmaximilian@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Maximilian Luz authored
While events can already be enabled and disabled via the generic request IOCTL, this bypasses the internal reference counting mechanism of the controller. Due to that, disabling an event will turn it off regardless of any other client having requested said event, which may break functionality of that client. To solve this, add IOCTLs wrapping the ssam_controller_event_enable() and ssam_controller_event_disable() functions, which have been previously introduced for this specific purpose. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210604134755.535590-6-luzmaximilian@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Maximilian Luz authored
Currently, debugging unknown events requires writing a custom driver. This is somewhat difficult, slow to adapt, and not entirely user-friendly for quickly trying to figure out things on devices of some third-party user. We can do better. We already have a user-space interface intended for debugging SAM EC requests, so let's add support for receiving events to that. This commit provides support for receiving events by reading from the controller file. It additionally introduces two new IOCTLs to control which event categories will be forwarded. Specifically, a user-space client can specify which target categories it wants to receive events from by registering the corresponding notifier(s) via the IOCTLs and after that, read the received events by reading from the controller device. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210604134755.535590-5-luzmaximilian@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Maximilian Luz authored
It's 2021, update the copyright accordingly. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210604134755.535590-4-luzmaximilian@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Maximilian Luz authored
We can already enable and disable SAM events via one of two ways: either via a (non-observer) notifier tied to a specific event group, or a generic event enable/disable request. In some instances, however, neither method may be desirable. The first method will tie the event enable request to a specific notifier, however, when we want to receive notifications for multiple event groups of the same target category and forward this to the same notifier callback, we may receive duplicate events, i.e. one event per registered notifier. The second method will bypass the internal reference counting mechanism, meaning that a disable request will disable the event regardless of any other client driver using it, which may break the functionality of that driver. To address this problem, add new functions that allow enabling and disabling of events via the event reference counting mechanism built into the controller, without needing to register a notifier. This can then be used in combination with observer notifiers to process multiple events of the same target category without duplication in the same callback function. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20210604134755.535590-3-luzmaximilian@gmail.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Maximilian Luz authored
Currently, each SSAM event notifier is directly tied to one group of events. This makes sense as registering a notifier will automatically take care of enabling the corresponding event group and normally drivers only need notifications for a very limited number of events, associated with different callbacks for each group. However, there are rare cases, especially for debugging, when we want to get notifications for a whole event target category instead of just a single group of events in that category. Registering multiple notifiers, i.e. one per group, may be infeasible due to two issues: a) we might not know every event enable/disable specification as some events are auto-enabled by the EC and b) forwarding this to the same callback will lead to duplicate events as we might not know the full event specification to perform the appropriate filtering. This commit introduces observer-notifiers, which are notifiers that are not tied to a specific event group and do not attempt to manage any events. In other words, they can be registered without enabling any event group or incrementing the corresponding reference count and just act as silent observers, listening to all currently/previously enabled events based on their match-specification. Essentially, this allows us to register one single notifier for a full event target category, meaning that we can process all events of that target category in a single callback without duplication. Specifically, this will be used in the cdev debug interface to forward events to user-space via a device file from which the events can be read. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210604134755.535590-2-luzmaximilian@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Mykola Kostenok authored
It causes mlxreg-hotplug probing failure: request_threaded_irq() returns -EINVAL due to true value of condition: ((irqflags & IRQF_SHARED) && (irqflags & IRQF_NO_AUTOEN)) after flag "IRQF_NO_AUTOEN" has been added to: err = devm_request_irq(&pdev->dev, priv->irq, mlxreg_hotplug_irq_handler, IRQF_TRIGGER_FALLING | IRQF_SHARED | IRQF_NO_AUTOEN, "mlxreg-hotplug", priv); This reverts commit bee3ecfe ("platform/mellanox: mlxreg-hotplug: move to use request_irq by IRQF_NO_AUTOEN flag"). Signed-off-by: Mykola Kostenok <c_mykolak@nvidia.com> Acked-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20210603172827.2599908-1-c_mykolak@nvidia.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Maximilian Luz authored
When we fail to open the device file due to DTX being shut down, the mutex is initialized but never destroyed. We are destroying it when releasing the file, so add the missing call in the failure path as well. Fixes: 1d609992 ("platform/surface: Add DTX driver") Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20210604132540.533036-1-luzmaximilian@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
kernel test robot authored
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@7832cb195c0bSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Hans de Goede authored
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
-
Mark Pearson authored
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.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Mark Pearson authored
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.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Mark Pearson authored
platform/x86: firmware_attributes_class: Create helper file for handling 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.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-
Maximilian Luz authored
Disabling events silently fails due to the wrong command ID being used. Instead of the command ID for the disable call, the command ID for the enable call was being used. This causes the disable call to enable the event instead. As the event is already enabled when we call this function, the EC silently drops this command and does nothing. Use the correct command ID for disabling the event to fix this. Fixes: c167b9c7 ("platform/surface: Add Surface Aggregator subsystem") Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20210603000636.568846-1-luzmaximilian@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Jiapeng Chong authored
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.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Hans de Goede authored
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
-
Perry Yuan authored
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>
-
Hans de Goede authored
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>
-
Til Jasper Ullrich authored
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.meSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Jiapeng Chong authored
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.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Hans de Goede authored
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/216Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210523172331.177834-1-hdegoede@redhat.com
-
Maximilian Luz authored
5th- and 6th-generation Surface devices have all SAM clients defined in ACPI, except for the platform profile/performance mode which his handled via the WSID (Windows Surface Integration Device). Thus, the node groups for those devices are the same and we can just use a single one instead of re-defining the same one over and over again. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20210523134528.798887-4-luzmaximilian@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Maximilian Luz authored
Add support for the 13" Intel version of the Surface Laptop 4. Use the existing node group for the Surface Laptop 3 since the 15" AMD version already shares its WSID HID with its predecessor and there don't seem to be any significant differences with regards to SAM. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20210523134528.798887-3-luzmaximilian@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Maximilian Luz authored
The 15" AMD version of the Surface Laptop 4 shares its WSID HID with the 15" AMD version of the Surface Laptop 3. Update the comments accordingly. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20210523134528.798887-2-luzmaximilian@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Luke D. Jones authored
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 13bceda6 ("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.devSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Luke D. Jones authored
This is a preparation revert for reverting the "add support for ASUS ROG Zephyrus G14 and G15" change. This reverts commit 67186653 ("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.devSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Mario Limonciello authored
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.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Hans de Goede authored
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/799193Reported-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
-
Wolfram Sang authored
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.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Wolfram Sang authored
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.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Rajneesh Bhardwaj authored
- My linux.intel.com email is no longer valid, update it to my gmail id. Signed-off-by: Rajneesh Bhardwaj <irenic.rajneesh@gmail.com> Link: https://lore.kernel.org/r/20210513153825.77214-1-irenic.rajneesh@gmail.comSigned-off-by: Hans de Goede <hdegoede@redhat.com>
-
Yang Li authored
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.comReviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-