• Rajat Jain's avatar
    Input: atkbd - expose function row physical map to userspace · 8f7b057a
    Rajat Jain authored
    Certain keyboards have their top-row keys intended for actions such as
    "Browser back", "Browser Refresh", "Fullscreen" etc as their primary mode,
    thus they will send scan codes for those actions. Further, they don't
    have a dedicated "Fn" key so don't have the capability to generate
    function key codes (e.g. F1, F2 etc..).  However in this case, if
    userspace still wants to "synthesize" those function keys using the top
    row action keys, it needs to know the physical position of the top row
    keys. (Essentially a mapping between usage codes and a physical location
    in the top row).
    
    This patch enhances the atkbd driver to receive such a mapping from the
    firmware / device tree, and expose it to userspace in the form of a
    function-row-physmap attribute. The attribute would be a space separated
    ordered list of physical codes, for the keys in the function row, in
    left-to-right order.
    
    The attribute will only be present if the kernel knows about such mapping,
    otherwise the attribute shall not be visible.
    Signed-off-by: default avatarRajat Jain <rajatja@google.com>
    Link: https://lore.kernel.org/r/20200427210259.91330-2-rajatja@google.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
    8f7b057a
atkbd.c 46.2 KB