Skip to content

Commit 50d68fe

Browse files
Ricardo Cañuelorobherring
authored andcommitted
dt-bindings: input: convert cros-ec-keyb to json-schema
Convert the google,cros-ec-keyb binding to YAML and add it as a property of google,cros-ec.yaml Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com> Link: https://lore.kernel.org/r/20201021114308.25485-3-ricardo.canuelo@collabora.com Signed-off-by: Rob Herring <robh@kernel.org>
1 parent 1acd457 commit 50d68fe

3 files changed

Lines changed: 95 additions & 72 deletions

File tree

Documentation/devicetree/bindings/input/cros-ec-keyb.txt

Lines changed: 0 additions & 72 deletions
This file was deleted.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
5+
$id: http://devicetree.org/schemas/input/google,cros-ec-keyb.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: ChromeOS EC Keyboard
9+
10+
maintainers:
11+
- Simon Glass <sjg@chromium.org>
12+
- Benson Leung <bleung@chromium.org>
13+
- Enric Balletbo i Serra <enric.balletbo@collabora.com>
14+
15+
description: |
16+
Google's ChromeOS EC Keyboard is a simple matrix keyboard
17+
implemented on a separate EC (Embedded Controller) device. It provides
18+
a message for reading key scans from the EC. These are then converted
19+
into keycodes for processing by the kernel.
20+
21+
allOf:
22+
- $ref: "/schemas/input/matrix-keymap.yaml#"
23+
24+
properties:
25+
compatible:
26+
const: google,cros-ec-keyb
27+
28+
google,needs-ghost-filter:
29+
description:
30+
Enable a ghost filter for the matrix keyboard. This is recommended
31+
if the EC does not have its own logic or hardware for this.
32+
type: boolean
33+
34+
required:
35+
- compatible
36+
37+
unevaluatedProperties: false
38+
39+
examples:
40+
- |
41+
cros-ec-keyb {
42+
compatible = "google,cros-ec-keyb";
43+
keypad,num-rows = <8>;
44+
keypad,num-columns = <13>;
45+
google,needs-ghost-filter;
46+
/*
47+
* Keymap entries take the form of 0xRRCCKKKK where
48+
* RR=Row CC=Column KKKK=Key Code
49+
* The values below are for a US keyboard layout and
50+
* are taken from the Linux driver. Note that the
51+
* 102ND key is not used for US keyboards.
52+
*/
53+
linux,keymap = <
54+
/* CAPSLCK F1 B F10 */
55+
0x0001003a 0x0002003b 0x00030030 0x00040044
56+
/* N = R_ALT ESC */
57+
0x00060031 0x0008000d 0x000a0064 0x01010001
58+
/* F4 G F7 H */
59+
0x0102003e 0x01030022 0x01040041 0x01060023
60+
/* ' F9 BKSPACE L_CTRL */
61+
0x01080028 0x01090043 0x010b000e 0x0200001d
62+
/* TAB F3 T F6 */
63+
0x0201000f 0x0202003d 0x02030014 0x02040040
64+
/* ] Y 102ND [ */
65+
0x0205001b 0x02060015 0x02070056 0x0208001a
66+
/* F8 GRAVE F2 5 */
67+
0x02090042 0x03010029 0x0302003c 0x03030006
68+
/* F5 6 - \ */
69+
0x0304003f 0x03060007 0x0308000c 0x030b002b
70+
/* R_CTRL A D F */
71+
0x04000061 0x0401001e 0x04020020 0x04030021
72+
/* S K J ; */
73+
0x0404001f 0x04050025 0x04060024 0x04080027
74+
/* L ENTER Z C */
75+
0x04090026 0x040b001c 0x0501002c 0x0502002e
76+
/* V X , M */
77+
0x0503002f 0x0504002d 0x05050033 0x05060032
78+
/* L_SHIFT / . SPACE */
79+
0x0507002a 0x05080035 0x05090034 0x050B0039
80+
/* 1 3 4 2 */
81+
0x06010002 0x06020004 0x06030005 0x06040003
82+
/* 8 7 0 9 */
83+
0x06050009 0x06060008 0x0608000b 0x0609000a
84+
/* L_ALT DOWN RIGHT Q */
85+
0x060a0038 0x060b006c 0x060c006a 0x07010010
86+
/* E R W I */
87+
0x07020012 0x07030013 0x07040011 0x07050017
88+
/* U R_SHIFT P O */
89+
0x07060016 0x07070036 0x07080019 0x07090018
90+
/* UP LEFT */
91+
0x070b0067 0x070c0069>;
92+
};

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ properties:
7171
wakeup-source:
7272
description: Button can wake-up the system.
7373

74+
keyboard-controller:
75+
$ref: "/schemas/input/google,cros-ec-keyb.yaml#"
76+
7477
patternProperties:
7578
"^i2c-tunnel[0-9]*$":
7679
type: object

0 commit comments

Comments
 (0)