06 May, 2020

6 commits

  • 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
    Signed-off-by: Jiri Kosina

    Hans 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
    Signed-off-by: Jiri Kosina

    Hans 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
    Signed-off-by: Jiri Kosina

    Hans 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
    Signed-off-by: Jiri Kosina

    Hans 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
    Signed-off-by: Jiri Kosina

    Hans 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
    Signed-off-by: Jiri Kosina

    Hans de Goede
     

13 Dec, 2019

1 commit

  • 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
    Signed-off-by: Jiri Kosina

    Hans de Goede
     

15 Jul, 2019

1 commit

  • 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
    ...

    Linus Torvalds
     

17 Jun, 2019

1 commit

  • 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
    Suggested-by: Daniel Drake
    Signed-off-by: Andy Shevchenko

    Yurii Pavlovskyi
     

31 May, 2019

1 commit

  • 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
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

14 Feb, 2019

2 commits


17 Dec, 2018

1 commit

  • 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
    Signed-off-by: Benjamin Tissoires

    Aleix Roca Nonell
     

30 Nov, 2018

2 commits

  • 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
    Signed-off-by: Benjamin Tissoires

    Hans 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
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     

06 Nov, 2018

1 commit

  • 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
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Jiri Kosina

    Arnd Bergmann
     

31 Oct, 2018

1 commit

  • 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
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Andy Shevchenko

    Daniel Drake
     

05 Apr, 2018

1 commit


23 Mar, 2018

1 commit


16 Feb, 2018

1 commit

  • 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
    Signed-off-by: Jiri Kosina

    Colin Ian King
     

23 Jan, 2018

2 commits

  • 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
    Acked-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Hans 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
    Acked-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Hans de Goede
     

01 Dec, 2017

1 commit

  • 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
    Signed-off-by: Jiri Kosina

    Hans de Goede
     

09 Nov, 2017

1 commit

  • 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
    Signed-off-by: Jiri Kosina

    Mustafa Kuscu
     

16 Sep, 2017

1 commit


08 Aug, 2017

1 commit

  • 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
    Signed-off-by: Jiri Kosina

    Hans de Goede
     

20 Jul, 2017

5 commits

  • 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
    Signed-off-by: Jiri Kosina

    Hans 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
    Signed-off-by: Jiri Kosina

    Hans 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
    Signed-off-by: Jiri Kosina

    Hans 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
    Signed-off-by: Jiri Kosina

    Hans 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
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Hans de Goede
     

08 Jun, 2017

2 commits

  • 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
    Acked-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Daniel 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
    Acked-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Daniel Drake
     

02 Jun, 2017

1 commit

  • 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
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Carlo Caione
     

22 May, 2017

1 commit

  • 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
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Hans de Goede
     

13 Apr, 2017

1 commit

  • 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
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Carlo Caione
     

30 Mar, 2017

4 commits

  • 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
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Matjaz 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
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Matjaz 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
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Matjaz Hegedic
     
  • 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
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Chris Chiu