summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorStephen Boyd <swboyd@chromium.org>2022-05-16 20:55:31 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2022-05-17 20:59:25 +0200
commit52dc6d3bea3b8509c2ec1f2ae413d0dc646e0b8a (patch)
tree6bde6cadebc7345ced7b50abd385f9b609c511ad /Documentation
parentLinux 5.17 (diff)
downloadlinux-52dc6d3bea3b8509c2ec1f2ae413d0dc646e0b8a.tar.xz
linux-52dc6d3bea3b8509c2ec1f2ae413d0dc646e0b8a.zip
dt-bindings: google,cros-ec-keyb: Introduce switches only compatible
If the ChromeOS board is a detachable, this cros-ec-keyb device won't have a matrix keyboard but it may have some button switches, e.g. volume buttons and power buttons. The driver still registers a keyboard though and that leads to userspace confusion around where the keyboard is. We tried to work around this by only registering the keyboard device when rows/columns properties were specified for the device, but that led to another problem where removing the rows/columns properties breaks the existing binding. Technically before that commit the rows/columns properties were required, otherwise the driver would fail to probe. Removing the properties from devicetrees makes the driver fail to probe unless the corresponding driver patch is present. Furthermore, this makes requiring matrix keyboard properties for devices that really have a keyboard impossible because the compatible drives the schema and now the properties are optional. Add a more specific compatible for this type of device that indicates to the OS that there are only switches and no matrix keyboard present. Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20220516183452.942008-2-swboyd@chromium.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/devicetree/bindings/input/google,cros-ec-keyb.yaml39
1 files changed, 33 insertions, 6 deletions
diff --git a/Documentation/devicetree/bindings/input/google,cros-ec-keyb.yaml b/Documentation/devicetree/bindings/input/google,cros-ec-keyb.yaml
index e8f137abb03c..e11cbf508723 100644
--- a/Documentation/devicetree/bindings/input/google,cros-ec-keyb.yaml
+++ b/Documentation/devicetree/bindings/input/google,cros-ec-keyb.yaml
@@ -15,14 +15,18 @@ description: |
Google's ChromeOS EC Keyboard is a simple matrix keyboard
implemented on a separate EC (Embedded Controller) device. It provides
a message for reading key scans from the EC. These are then converted
- into keycodes for processing by the kernel.
-
-allOf:
- - $ref: "/schemas/input/matrix-keymap.yaml#"
+ into keycodes for processing by the kernel. This device also supports
+ switches/buttons like power and volume buttons.
properties:
compatible:
- const: google,cros-ec-keyb
+ anyOf:
+ - description: ChromeOS EC with only buttons/switches
+ - items:
+ - const: google,cros-ec-keyb-switches
+ - description: ChromeOS EC with keyboard and possibly buttons/switches
+ - items:
+ - const: google,cros-ec-keyb
google,needs-ghost-filter:
description:
@@ -41,15 +45,32 @@ properties:
where the lower 16 bits are reserved. This property is specified only
when the keyboard has a custom design for the top row keys.
+dependencies:
+ function-row-phsymap: [ 'linux,keymap' ]
+ google,needs-ghost-filter: [ 'linux,keymap' ]
+
required:
- compatible
+if:
+ properties:
+ compatible:
+ contains:
+ const: google,cros-ec-keyb
+then:
+ allOf:
+ - $ref: "/schemas/input/matrix-keymap.yaml#"
+ required:
+ - keypad,num-rows
+ - keypad,num-columns
+ - linux,keymap
+
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/input/input.h>
- cros-ec-keyb {
+ keyboard-controller {
compatible = "google,cros-ec-keyb";
keypad,num-rows = <8>;
keypad,num-columns = <13>;
@@ -113,3 +134,9 @@ examples:
/* UP LEFT */
0x070b0067 0x070c0069>;
};
+ - |
+ /* No matrix keyboard, just buttons/switches */
+ keyboard-controller {
+ compatible = "google,cros-ec-keyb-switches";
+ };
+...