tools/testing/selftests/hid/tests/test_ite_keyboard.py

Source file repositories/reference/linux-study-clean/tools/testing/selftests/hid/tests/test_ite_keyboard.py

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/hid/tests/test_ite_keyboard.py
Extension
.py
Size
9616 bytes
Lines
168
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: tools
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#!/bin/env python3
# SPDX-License-Identifier: GPL-2.0
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Benjamin Tissoires <benjamin.tissoires@gmail.com>
# Copyright (c) 2020 Red Hat, Inc.
#

from .test_keyboard import ArrayKeyboard, TestArrayKeyboard
from hidtools.util import BusType

import libevdev
import logging
from . import base

logger = logging.getLogger("hidtools.test.ite-keyboard")

KERNEL_MODULE = base.KernelModule("itetech", "hid_ite")


class KbdData(object):
    pass


# The ITE keyboards have an issue regarding the Wifi key:
# nothing comes in when pressing the key, but we get a null
# event on the key release.
# This test covers this case.
class ITEKeyboard(ArrayKeyboard):
    # fmt: off
    report_descriptor = [
        0x06, 0x85, 0xff,              # Usage Page (Vendor Usage Page 0xff85)
        0x09, 0x95,                    # Usage (Vendor Usage 0x95)           3
        0xa1, 0x01,                    # Collection (Application)            5
        0x85, 0x5a,                    # .Report ID (90)                     7
        0x09, 0x01,                    # .Usage (Vendor Usage 0x01)          9
        0x15, 0x00,                    # .Logical Minimum (0)                11
        0x26, 0xff, 0x00,              # .Logical Maximum (255)              13
        0x75, 0x08,                    # .Report Size (8)                    16
        0x95, 0x10,                    # .Report Count (16)                  18
        0xb1, 0x00,                    # .Feature (Data,Arr,Abs)             20
        0xc0,                          # End Collection                      22
        0x05, 0x01,                    # Usage Page (Generic Desktop)        23
        0x09, 0x06,                    # Usage (Keyboard)                    25
        0xa1, 0x01,                    # Collection (Application)            27
        0x85, 0x01,                    # .Report ID (1)                      29
        0x75, 0x01,                    # .Report Size (1)                    31
        0x95, 0x08,                    # .Report Count (8)                   33
        0x05, 0x07,                    # .Usage Page (Keyboard)              35
        0x19, 0xe0,                    # .Usage Minimum (224)                37
        0x29, 0xe7,                    # .Usage Maximum (231)                39
        0x15, 0x00,                    # .Logical Minimum (0)                41
        0x25, 0x01,                    # .Logical Maximum (1)                43
        0x81, 0x02,                    # .Input (Data,Var,Abs)               45
        0x95, 0x01,                    # .Report Count (1)                   47
        0x75, 0x08,                    # .Report Size (8)                    49
        0x81, 0x03,                    # .Input (Cnst,Var,Abs)               51
        0x95, 0x05,                    # .Report Count (5)                   53
        0x75, 0x01,                    # .Report Size (1)                    55
        0x05, 0x08,                    # .Usage Page (LEDs)                  57
        0x19, 0x01,                    # .Usage Minimum (1)                  59
        0x29, 0x05,                    # .Usage Maximum (5)                  61
        0x91, 0x02,                    # .Output (Data,Var,Abs)              63
        0x95, 0x01,                    # .Report Count (1)                   65
        0x75, 0x03,                    # .Report Size (3)                    67
        0x91, 0x03,                    # .Output (Cnst,Var,Abs)              69
        0x95, 0x06,                    # .Report Count (6)                   71
        0x75, 0x08,                    # .Report Size (8)                    73
        0x15, 0x00,                    # .Logical Minimum (0)                75
        0x26, 0xff, 0x00,              # .Logical Maximum (255)              77

Annotation

Implementation Notes