• Henrik Rydberg's avatar
    HID: Handle driver-specific device descriptor in core · a7197c2e
    Henrik Rydberg authored
    The low-level driver can read the report descriptor, but it cannot
    determine driver-specific changes to it. The hid core can fixup
    and parse the report descriptor during driver attach, but does
    not have direct access to the descriptor when doing so.
    
    To be able to handle attach/detach of hid drivers properly,
    a semantic change to hid_parse_report() is needed. This function has
    been used in two ways, both as descriptor reader in the ll drivers and
    as a parsor in the probe of the drivers. This patch splits the usage
    by introducing hid_open_report(), and modifies the hid_parse() macro
    to call hid_open_report() instead. The only usage of hid_parse_report()
    is then to read and store the device descriptor. As a consequence, we
    can handle the report fixups automatically inside the hid core.
    Signed-off-by: default avatarHenrik Rydberg <rydberg@euromail.se>
    Tested-by: default avatarNikolai Kondrashov <spbnick@gmail.com>
    Tested-by: default avatarBenjamin Tissoires <benjamin.tissoires@gmail.com>
    Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
    a7197c2e
hid-core.c 79.7 KB