Input: atkbd - expose function row physical map to userspace
authorRajat Jain <rajatja@google.com>
Tue, 28 Apr 2020 00:51:15 +0000 (17:51 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 28 Apr 2020 01:04:23 +0000 (18:04 -0700)
commit8f7b057abe283a4505747ea8275751479442de53
tree24e877696402defc6cfd14573c10907a6a7c37b4
parent6052abf8ff783a14dcd2416be2c029ebeba9ad98
Input: atkbd - expose function row physical map to userspace

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: Rajat Jain <rajatja@google.com>
Link: https://lore.kernel.org/r/20200427210259.91330-2-rajatja@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/atkbd.c