]> git.baikalelectronics.ru Git - kernel.git/commit
Input: cros-ec-keyb - expose function row physical map to userspace
authorPhilip Chen <philipchen@chromium.org>
Tue, 23 Feb 2021 05:05:04 +0000 (21:05 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 23 Feb 2021 05:22:15 +0000 (21:22 -0800)
commit4651757422b226261eb619817f4a313975762976
treeda79002995173e09e7799e9e6a4f448823fc5ce2
parent2db81e7637d323e5048e4292b70f6f3f763942de
Input: cros-ec-keyb - expose function row physical map to userspace

The top-row keys in a keyboard usually have dual functionalities.
E.g. A function key "F1" is also an action key "Browser back".

Therefore, when an application receives an action key code from
a top-row key press, the application needs to know how to correlate
the action key code with the function key code and do the conversion
whenever necessary.

Since the userpace already knows the key scanlines (row/column)
associated with a received key code. Essentially, the userspace only
needs a mapping between the key row/column and the matching physical
location in the top row.

So, enhance the cros-ec-keyb driver to create such a mapping
and expose it to userspace in the form of a function_row_physmap
attribute. The attribute would be a space separated ordered list of
row/column codes for the keys in the function row, in a left-to-right
order.

The attribute will only be present when the device has a custom design
for the top-row keys.

Signed-off-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210115122412.v7.2.I6542d7d9d0b246e7079bb16b41e697b2ac4b4e39@changeid
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Documentation/ABI/testing/sysfs-driver-input-cros-ec-keyb [new file with mode: 0644]
drivers/input/keyboard/cros_ec_keyb.c