xref: /freebsd/sys/contrib/device-tree/Bindings/input/adi,adp5588.yaml (revision b2d2a78ad80ec68d4a17f5aef97d21686cb1e29b)
17ef62cebSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
27ef62cebSEmmanuel Vadot%YAML 1.2
37ef62cebSEmmanuel Vadot---
47ef62cebSEmmanuel Vadot$id: http://devicetree.org/schemas/input/adi,adp5588.yaml#
57ef62cebSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
67ef62cebSEmmanuel Vadot
77ef62cebSEmmanuel Vadottitle: Analog Devices ADP5588 Keypad Controller
87ef62cebSEmmanuel Vadot
97ef62cebSEmmanuel Vadotmaintainers:
107ef62cebSEmmanuel Vadot  - Nuno Sá <nuno.sa@analog.com>
117ef62cebSEmmanuel Vadot
127ef62cebSEmmanuel Vadotdescription: |
137ef62cebSEmmanuel Vadot  Analog Devices Mobile I/O Expander and QWERTY Keypad Controller
147ef62cebSEmmanuel Vadot  https://www.analog.com/media/en/technical-documentation/data-sheets/ADP5588.pdf
157ef62cebSEmmanuel Vadot
167ef62cebSEmmanuel VadotallOf:
177ef62cebSEmmanuel Vadot  - $ref: matrix-keymap.yaml#
187ef62cebSEmmanuel Vadot  - $ref: input.yaml#
197ef62cebSEmmanuel Vadot
207ef62cebSEmmanuel Vadotproperties:
217ef62cebSEmmanuel Vadot  compatible:
227ef62cebSEmmanuel Vadot    enum:
237ef62cebSEmmanuel Vadot      - adi,adp5587
247ef62cebSEmmanuel Vadot      - adi,adp5588
257ef62cebSEmmanuel Vadot
267ef62cebSEmmanuel Vadot  reg:
277ef62cebSEmmanuel Vadot    maxItems: 1
287ef62cebSEmmanuel Vadot
297ef62cebSEmmanuel Vadot  vcc-supply:
307ef62cebSEmmanuel Vadot    description: Supply Voltage Input
317ef62cebSEmmanuel Vadot
327ef62cebSEmmanuel Vadot  reset-gpios:
337ef62cebSEmmanuel Vadot    description:
347ef62cebSEmmanuel Vadot      If specified, it will be asserted during driver probe. As the line is
357ef62cebSEmmanuel Vadot      active low, it should be marked GPIO_ACTIVE_LOW.
367ef62cebSEmmanuel Vadot    maxItems: 1
377ef62cebSEmmanuel Vadot
387ef62cebSEmmanuel Vadot  interrupts:
397ef62cebSEmmanuel Vadot    maxItems: 1
407ef62cebSEmmanuel Vadot
417ef62cebSEmmanuel Vadot  gpio-controller:
427ef62cebSEmmanuel Vadot    description:
437ef62cebSEmmanuel Vadot      This property applies if either keypad,num-rows lower than 8 or
447ef62cebSEmmanuel Vadot      keypad,num-columns lower than 10.
457ef62cebSEmmanuel Vadot
467ef62cebSEmmanuel Vadot  '#gpio-cells':
477ef62cebSEmmanuel Vadot    const: 2
487ef62cebSEmmanuel Vadot
497ef62cebSEmmanuel Vadot  interrupt-controller:
507ef62cebSEmmanuel Vadot    description:
517ef62cebSEmmanuel Vadot      This property applies if either keypad,num-rows lower than 8 or
52*b2d2a78aSEmmanuel Vadot      keypad,num-columns lower than 10. This property is optional if
53*b2d2a78aSEmmanuel Vadot      keypad,num-rows or keypad,num-columns are not specified as the
54*b2d2a78aSEmmanuel Vadot      device is then configured to be used purely for gpio during which
55*b2d2a78aSEmmanuel Vadot      interrupts may or may not be utilized.
567ef62cebSEmmanuel Vadot
577ef62cebSEmmanuel Vadot  '#interrupt-cells':
587ef62cebSEmmanuel Vadot    const: 2
597ef62cebSEmmanuel Vadot
607ef62cebSEmmanuel Vadot  adi,unlock-keys:
617ef62cebSEmmanuel Vadot    description:
627ef62cebSEmmanuel Vadot      Specifies a maximum of 2 keys that can be used to unlock the keypad.
637ef62cebSEmmanuel Vadot      If this property is set, the keyboard will be locked and only unlocked
647ef62cebSEmmanuel Vadot      after these keys are pressed. If only one key is set, a double click is
657ef62cebSEmmanuel Vadot      needed to unlock the keypad. The value of this property cannot be bigger
667ef62cebSEmmanuel Vadot      or equal than keypad,num-rows * keypad,num-columns.
677ef62cebSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
687ef62cebSEmmanuel Vadot    minItems: 1
697ef62cebSEmmanuel Vadot    maxItems: 2
707ef62cebSEmmanuel Vadot
71*b2d2a78aSEmmanuel Vadotdependencies:
72*b2d2a78aSEmmanuel Vadot  keypad,num-rows:
73*b2d2a78aSEmmanuel Vadot    - linux,keymap
74*b2d2a78aSEmmanuel Vadot    - keypad,num-columns
75*b2d2a78aSEmmanuel Vadot  keypad,num-columns:
76*b2d2a78aSEmmanuel Vadot    - linux,keymap
77*b2d2a78aSEmmanuel Vadot    - keypad,num-rows
78*b2d2a78aSEmmanuel Vadot  linux,keymap:
79*b2d2a78aSEmmanuel Vadot    - keypad,num-rows
80*b2d2a78aSEmmanuel Vadot    - keypad,num-columns
81*b2d2a78aSEmmanuel Vadot    - interrupts
82*b2d2a78aSEmmanuel Vadot  interrupt-controller:
83*b2d2a78aSEmmanuel Vadot    - interrupts
84*b2d2a78aSEmmanuel Vadot
857ef62cebSEmmanuel Vadotrequired:
867ef62cebSEmmanuel Vadot  - compatible
877ef62cebSEmmanuel Vadot  - reg
887ef62cebSEmmanuel Vadot
897ef62cebSEmmanuel VadotunevaluatedProperties: false
907ef62cebSEmmanuel Vadot
917ef62cebSEmmanuel Vadotexamples:
927ef62cebSEmmanuel Vadot  - |
937ef62cebSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
947ef62cebSEmmanuel Vadot    #include <dt-bindings/input/input.h>
957ef62cebSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
967ef62cebSEmmanuel Vadot    i2c {
977ef62cebSEmmanuel Vadot        #address-cells = <1>;
987ef62cebSEmmanuel Vadot        #size-cells = <0>;
997ef62cebSEmmanuel Vadot
1007ef62cebSEmmanuel Vadot        keys@34 {
1017ef62cebSEmmanuel Vadot            compatible = "adi,adp5588";
1027ef62cebSEmmanuel Vadot            reg = <0x34>;
1037ef62cebSEmmanuel Vadot
1047ef62cebSEmmanuel Vadot            vcc-supply = <&vcc>;
1057ef62cebSEmmanuel Vadot            interrupts = <21 IRQ_TYPE_EDGE_FALLING>;
1067ef62cebSEmmanuel Vadot            interrupt-parent = <&gpio>;
1077ef62cebSEmmanuel Vadot            reset-gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
1087ef62cebSEmmanuel Vadot
1097ef62cebSEmmanuel Vadot            keypad,num-rows = <1>;
1107ef62cebSEmmanuel Vadot            keypad,num-columns = <9>;
1117ef62cebSEmmanuel Vadot            linux,keymap = <
1127ef62cebSEmmanuel Vadot                MATRIX_KEY(0x00, 0x00, KEY_1)
1137ef62cebSEmmanuel Vadot                MATRIX_KEY(0x00, 0x01, KEY_2)
1147ef62cebSEmmanuel Vadot                MATRIX_KEY(0x00, 0x02, KEY_3)
1157ef62cebSEmmanuel Vadot                MATRIX_KEY(0x00, 0x03, KEY_4)
1167ef62cebSEmmanuel Vadot                MATRIX_KEY(0x00, 0x04, KEY_5)
1177ef62cebSEmmanuel Vadot                MATRIX_KEY(0x00, 0x05, KEY_6)
1187ef62cebSEmmanuel Vadot                MATRIX_KEY(0x00, 0x06, KEY_7)
1197ef62cebSEmmanuel Vadot                MATRIX_KEY(0x00, 0x07, KEY_8)
1207ef62cebSEmmanuel Vadot                MATRIX_KEY(0x00, 0x08, KEY_9)
1217ef62cebSEmmanuel Vadot            >;
1227ef62cebSEmmanuel Vadot        };
1237ef62cebSEmmanuel Vadot    };
124*b2d2a78aSEmmanuel Vadot
125*b2d2a78aSEmmanuel Vadot  - |
126*b2d2a78aSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
127*b2d2a78aSEmmanuel Vadot    i2c {
128*b2d2a78aSEmmanuel Vadot        #address-cells = <1>;
129*b2d2a78aSEmmanuel Vadot        #size-cells = <0>;
130*b2d2a78aSEmmanuel Vadot        gpio@34 {
131*b2d2a78aSEmmanuel Vadot            compatible = "adi,adp5588";
132*b2d2a78aSEmmanuel Vadot            reg = <0x34>;
133*b2d2a78aSEmmanuel Vadot
134*b2d2a78aSEmmanuel Vadot            #gpio-cells = <2>;
135*b2d2a78aSEmmanuel Vadot            gpio-controller;
136*b2d2a78aSEmmanuel Vadot        };
137*b2d2a78aSEmmanuel Vadot    };
138*b2d2a78aSEmmanuel Vadot
1397ef62cebSEmmanuel Vadot...
140