summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-asus.c
AgeCommit message (Collapse)Author
2021-12-02HID: add hid_is_usb() function to make it simpler for USB detectionGreg Kroah-Hartman
A number of HID drivers already call hid_is_using_ll_driver() but only for the detection of if this is a USB device or not. Make this more obvious by creating hid_is_usb() and calling the function that way. Also converts the existing hid_is_using_ll_driver() functions to use the new call. Cc: Jiri Kosina <jikos@kernel.org> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: linux-input@vger.kernel.org Cc: stable@vger.kernel.org Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Link: https://lore.kernel.org/r/20211201183503.2373082-1-gregkh@linuxfoundation.org
2021-11-12Revert "HID: hid-asus.c: Maps key 0x35 (display off) to KEY_SCREENLOCK"Vinícius Angiolucci Reis
This reverts commit 2ea5999d07d2a0ab6ad92ccf65524707f2c5e456. As Dmitry Torokhov pointed out, the previous code (KEY_DISPLAY_OFF) is actually correct. The real issue is that current desktop environments don't deal it properly. Mapping it to another event does not solve the issue. So I'm reverting that change, keeping key 0x35 mapped to KEY_DISPLAY_OFF Signed-off-by: Vinícius Angiolucci Reis <angiolucci@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2021-10-19HID: hid-asus.c: Maps key 0x35 (display off) to KEY_SCREENLOCKVinícius Angiolucci Reis
On Windows systems, ASUS laptops uses the "turn display off" key (usually fn+f6) to turn both display and keyboard backlit off. On Linux systems, this key has no effect at all since most desktop enviroments don't deal with KEY_DISPLAY_OFF. By mapping it to KEY_SCREENLOCK instead, would enable desktop environments to handle this key as a screen lock intent from the user, out of the box. Signed-off-by: Vinícius Angiolucci Reis <angiolucci@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2021-08-20HID: asus: Prevent Claymore sending suspend eventLuke D. Jones
Prevent the ASUS Claymore keyboard from sending a suspend event when the device sleeps itself. The suspend event causes a system suspend if uncaught. Signed off by: Luke D Jones <luke@ljones.dev> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2021-07-15HID: asus: Remove check for same LED brightness on setLuke D. Jones
Remove the early return on LED brightness set so that any controller application, daemon, or desktop may set the same brightness at any stage. This is required because many ASUS ROG keyboards will default to max brightness on laptop resume if the LEDs were set to off before sleep. Signed-off-by: Luke D Jones <luke@ljones.dev> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2021-05-27HID: asus: Cleanup Asus T101HA keyboard-dock handlingHans de Goede
There is no need to use a quirk and then return -ENODEV from the asus_probe() function to avoid that hid-asus binds to the hiddev for the USB-interface for the hid-multitouch touchpad. The hid-multitouch hiddev has a group of HID_GROUP_MULTITOUCH_WIN_8, so the same result can be achieved by making the hid_device_id entry for the dock in the asus_devices[] table only match on HID_GROUP_GENERIC instead of having it match HID_GROUP_ANY. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2021-05-05HID: asus: filter G713/G733 key event to prevent shutdownLuke D Jones
The G713 and G733 both emit an unexpected keycode on some key presses such as Fn+Pause. The device in this case is emitting two events on key down, and 3 on key up, the third key up event is report ID 0x02 and is unfiltered, causing incorrect event. This patch filters out the single problematic event. Signed-off-by: Luke D Jones <luke@ljones.dev> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2021-05-05HID: asus: Filter keyboard EC for old ROG keyboardLuke D Jones
Older ROG keyboards emit a similar stream of bytes to the new N-Key keyboards and require filtering to prevent a lot of unmapped key warnings showing. As all the ROG keyboards use QUIRK_USE_KBD_BACKLIGHT this is now used to branch to filtering in asus_raw_event. Signed-off-by: Luke D Jones <luke@ljones.dev> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2021-03-08HID: asus: Add support for 2021 ASUS N-Key keyboardLuke D Jones
Some new 2021 version of ASUS gamer laptops are using an updated N-Key keyboard with the PID of 0x19b6. This version is using the same init sequence and brightness control as the 0x1866 keyboard. Signed-off-by: Luke D Jones <luke@ljones.dev> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-10-29HID: asus: Add support for ASUS N-Key keyboardLuke D Jones
The ASUS N-Key keyboard uses the productId of 0x1866 and is used in almost all modern ASUS gaming laptops with slight changes to the firmware. This patch enables: Fn+key hotkeys, keyboard backlight brightness control. Additionally this keyboard requires the LED interface to be initialized before such things as keyboard backlight control work. Signed-off-by: Luke D Jones <luke@ljones.dev> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-05-06HID: asus: Fix mute and touchpad-toggle keys on Medion Akoya E1239THans de Goede
The mute key, is broken. All the consumer keys on the keyboard USB interface work normally, except for mute which only sends press events and never sends release events. The touchpad key sends the otherwise unused input report with a report-id of 5 on the touchpad interface. It too only sends press events. This also requires extra special handling since the multi-touch touchpad events and the KEY_F21 events for the touchpad toggle must not be send from the same input_dev (userspace cannot handle this). This commit adds special handlig for both, fixing these keys not working. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-05-06HID: asus: Add support for multi-touch touchpad on Medion Akoya E1239THans de Goede
The multi-touch touchpad found on the Medion Akoya E1239T's keyboard-dock, uses the same custom multi-touch protocol as the Asus keyboard-docks (same chipset vendor, Integrated Technology Express / ITE). Add support for this using the existing multi-touch touchpad support in the hid-asus driver. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-05-06HID: asus: Add report_size to struct asus_touchpad_infoHans de Goede
Add the report_size to struct asus_touchpad_info instead of calculating it. This is a preparation patch for adding support for the multi-touch touchpad found on the Medion Akoya E1239T's keyboard-dock, which uses the same custom multi-touch protocol as the Asus keyboard-docks (same chipset vendor, Integrated Technology Express / ITE). The only difference in that the Akoya E1239T keyboard-dock's input-reports have a 5 byte footer instead of a 1 byte footer, which requires the report_size to be configurable per touchpad-model. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-05-06HID: asus: Add hid_is_using_ll_driver(usb_hid_driver) checkHans de Goede
Add a hid_is_using_ll_driver(usb_hid_driver) check to ensure that the parent device is an usb_interface, before casting the parent device pointer to an usb_interface pointer with to_usb_interface(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-05-06HID: asus: Simplify skipping of mappings for Asus T100CHI keyboard-dockHans de Goede
Before this commit the code was trying to keep the mapping for the left mouse-button, do avoid the hidinput_has_been_populated() check in hid-input.c from triggering and causing the touchpad input_dev ro get cleaned up. But the hidinput_has_been_populated() check happens after the input_configured callback which sets up all the input bit for the touchpad, so there is no need to preserve the left button mapping. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-05-06HID: asus: Only set EV_REP if we are adding a mappingHans de Goede
Make asus_input_mapping() only set EV_REP if we are adding a mapping. The T100CHI bluetooth keyboard dock has a few input reports for which we do not create any mappings (these input-reports are present in the descriptors but never send). The hid-asus code relies on the HID core not creating input devices for input-reports without any mappings. But the present of the EV_REP but counts as a mapping causing 6 /dev/input/event# nodes to be created for the T100CHI bluetooth keyboard dock. This change brings the amount of created /dev/input/event# nodes / input-devices down to 4. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-12-13HID: asus: Ignore Asus vendor-page usage-code 0xff eventsHans de Goede
At least on a T100HA an Asus vendor-page usage-code 0xff event is send on every suspend and again on resume, resulting in the following warning: asus 0003:0B05:1807.0002: Unmapped Asus vendor usagepage code 0xff being logged twice on every suspend/resume. This commit silences the "Unmapped Asus vendor usagepage code ..." warning for usage-code 0xff to avoid these warnings being logged. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-07-14Merge tag 'platform-drivers-x86-v5.3-1' of ↵Linus Torvalds
git://git.infradead.org/linux-platform-drivers-x86 Pull x86 platform driver updates from Andy Shevchenko: "Gathered a bunch of x86 platform driver changes. It's rather big, since includes two big refactors and completely new driver: - ASUS WMI driver got a big refactoring in order to support the TUF Gaming laptops. Besides that, the regression with backlight being permanently off on various EeePC laptops has been fixed. - Accelerometer on HP ProBook 450 G0 shows wrong measurements due to X axis being inverted. This has been fixed. - Intel PMC core driver has been extended to be ACPI enumerated if the DSDT provides device with _HID "INT33A1". This allows to convert the driver to be pure platform and support new hardware purely based on ACPI DSDT. - From now on the Intel Speed Select Technology is supported thru a corresponding driver. This driver provides an access to the features of the ISST, such as Performance Profile, Core Power, Base frequency and Turbo Frequency. - Mellanox platform drivers has been refactored and now extended to support more systems, including new coming ones. - The OLPC XO-1.75 platform is now supported. - CB4063 Beckhoff Automation board is using PMC clocks, provided via pmc_atom driver, for ethernet controllers in a way that they can't be managed by the clock driver. The quirk has been extended to cover this case. - Touchscreen on Chuwi Hi10 Plus tablet has been enabled. Meanwhile the information of Chuwi Hi10 Air has been fixed to cover more models based on the same platform. - Xiaomi notebooks have WMI interface enabled. Thus, the driver to support it has been provided. It required some extension of the generic WMI library, which allows to propagate opaque context to the ->probe() of the individual drivers. This release includes debugfs clean up from Greg KH for several drivers that drop return code check and make debugfs absence or failure non-fatal. Also miscellaneous fixes here and there, mostly for Acer WMI and various Intel drivers" * tag 'platform-drivers-x86-v5.3-1' of git://git.infradead.org/linux-platform-drivers-x86: (74 commits) platform/x86: Fix PCENGINES_APU2 Kconfig warning tools/power/x86/intel-speed-select: Add .gitignore file platform/x86: mlx-platform: Fix error handling in mlxplat_init() platform/x86: intel_pmc_core: Attach using APCI HID "INT33A1" platform/x86: intel_pmc_core: transform Pkg C-state residency from TSC ticks into microseconds platform/x86: asus-wmi: Use dev_get_drvdata() Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces platform/x86: mlx-platform: Add more reset cause attributes platform/x86: mlx-platform: Modify DMI matching order platform/x86: mlx-platform: Add regmap structure for the next generation systems platform/x86: mlx-platform: Change API for i2c-mlxcpld driver activation platform/x86: mlx-platform: Move regmap initialization before all drivers activation MAINTAINERS: Update for Intel Speed Select Technology tools/power/x86: A tool to validate Intel Speed Select commands platform/x86: ISST: Restore state on resume platform/x86: ISST: Add Intel Speed Select PUNIT MSR interface platform/x86: ISST: Add Intel Speed Select mailbox interface via MSRs platform/x86: ISST: Add Intel Speed Select mailbox interface via PCI platform/x86: ISST: Add Intel Speed Select mmio interface platform/x86: ISST: Add IOCTL to Translate Linux logical CPU to PUNIT CPU number ...
2019-06-17platform/x86: asus-wmi: Improve DSTS WMI method ID detectionYurii Pavlovskyi
The DSTS method detection mistakenly selects DCTS instead of DSTS if nothing is returned when the method ID is not defined in WMNB. As a result, the control of keyboard backlight is not functional for TUF Gaming series laptops. Implement detection based on _UID of the WMI device instead. There is evidence that DCTS is handled by ACPI WMI devices that have _UID ASUSWMI, whereas none of the devices without ASUSWMI respond to DCTS and DSTS is used instead [1]. DSDT examples: FX505GM (_UID ATK): Method (WMNB, 3, Serialized) { ... If ((Local0 == 0x53545344)) { ... Return (Zero) } ... // No return } K54C (_UID ATK): Method (WMNB, 3, Serialized) { ... If ((Local0 == 0x53545344)) { ... Return (0x02) } ... Return (0xFFFFFFFE) } [1] Link: https://lkml.org/lkml/2019/4/11/322 Signed-off-by: Yurii Pavlovskyi <yurii.pavlovskyi@gmail.com> Suggested-by: Daniel Drake <drake@endlessm.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152Thomas Gleixner
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-14HID: hid-asus: Add BT keyboard dock battery monitoring supportNOGUCHI Hiroshi
Add battery monitoring support for Transbook T100CHI/T90CHI's Bluetooth keyboard dock. They report rest battery level and charging status. Signed-off-by: NOGUCHI Hiroshi <drvlabo@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-02-14HID: hid-asus: Add Transbook T90CHI supportNOGUCHI Hiroshi
Add Transbook T90CHI support into hid-asus. T90CHI returns same BT vendor/product values as T100CHI, so identifies T90CHI by name. Signed-off-by: NOGUCHI Hiroshi <drvlabo@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-12-17HID: asus: Add support for the ASUS T101HA keyboard dockAleix Roca Nonell
The ASUS T101HA keyboard dock generates HID events using the ASUS vendor specific UsagePage 0xff31. In consequence, some multimedia keys such as brightness up and down are not working with hid-generic. This commit adds the T101HA dock into the supported device list of the hid-asus driver. It also prevents the dock's integrated touchpad to be bound with hid-asus given that it is already working fine with hid-multitouch. Signed-off-by: Aleix Roca Nonell <kernelrocks@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2018-11-30HID: asus: Add support for the ASUS FX503VD laptopHans de Goede
The ASUS FX503VD laptop uses an USB keyboard with several hotkeys which use the Asus Vendor specific UsagePage. This uses two usage-codes within the page which have not been seen before, 0x7c for its mic-mute hotkey and 0x99 for Fn+F5 which has a "fan" symbol as hotkey symbol on the keyb. we map this to KEY_PROG4 (PROG1-PROG3 are already used). This commit adds the mappings for the 2 new usage codes and the USB-ids for this keyboard to the hid-asus driver. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2018-11-30HID: asus: Add event handler to catch unmapped Asus Vendor UsagePage codesHans de Goede
Various Asus devices generate HID events using the Asus Vendor specific UsagePage 0xff31 and hid-asus will map these in its input_mapping for all devices to which it binds (independent of any quirks). Add an event callback which check for unmapped (because sofar unknown) usages within the Asus Vendor UsagePage and log a warning for these. The purpose of this patch is to help debugging / find such unmapped codes and add them to the asus_input_mapping() function. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2018-11-06HID: asus: fix build warning wiht CONFIG_ASUS_WMI disabledArnd Bergmann
asus_wmi_evaluate_method() is an empty dummy function when CONFIG_ASUS_WMI is disabled, or not reachable from a built-in device driver. This leads to a theoretical evaluation of an uninitialized variable that the compiler complains about, failing to check that the hardcoded return value makes this an unreachable code path: In file included from include/linux/printk.h:336, from include/linux/kernel.h:14, from include/linux/list.h:9, from include/linux/dmi.h:5, from drivers/hid/hid-asus.c:29: drivers/hid/hid-asus.c: In function 'asus_input_configured': include/linux/dynamic_debug.h:135:3: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized] __dynamic_dev_dbg(&descriptor, dev, fmt, \ ^~~~~~~~~~~~~~~~~ drivers/hid/hid-asus.c:359:6: note: 'value' was declared here u32 value; ^~~~~ With an extra IS_ENABLED() check, the warning goes away. Fixes: 3b692c55e58d ("HID: asus: only support backlight when it's not driven by WMI") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-10-31HID: asus: only support backlight when it's not driven by WMIDaniel Drake
The Asus GL502VSK has the same 0B05:1837 keyboard as we've seen in several Republic of Gamers laptops. However, in this model, the keybard backlight control exposed by hid-asus has no effect on the keyboard backlight. Instead, the keyboard backlight is correctly driven by asus-wmi. With two keyboard backlight devices available (and only the acer-wmi one working), GNOME is picking the wrong one to drive in the UI. Avoid this problem by not creating the backlight interface when we detect a WMI-driven keyboard backlight. We have also tested Asus GL702VMK which does have the hid-asus backlight present, and it still works fine with this patch (WMI method call returns UNSUPPORTED_METHOD). A direct "depends on ASUS_WMI" is intentionally avoided so that HID_ASUS users who have ASUS_WMI=n will not quietly lose their HID_ASUS driver on a kernel upgrade. Signed-off-by: Daniel Drake <drake@endlessm.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2018-04-05Merge branch 'for-4.17/upstream' into for-linusJiri Kosina
Pull a few small generic code cleanups.
2018-03-23HID: core: remove the need for HID_QUIRK_NO_EMPTY_INPUTBenjamin Tissoires
There is no real point of registering an empty input node. This should be default, but given some drivers need the blank input node to set it up during input_configured, we need to postpone the check for hidinput_has_been_populated(). Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-02-16HID: asus: make array 'buf' static constColin Ian King
Don't populate the const read-only array 'buf' on the stack but instead make it static. Makes the object code smaller by 26 bytes: Before: text data bss dec hex filename 14378 2384 64 16826 41ba linux/drivers/hid/hid-asus.o After: text data bss dec hex filename 14296 2440 64 16800 41a0 linux/drivers/hid/hid-asus.o (gcc version 7.2.0 x86_64) [jkosina@suse.cz: change commit message slightly] Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-01-23HID: asus: Fix special function keys on T200TAHans de Goede
Just like on the T100TA the T200TA HID descriptors for the 0xff32 Asus vendor usage page need a small fixup. But on the T200TA the HID descriptors are larger because they have descrriptors for one more (unused) HID report appended. Extend the T100TA descriptor fixup to also check for the T200TA's descriptors size. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-01-23HID: asus: Add touchpad max x/y and resolution info for the T200TAHans de Goede
The Asus T200TA uses the same USB device-id for its keyboard dock as the T100TA, but the touchpad has a different size and corresponding different max x/y values. Add a separate asus_touchpad_info struct for the T200TA and select this based on the DMI product-name (as we are already doing for the T100HA), so that we report the correct info to userspace. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-12-01HID: asus: Add product-id for the T100TAF and T100HA keyboard docksHans de Goede
The T100TAF and T100HA keyboard docks have the same special keys and custom protocol multitouch touchpad as the T100TA, but use a different product id. The T100TAF and T100HA both use the same product id, but the T100HA's touchpad has a different coordinate range. This commits adds supports for the new USB id and uses a dmi-check to determine if we're dealing with the T100TAF or T100HA. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=197849 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-11-09HID: add backlight level quirk for Asus ROG laptopsMustafa Kuscu
On laptops such as Asus GL553VD, setting keyboard backlight levels does not work. This change enables F3/F4 keys to set backlight levels (from 0 to 3, total 4 levels) on such laptops. It is intended only to the following device: 0x0b05 1854: P: Vendor=0b05 ProdID=1854 Rev=03.02 S: Manufacturer=ITE Tech. Inc. S: Product=ITE Device(8910) [jkosina@suse.cz: massage changelog a little bit] Signed-off-by: Mustafa C Kuscu <mustafakuscu@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-09-16HID: asus: Add support for Fn keys on Asus ROG G752Maxime Bellengé
This patch adds support for Fn keys on Asus ROG G752 laptop. The report descriptor is broken so I fixed it. Tested on an Asus G752VT. Resent fix white space fixes Signed-off-by: Maxime Bellengé <maxime.bellenge@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-08-08HID: asus: Add T100CHI bluetooth keyboard dock touchpad supportHans de Goede
Put the touchpad in native (absolute coordinate mode) and export it to userspace as a touchpad rather then as a mouse. Note this requires HID_QUIRK_MULTI_INPUT as the T100CHI keyboard dock has all functionality on a single HID interface and userspace expects touchpads to be on a separate input_dev. Without MULTI_INPUT userspace will ignore the keyboard part of the keyboard/touchpad combo. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-07-20HID: asus: Add T100CHI bluetooth keyboard dock special keys mappingHans de Goede
The Asus Transformer T100CHI comes with a Bluetooth keyboard dock which uses the same 0xff31 Asus vendor HUT page as other Asus keyboards. This commit adds its device-id to hid-asus and fixes an issue in the descriptor of the 0xff31 Usage, which together fixes the special keys on this keyboard not working. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-07-20HID: asus: Add T100TA touchpad resolution infoHans de Goede
The touchpad code is only used with the T100TA touchpad which measures 75.5 x 41.5 mm, add corresponding resolution info. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-07-20HID: asus: Fix T100TA touchpad y dimensionsHans de Goede
When adding the initial support I only looked at the maximum coordinates but the Y axis is inverted, so I should have checked the minimum coodinates which never reach 0 due to max_y being wrong, fix this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-07-20HID: asus: Parameterize the touchpad codeHans de Goede
Instead of having hardcoded (#define-d) values use a struct describing the various touchpad parameters. This is a preparation patch for improving the T100TA touchpad support as well as for adding T100CHI touchpad support. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-07-20HID: asus: Add support for T100 touchpadHans de Goede
Add support for the Asus T100 touchpad in multi-touch mode (rather then mouse emulation mode). It turns out that the Asus T100 touchpad is identical to the already supported i2c-hid Asus touchpads, so adding support for it was easy. The only significant difference is that the reported x-coordinates range on the T100 touchpad is somewhat lower then the range on the already supported touchpads. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-06-08HID: asus: Add support for Zen AiO MD-5110 keyboardDaniel Drake
Add support for media keys on the MD-5110 wireless keyboard that comes with the Asus V221ID and ZN241IC All In One computers. The keys to support here are WLAN, BRIGHTNESSDOWN and BRIGHTNESSUP. The USB Vendor ID suggests that it is a TURBOX device, but the physical branding only mentions ASUS MD-5110. Signed-off-by: Daniel Drake <drake@endlessm.com> Acked-by: Benjamin Tissoires <benajmin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-06-08HID: move Asus keyboard support from hid-chicony to hid-asusDaniel Drake
The Asus AIO keyboard AK1D was added to hid-chicony based on its USB vendor ID, however images available online suggest that this keyboard is physically branded as ASUS with no mention of Chicony. A recent commit also added support for another Asus AIO keyboard into hid-chicony, this one with USB vendor ID Jess, and a pending review comment asked me to move it into hid-asus because it is also only physically branded as ASUS. I updated the USB ID defines to match the branding and product name, including noting that the recently added keyboard is labelled as ASUS MD-5112. Signed-off-by: Daniel Drake <drake@endlessm.com> Acked-by: Benjamin Tissoires <benajmin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-06-02HID: asus: Stop underlying hardware on removeCarlo Caione
We are missing a call to hid_hw_stop() on the remove hook. Among other things this is causing an Oops when (re-)starting GNOME / upowerd / ... after the module has been already rmmod-ed. Signed-off-by: Carlo Caione <carlo@endlessm.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-05-22HID: asus: Add support for T100 keyboardHans de Goede
The keyboard dock used with the Asus Transformer T100 series, uses the same vendor-defined 0xff31 usage-page as some other Asus keyboards. But with a small twist, it has a small descriptor bug which needs to be fixed up for things to work. This commit adds the USB-ID for this keyboard to the hid-asus driver and makes asus_report_fixup fix the descriptor issue, fixing various special function keys on this keyboard not working. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-04-12HID: asus: support backlight on USB keyboardsCarlo Caione
The latest USB keyboards shipped on several ASUS laptop models (including ROG laptop models such as GL702VMK) have the keyboards backlight controlled by the keyboard firmware. The firmware implements at least 3 different commands: - Init command (to use when the system starts) - Configuration command (to get keyboard status/information) - Backlight level control (to change the level of the keyboard light) With this patch we create the usual 'asus::kbd_backlight' led class entry to control the keyboard backlight. [jkosina@suse.cz: remove pointless cancel_work_sync() call while handling an error in asus_kbd_register_leds(), as spotted by Benjamin] Signed-off-by: Carlo Caione <carlo@endlessm.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-03-30HID: asus: change mapping from KEY_WLAN to KEY_RFKILLMatjaz Hegedic
The input mapping code incorrectly maps the Airplane Mode button to KEY_WLAN, which stands for WiFi toggle, but doesn't affect Bluetooth (and other active radios) which is expected behavior for Airplane Mode. The fix replaces KEY_WLAN with the more appropriate KEY_RFKILL. The declared usage code 0x88 corresponds to Airplane Mode button on all keyboards handled by hid-asus (I2C netbook keyboards and USB RoG series keyboards), so the fix doesn't introduce any inconsistencies across different models. Signed-off-by: Matjaz Hegedic <matjaz.hegedic@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-03-30HID: asus: ignore declared dummy usagesMatjaz Hegedic
Keyboards handled by hid-asus declare special key functions using a vendor-specific page, however, alongside legitimate key functions, dummy usages with seemingly arbitrary values are also declared and can lead to keyboards being detected as pointer devices by some software (such as X.org). In addition, for the I2C keyboard volume controls are separately declared in a Consumer Usage page, with the same dummy usage problem. The fix in 1989dada7ce0 ("HID: input: ignore System Control application usages if not System Controls") does not mitigate the problem described above, therefore dummy usages need to be ignored in the driver itself. This fix properly ignores dummy usages and introduces a quirk for custom handling of the Consumer Usages on the I2C keyboard. Signed-off-by: Matjaz Hegedic <matjaz.hegedic@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-03-30HID: asus: fix and generalize ambiguous preprocessor macrosMatjaz Hegedic
Before commits a1cbda7a65a7a ("HID: asus: drop dependency on I2C_HID") and 64a403c6555fd ("HID: asus: support Republic Of Gamers special keys") hid-asus only pertained to a single I2C keyboard model found in ASUS X205TA, F205TA, & X200HA. The aforementioned commits expanded this support to other ASUS laptop keyboard models. In order to clarify that existing keyboard and touchpad quirks only apply to the I2C devices, and not ASUS keyboards in general, I2C HID IDs and their corresponding quirk sets have been renamed. In addition, the latter commit introduced special key handling, which also applies to the I2C keyboard, not just Republic of Gamers series. Therefore, the rog_map_key_clear() macro is renamed to asus_map_key_clear() for the sake of generality. Signed-off-by: Matjaz Hegedic <matjaz.hegedic@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-03-30HID: asus: support Republic of Gamers special keysChris Chiu
Add support for the special keys found on the internal keyboard of the Asus Republic of Gamers (ROG) laptop models GL553VD, GL553VE, GL753VD and GL753VE. Signed-off-by: Chris Chiu <chiu@endlessm.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>