summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/dell-wmi.c
Commit message (Collapse)AuthorAgeFilesLines
* platform/x86: Fix dell driver init orderDarren Hart (VMware)2018-03-141-1/+1
| | | | | | | | | | | | | | | | | | | Update the initcall ordering to satisfy the following dependency ordering: 1. DCDBAS, ACPI_WMI 2. DELL_SMBIOS, DELL_RBTN 3. DELL_LAPTOP, DELL_WMI By assigning them to the following initcall levels: subsys_initcall: DCDBAS, ACPI_WMI module_init: DELL_SMBIOS, DELL_RBTN late_initcall: DELL_LAPTOP, DELL_WMI Cc: Dominik Brodowski <linux@dominikbrodowski.net> Cc: Mario.Limonciello@dell.com Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-wmi: Add an event created by Dell Latitude 5495Shih-Yuan Lee (FourDollars)2017-12-211-0/+3
| | | | | | | | The Dell Latitude 5495 has the mic mute key. Signed-off-by: Shih-Yuan Lee (FourDollars) <sylee@canonical.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* platform/x86: dell-wmi: check for kmalloc() errorsDan Carpenter2017-12-111-0/+2
| | | | | | | | | | This allocation won't fail in the current kernel because it's small but not checking for kmalloc() failures introduces static checker warnings so let's fix it. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Mario Limonciello <mario.limonciello@dell.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-*wmi*: Relay failed initial probe to dependent driversMario Limonciello2017-11-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | dell-wmi and dell-smbios-wmi are dependent upon dell-wmi-descriptor finishing probe successfully to probe themselves. Currently if dell-wmi-descriptor fails probing in a non-recoverable way (such as invalid header) dell-wmi and dell-smbios-wmi will continue to try to redo probing due to deferred probing. To solve this have the dependent drivers query the dell-wmi-descriptor driver whether the descriptor has been determined valid. The possible results are: -ENODEV: Descriptor GUID missing from WMI bus -EPROBE_DEFER: Descriptor not yet probed, dependent driver should wait and use deferred probing < 0: Descriptor probed, invalid. Dependent driver should return an error. 0: Successful descriptor probe, dependent driver can continue Successful descriptor probe still doesn't mean that the descriptor driver is necessarily bound at the time of initialization of dependent driver. Userspace can unbind the driver, so all methods used from driver should still be verified to return success values otherwise deferred probing be used. Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-smbios: Introduce dispatcher for SMM callsMario Limonciello2017-11-031-4/+7
| | | | | | | | | | | | | | | | | | | | | | | This splits up the dell-smbios driver into two drivers: * dell-smbios * dell-smbios-smm dell-smbios can operate with multiple different dispatcher drivers to perform SMBIOS operations. Also modify the interface that dell-laptop and dell-wmi use align to this model more closely. Rather than a single global buffer being allocated for all drivers, each driver will allocate and be responsible for it's own buffer. The pointer will be passed to the calling function and each dispatcher driver will then internally copy it to the proper location to perform it's call. Add defines for calls used by these methods in the dell-smbios.h header for tracking purposes. Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Reviewed-by: Edward O'Callaghan <quasisec@google.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-wmi-descriptor: split WMI descriptor into it's own driverMario Limonciello2017-11-031-74/+6
| | | | | | | | | | | | | All communication on individual GUIDs should occur in separate drivers. Allowing a driver to communicate with the bus to another GUID is just a hack that discourages drivers to adopt the bus model. The information found from the WMI descriptor driver is now exported for use by other drivers. Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Reviewed-by: Edward O'Callaghan <quasisec@google.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-wmi: don't check length returnedMario Limonciello2017-11-031-5/+1
| | | | | | | | | | | This is intended to be variable and provided by the platform. Some platforms this year will be adopting a 32k WMI buffer, so don't complain when encountering those platforms or any other future changes. Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Reviewed-by: Edward O'Callaghan <quasisec@google.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-wmi: clean up wmi descriptor checkMario Limonciello2017-11-031-5/+5
| | | | | | | | | | | Some cases the wrong type was used for errors and checks can be done more cleanly. Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Reviewed-by: Edward O'Callaghan <quasisec@google.com> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-wmi: increase severity of some failuresMario Limonciello2017-11-031-6/+7
| | | | | | | | | | | | | | | | | | | | There is a lot of error checking in place for the format of the WMI descriptor buffer, but some of the potentially raised issues should be considered critical failures. If the buffer size or header don't match, this is a good indication that the buffer format changed in a way that the rest of the data should not be relied upon. For the remaining data set vectors, continue to notate a warning in undefined results, but as those are fields that the descriptor intended to refer to other applications, don't fail if they're new values. Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Reviewed-by: Edward O'Callaghan <quasisec@google.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-wmi: Do not match on descriptor GUID modaliasMario Limonciello2017-09-271-1/+0
| | | | | | | | | | | The descriptor GUID is not used to indicate that WMI notifications in the dell-wmi driver work properly. As such a modalias should not be present that causes this driver to load on systems with this GUID. Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Reviewed-by: Pali Pohar <pali.rohar@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-wmi: Update dell_wmi_check_descriptor_buffer() to new modelAndy Lutomirski2017-08-181-30/+39
| | | | | | | | | | This converts dell_wmi_check_descriptor_buffer() to the new driver model interface and puts the interface version in dell_wmi_priv where it belongs. Signed-off-by: Andy Lutomirski <luto@kernel.org> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-wmi: Fix driver interface version queryAndy Lutomirski2017-08-011-5/+7
| | | | | | | | | | | | | | | | | | | | When I converted dell-wmi to the new bus infrastructure, I left the call to dell_wmi_check_descriptor_buffer() in dell_wmi_init(). This could cause two problems: - An error message when loading the driver on a system without dell-wmi. We'd try to read the event descriptor even if the WMI GUID wasn't there. - A possible race if dell-wmi was loaded manually before wmi was fully initialized. Fix it by moving the call to the probe function where it belongs. Fixes: bff589be59c5 ("platform/x86: dell-wmi: Convert to the WMI bus infrastructure") Signed-off-by: Andy Lutomirski <luto@kernel.org> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-wmi: Convert to the WMI bus infrastructureAndy Lutomirski2017-06-061-66/+70
| | | | | | | | | | | | | | | | Move some initialization out of _init and into _probe. Update signatures and logic to use the wmi bus and device structures. Signed-off-by: Andy Lutomirski <luto@kernel.org> [dvhart: drop deprecated sparse_keymap_free, order declarations, add commit msg] Cc: Andy Lutomirski <luto@amacapital.net> Cc: Mario Limonciello <mario_limonciello@dell.com> Cc: Pali Rohár <pali.rohar@gmail.com> Cc: linux-kernel@vger.kernel.org Cc: platform-driver-x86@vger.kernel.org Cc: linux-acpi@vger.kernel.org Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-wmi: Add a better description for "stealth mode"Andy Lutomirski2017-06-031-1/+6
| | | | | | | | | | | This is based on Mario's explanation and observation of my laptop. Suggested-by: "Pali Rohár" <pali.rohar@gmail.com> Signed-off-by: Andy Lutomirski <luto@kernel.org> Cc: Mario Limonciello <mario_limonciello@dell.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic numberAndy Lutomirski2017-06-031-0/+1
| | | | | | | | | | | The hotkey table is 0xb2, add a comment for clarity. Suggested-by: Darren Hart <dvhart@infradead.org> Signed-off-by: Andy Lutomirski <luto@kernel.org> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-*: Call new led hw_changed API on kbd brightness changeHans de Goede2017-04-131-0/+4
| | | | | | | | | | | | Make dell-wmi notify on hotkey kbd brightness changes, listen for this in dell-laptop and call led_classdev_notify_brightness_hw_changed. This will allow userspace to monitor (poll) for brightness changes on these LEDs caused by the hotkey. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: dell-wmi: remove sparse_keymap_free() callsMichał Kępień2017-03-141-12/+4
| | | | | | | | | | | | As sparse_keymap_setup() now uses a managed memory allocation for the keymap copy it creates, the latter is freed automatically. Remove all calls to sparse_keymap_free(). As this reduces dell_wmi_input_destroy() to one line, replace all calls to that function with direct calls to input_unregister_device(). Signed-off-by: Michał Kępień <kernel@kempniu.pl> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* platform/x86: dell-wmi: Add events created by Dell Rugged 2-in-1sMario Limonciello2016-12-131-0/+10
| | | | | | | | | The Dell Rugged 7202 has 3 programmable buttons (labeled P1, P2, P3) and a detachable keyboard/mouse dock. Signed-off-by: Mario Limonciello <mario_limonciello@dell.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* platform/x86: dell-wmi: Adjust wifi catcher to emit KEY_WLANMario Limonciello2016-12-131-1/+1
| | | | | | | | | Wifi catcher is a slider switch, that when slid past the on position will emit an event that is intended for launching a wifi application or applet when the machine is turned on. Signed-off-by: Mario Limonciello <mario_limonciello@dell.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* dell-wmi: Ignore WMI event 0xe00ePali Rohár2016-08-081-2/+2
| | | | | | | WMI event 0xe00e is received when battery was removed or inserted. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* dell-wmi: Add a WMI event code for display on/offAlex Hung2016-06-211-0/+3
| | | | | | | | | Some new Dell AIO systems have a button that generates a WMI event to turn the LCD on/off. Signed-off-by: Alex Hung <alex.hung@canonical.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* dell-wmi: Generate one sparse keymap for all machinesPali Rohár2016-06-171-111/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reworks code for generating sparse keymap and processing WMI events. It unifies procedure for generating sparse keymap and also unifies big switch code for processing WMI events of different types. After this patch dell-wmi driver does not differ between "old" and "new" hotkey type. It constructs sparse keymap table with all WMI codes. It is because on some laptops (e.g. Dell Latitude E6440) ACPI/firmware send both event types (old and new). Each WMI code in sparse keymap table is prefixed by 16bit event type, so it does not change functionality on laptops with "old" hotkey support (those without scancodes in DMI). This allow us to distinguish between same WMI codes with different types in sparse keymap. Thanks to this WMI events of type 0x0011 were moved from big switch into sparse keymap table too. This patch also fixes possible bug in parsing WMI event buffer introduced in commit 5ea2559726b7 ("dell-wmi: Add support for new Dell systems"). That commit changed buffer type from int* to u16* without fixing code. More at: http://lkml.iu.edu/hypermail/linux/kernel/1507.0/01950.html Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Michał Kępień <kernel@kempniu.pl> Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* dell-wmi: Add information about other WMI event codesPali Rohár2016-06-171-0/+35
| | | | | | | | | | | | | | | ACPI DSDT tables have defined other WMI codes, but does not contain any description when those codes are emitted. Some other codes can be found in logs on internet. In this patch are all which I saw, but lot of them are not tested properly (e.g. for duplicate events with AT keyboard). Now we have all WMI event codes at one place and in future after proper testing those codes can be correctly enabled or disabled... Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Michał Kępień <kernel@kempniu.pl> Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* dell-wmi: Sort WMI event codes and update commentsPali Rohár2016-06-171-13/+16
| | | | | | | | | | | For better readability of keymap table, sort events by codes and also update comments for events to be more informative. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Michał Kępień <kernel@kempniu.pl> Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* dell-wmi: Ignore WMI event code 0xe045Pali Rohár2016-06-171-1/+12
| | | | | | | | | | | | | | | >From Dell we know that WMI event code 0xe045 is for Num Lock key, but it is unclear due to message in commit 0b3f6109f0c9 ("dell-wmi: new driver for hotkey control"). Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Michał Kępień <kernel@kempniu.pl> Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Reviewed-by: Michał Kępień <kernel@kempniu.pl> Cc: Matthew Garrett <mjg@redhat.com> Cc: Mario Limonciello <mario_limonciello@dell.com> Link: https://lkml.org/lkml/2015/7/7/830 Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* dell-wmi: support Dell Inspiron M5110Michał Kępień2016-03-231-1/+12
| | | | | | | | | | | | | Similarly to Dell Vostro V131, Dell Inspiron M5110 also requires an SMBIOS request to be issued in order for WMI events to be generated and does not raise an i8042 interrupt when the Dell Instant Launch hotkey is pressed. However, the event code for that hotkey on this machine is 0xe029, so add it to the legacy keymap. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Tested-by: Darek Stojaczyk <darek.stojaczyk@gmail.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* dell-wmi: properly process Dell Instant Launch hotkeyMichał Kępień2016-03-231-1/+4
| | | | | | | | | | | | | | | | On models on which an SMBIOS request needs to be issued in order for WMI events to be generated, pressing the Dell Instant Launch hotkey does not raise an i8042 interrupt - only a WMI event is generated (0xe025 on Dell Vostro V131). As that WMI event is the only way the kernel will be notified about pressing the Dell Instant Launch hotkey on such machines, the relevant keymap entry has to be changed to a KE_KEY one. However, the same WMI event should still be ignored on machines which do not require an SMBIOS request for enabling WMI, so filter it conditionally in dell_wmi_process_key(). Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* dell-wmi: enable receiving WMI events on Dell Vostro V131Michał Kępień2016-03-231-0/+66
| | | | | | | | | | | | | | | On some laptop models (e.g. Dell Vostro V131), WMI events are not generated until a specific SMBIOS request is issued to register an event listener [1]. As there seems to be no ACPI method or SMBIOS request to determine without possible side effects whether a given machine needs to issue this SMBIOS request in order to receive WMI events, DMI matching is used to whitelist the models which need it. [1] https://lists.us.dell.com/pipermail/libsmbios-devel/2015-July/000612.html Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* dell-wmi: Support new hotkeys on the XPS 13 9350 (Skylake)Andy Lutomirski2016-03-231-7/+64
| | | | | | | | | | | | | | | | | | | The XPS 13 9350 sends WMI keypress events that aren't enumerated in the DMI table. Add a table listing them. To avoid breaking things that worked before, these un-enumerated hotkeys won't be used if the DMI table maps them to something else. FWIW, it appears that the DMI table may be a legacy thing and we might want to rethink how we handle events in general. As an example, a whole lot of things map to KEY_PROG3 via the DMI table. This doesn't send keypress events for any of the new events. They appear to all be handled by other means (keyboard illumination is handled automatically and rfkill is handled by intel-hid). Signed-off-by: Andy Lutomirski <luto@kernel.org> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* dell-wmi: Clean up hotkey table size checkAndy Lutomirski2016-03-231-2/+13
| | | | | | | | | | | | | | | Checking the table for a minimum size of 7 bytes makes no sense: any valid hotkey table has a size that's a multiple of 4. Clean this up: replace the hardcoded header length with a sizeof and change the check to ignore an empty hotkey table. The only behavior change is that a 7-byte table (which is nonsensical) will now be treated as absent instead of as valid but empty. Reported-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Andy Lutomirski <luto@kernel.org> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* dell-wmi: Stop storing pointers to DMI tablesAndy Lutomirski2016-03-231-28/+46
| | | | | | | | | | | | | | | | The dmi_walk function maps the DMI table, walks it, and unmaps it. This means that the dell_bios_hotkey_table that find_hk_type stores points to unmapped memory by the time it gets read. I've been able to trigger crashes caused by the stale pointer a couple of times, but never on a stock kernel. Fix it by generating the keymap in the dmi_walk callback instead of storing a pointer. Signed-off-by: Andy Lutomirski <luto@kernel.org> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* Merge tag 'platform-drivers-x86-v4.5-1' of ↵Linus Torvalds2016-01-191-27/+155
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.infradead.org/users/dvhart/linux-platform-drivers-x86 Pull x86 platform driver updates from Darren Hart: "Add intel punit and telemetry driver for APL SoCs. Add intel-hid driver for various laptop hotkey support. Add asus-wireless radio control driver. Keyboard backlight support/improvements for ThinkPads, Vaio, and Toshiba. Several hotkey related fixes and improvements for dell and toshiba. Fix oops on dual GPU Macs in apple-gmux. A few new device IDs and quirks. Various minor config related build issues and cleanups. surface pro 4: - fix compare_const_fl.cocci warnings - Add support for Surface Pro 4 Buttons platform/x86: - Add Intel Telemetry Debugfs interfaces - Add Intel telemetry platform device - Add Intel telemetry platform driver - Add Intel Telemetry Core Driver - add NULL check for input parameters - add Intel P-Unit mailbox IPC driver - update acpi resource structure for Punit thinkpad_acpi: - Add support for keyboard backlight dell-wmi: - Process only one event on devices with interface version 0 - Check if Dell WMI descriptor structure is valid - Improve unknown hotkey handling - Use a C99-style array for bios_to_linux_keycode tc1100-wmi: - fix build warning when CONFIG_PM not enabled asus-wireless: - Add ACPI HID ATK4001 - Add Asus Wireless Radio Control driver asus-wmi: - drop to_platform_driver macro intel-hid: - new hid event driver for hotkeys sony-laptop: - Keyboard backlight control for some Vaio Fit models ideapad-laptop: - Add Lenovo ideapad Y700-17ISK to no_hw_rfkill dmi list apple-gmux: - Assign apple_gmux_data before registering toshiba_acpi: - Add rfkill dependency to ACPI_TOSHIBA entry - Fix keyboard backlight sysfs entries not being updated - Add WWAN RFKill support - Add support for WWAN devices - Fix blank screen at boot if transflective backlight is supported - Propagate the hotkey value via genetlink toshiba_bluetooth: - Add missing newline in toshiba_bluetooth_present function" * tag 'platform-drivers-x86-v4.5-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: (29 commits) surface pro 4: fix compare_const_fl.cocci warnings surface pro 4: Add support for Surface Pro 4 Buttons platform:x86: Add Intel Telemetry Debugfs interfaces platform:x86: Add Intel telemetry platform device platform:x86: Add Intel telemetry platform driver platform/x86: Add Intel Telemetry Core Driver intel_punit_ipc: add NULL check for input parameters thinkpad_acpi: Add support for keyboard backlight dell-wmi: Process only one event on devices with interface version 0 dell-wmi: Check if Dell WMI descriptor structure is valid tc1100-wmi: fix build warning when CONFIG_PM not enabled asus-wireless: Add ACPI HID ATK4001 platform/x86: Add Asus Wireless Radio Control driver asus-wmi: drop to_platform_driver macro intel-hid: new hid event driver for hotkeys Keyboard backlight control for some Vaio Fit models platform/x86: Add rfkill dependency to ACPI_TOSHIBA entry platform:x86: add Intel P-Unit mailbox IPC driver intel_pmc_ipc: update acpi resource structure for Punit ideapad-laptop: Add Lenovo ideapad Y700-17ISK to no_hw_rfkill dmi list ...
| * dell-wmi: Process only one event on devices with interface version 0Pali Rohár2016-01-191-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BIOS/ACPI on devices with WMI interface version 0 does not clear buffer before filling it. So next time when BIOS/ACPI send WMI event which is smaller as previous then it contains garbage in buffer from previous event. BIOS/ACPI on devices with WMI interface version 1 clears buffer and sometimes send more events in buffer at one call. Since commit 83fc44c32ad8 ("dell-wmi: Update code for processing WMI events") dell-wmi process all events in buffer (and not just first). To prevent reading garbage from the buffer we process only the first event on devices with WMI interface version 0. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
| * dell-wmi: Check if Dell WMI descriptor structure is validPali Rohár2016-01-191-2/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | After examining existing DSDT ACPI tables of more laptops and looking into Dell WMI document mentioned in ML dicussion archived at http://www.spinics.net/lists/platform-driver-x86/msg07220.html we will parse and check WMI descriptor if contains expected data. It is because WMI descriptor contains interface version number and it is needed to know in next commit. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
| * dell-wmi: Improve unknown hotkey handlingAndy Lutomirski2016-01-191-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If DMI lists a hotkey that we don't recognize, log and ignore it instead of trying to map it to keycode 0. I haven't seen this happen, but it will help maintain the key map in the future and it will help avoid sending bogus events. This also improves the message that we log when we get an unknown key event. Signed-off-by: Andy Lutomirski <luto@kernel.org> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> [dvhart: remove BUILD_BUG_ON per mutual agreement on list] Signed-off-by: Darren Hart <dvhart@linux.intel.com>
| * dell_wmi: Use a C99-style array for bios_to_linux_keycodeAndy Lutomirski2015-11-201-21/+40
| | | | | | | | | | | | | | | | | | | | | | It's currently hard to follow what maps to what, and it's hard to edit the array. Redo it as a C99-style array. I generated this using emacs regexes and a python one-liner. Signed-off-by: Andy Lutomirski <luto@kernel.org> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* | dell-wmi: Use acpi_video_handles_brightness_key_presses()Hans de Goede2016-01-011-4/+2
|/ | | | | | | | | | | | | Use the new acpi_video_handles_brightness_key_presses function to check if we should report brightness key-presses. This makes the code both easier to read and makes it properly report key-presses when acpi-video is not reporting them for reasons other then the backlight type being vendor. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* dell-wmi: Port to new backlight interface selection APIHans de Goede2015-06-191-1/+2
| | | | | | | | | | Port the backlight selection logic to the new backlight interface selection API. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* dell-wmi: Don't report keypresses on keybord illumination changeGabriele Mazzotta2014-12-031-3/+8
| | | | | | | | Keyboard illumination level changes are performed by the BIOS, so no events should be reported on keypress. This is already done on systems using the legacy keymap, do it also for systems that don't use it. Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
* dell-wmi: Don't report keypresses for radio state changesGabriele Mazzotta2014-12-031-4/+2
| | | | | | | | | | | | The WMI events associated to KEY_WLAN are for all the radio devices available. Use KEY_RFKILL instead since it's more appropriate. The state of radio devices is changed directly by the BIOS when hotkeys are pressed, so no events should be reported. Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Merged two patches modifying this one line Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* dell-wmi: Update code for processing WMI eventsPali Rohár2014-11-191-31/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The WMI buffer can contain multiple events. First value in buffer is length of event followed by data of specified length. After that is next length and next data. When length is zero then there is no more events in bufffer. This patch adds support for processing all events in buffer (not only first) and parse more event types (not only hotkey events). Because of variable length of events sometimes BIOS fills more hotkeys (or other values) into single WMI event. In this case this patch also processes these multiple hotkeys (and not only first one). Some event types are just ignored because kernel is not interested in them (e.g. NIC Link status, battery unplug, ...). This patch is based on DSDT table from Dell Latitude E6440. Code should be backward compatible so will process other events of old types same as before this patch. This patch also fixes a problem with unknown WMI event messages being written to the log. Now all known events are parsed and those which are not interesting to the kernel are dropped without an unknown WMI event message. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* dell-wmi: Fix access out of memoryPali Rohár2014-09-291-3/+9
| | | | | | | | | | Without this patch, dell-wmi is trying to access elements of dynamically allocated array without checking the array size. This can lead to memory corruption or a kernel panic. This patch adds the missing checks for array size. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* Merge branch 'acpi-cleanup'Rafael J. Wysocki2014-01-121-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * acpi-cleanup: (22 commits) ACPI / tables: Return proper error codes from acpi_table_parse() and fix comment. ACPI / tables: Check if id is NULL in acpi_table_parse() ACPI / proc: Include appropriate header file in proc.c ACPI / EC: Remove unused functions and add prototype declaration in internal.h ACPI / dock: Include appropriate header file in dock.c ACPI / PCI: Include appropriate header file in pci_link.c ACPI / PCI: Include appropriate header file in pci_slot.c ACPI / EC: Mark the function acpi_ec_add_debugfs() as static in ec_sys.c ACPI / NVS: Include appropriate header file in nvs.c ACPI / OSL: Mark the function acpi_table_checksum() as static ACPI / processor: initialize a variable to silence compiler warning ACPI / processor: use ACPI_COMPANION() to get ACPI device ACPI: correct minor typos ACPI / sleep: Drop redundant acpi_disabled check ACPI / dock: Drop redundant acpi_disabled check ACPI / table: Replace '1' with specific error return values ACPI: remove trailing whitespace ACPI / IBFT: Fix incorrect <acpi/acpi.h> inclusion in iSCSI boot firmware module ACPI / i915: Fix incorrect <acpi/acpi.h> inclusions via <linux/acpi_io.h> SFI / ACPI: Fix warnings reported during builds with W=1 ... Conflicts: drivers/acpi/nvs.c drivers/hwmon/asus_atk0110.c
| * ACPI: Clean up inclusions of ACPI header filesLv Zheng2013-12-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h> inclusions and remove some inclusions of those files that aren't necessary. First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h> should not be included directly from any files that are built for CONFIG_ACPI unset, because that generally leads to build warnings about undefined symbols in !CONFIG_ACPI builds. For CONFIG_ACPI set, <linux/acpi.h> includes those files and for CONFIG_ACPI unset it provides stub ACPI symbols to be used in that case. Second, there are ordering dependencies between those files that always have to be met. Namely, it is required that <acpi/acpi_bus.h> be included prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the latter depends on are always there. And <acpi/acpi.h> which provides basic ACPICA type declarations should always be included prior to any other ACPI headers in CONFIG_ACPI builds. That also is taken care of including <linux/acpi.h> as appropriate. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Tony Luck <tony.luck@intel.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> (drivers/pci stuff) Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> (Xen stuff) Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* | dell-wmi: Add KEY_MICMUTE to bios_to_linux_keycodeAlex Hung2013-11-201-3/+4
|/ | | | | Signed-off-by: Alex Hung <alex.hung@canonical.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
* dell-wmi: Add keys for Dell XPS L502XSeth Forshee2011-08-051-0/+10
| | | | | | | | | | All of these keys are being reported on the keyboard controller but are also generating WMI events. Add them to the legacy keymap to silence the noise. BugLink: http://bugs.launchpad.net/bugs/815914 Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* dell: Convert printks to pr_<level>Joe Perches2011-05-271-9/+8
| | | | | | | | Add pr_fmt. Remove hard coded prefixes and use pr_<level>. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* Input: dell-wmi - switch to using sparse keymap libraryDmitry Torokhov2010-10-211-160/+96
| | | | | | | | Instead of implementing its own version of keymap hanlding switch over to using sparse keymap library. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* dell-wmi: fix a memory leakAxel Lin2010-08-031-1/+8
| | | | | | | | | | If dell_new_hk_type is true, dell_legacy_wmi_keymap will point to a memory allocated in setup_new_hk_map(). In this case, the memory is not freed in current implementation. This patch fixes the leak by kfree(dell_wmi_keymap) if dell_new_hk_type is true. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
* dell-wmi: Add support for eject key on Dell Studio 1555Islam Amer2010-08-031-1/+1
| | | | | | | | | Fixes pressing the eject key on Dell Studio 1555 does not work and produces message : dell-wmi: Unknown key 0 pressed Signed-off-by: Islam Amer <pharon@gmail.com>