Analog Devices ADP5585 Keypad Decoder and I/O Expansion

Schema identifier ($id): "http://devicetree.org/schemas/mfd/adi,adp5585.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Laurent Pinchart <laurent.pinchart@ideasonboard.com>"

The ADP5585 is a 10/11 input/output port expander with a built in keypad matrix decoder, programmable logic, reset generator, and PWM generator.

Properties and child nodes (properties) #

compatible — required here #

Exactly one of these rules must match (oneOf) #

Rule 1

Array item rules (items)

Item 1

Allowed values (enum): "adi,adp5585-00", "adi,adp5585-01", "adi,adp5585-02", "adi,adp5585-03", "adi,adp5585-04"

Item 2

Exact value (const): "adi,adp5585"

Rule 2

Array item rules (items)

Item 1

Allowed values (enum): "adi,adp5589-00", "adi,adp5589-01", "adi,adp5589-02"

Item 2

Exact value (const): "adi,adp5589"

reg — required here #

Maximum number of items (maxItems): 1

interrupts — not listed as required here #

Maximum number of items (maxItems): 1

vdd-supply — not listed as required here #

true — No constraints added by this property rule.

reset-gpios — not listed as required here #

Maximum number of items (maxItems): 1

gpio-controller — not listed as required here #

true — No constraints added by this property rule.

#gpio-cells — not listed as required here #

Exact value (const): 2

gpio-reserved-ranges — not listed as required here #

true — No constraints added by this property rule.

#pwm-cells — not listed as required here #

Exact value (const): 3

interrupt-controller — not listed as required here #

true — No constraints added by this property rule.

#interrupt-cells — not listed as required here #

Exact value (const): 2

poll-interval — not listed as required here #

Allowed values (enum): 10, 20, 30, 40

Default value (default): 10

adi,keypad-pins — not listed as required here #

Specifies the pins used for the keypad matrix.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32-array

adi,unlock-events — not listed as required here #

Specifies a maximum of 2 events that can be used to unlock the keypad. If this property is set, the keyboard will be locked and only unlocked after these keys/gpis are pressed. The value 127 serves as a wildcard which means any key can be used for unlocking.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32-array

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 2

Array item rules (items) #

At least one of these rules must match (anyOf)

Rule 1

Minimum value (minimum): 1

Maximum value (maximum): 88

Rule 2

Minimum value (minimum): 97

Maximum value (maximum): 115

Rule 3

Exact value (const): 127

adi,unlock-trigger-sec — not listed as required here #

Defines the time in which the second unlock event must occur after the first unlock event has occurred.

Maximum value (maximum): 7

Default value (default): 0

adi,reset1-events — not listed as required here #

Defines the trigger events (key/gpi presses) that can generate reset conditions one the reset1 block.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32-array

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 3

adi,reset2-events — not listed as required here #

Defines the trigger events (key/gpi presses) that can generate reset conditions one the reset2 block.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32-array

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 2

adi,reset1-active-high — not listed as required here #

Sets the reset1 signal as active high.

Value type (type): "boolean"

adi,reset2-active-high — not listed as required here #

Sets the reset2 signal as active high.

Value type (type): "boolean"

adi,rst-passthrough-enable — not listed as required here #

Allows the RST pin to override (OR with) the reset1 signal.

Value type (type): "boolean"

adi,reset-trigger-ms — not listed as required here #

Defines the length of time that the reset events must be active before a reset signal is generated. All events must be active at the same time for the same duration.

Allowed values (enum): 0, 1000, 1500, 2000, 2500, 3000, 3500, 4000

Default value (default): 0

adi,reset-pulse-width-us — not listed as required here #

Defines the pulse width of the reset signals.

Allowed values (enum): 500, 1000, 2000, 10000

Default value (default): 500

Properties matching a name pattern (patternProperties) #

-hog(-[0-9]+)?$ — name matches this regular expression #

Value type (type): "object"

Required in this object (required): "gpio-hog"

Property dependencies (dependencies) #

linux,keymap — applies when this property is present #

Also requires: "adi,keypad-pins", "interrupts"

interrupt-controller — applies when this property is present #

Also requires: "interrupts"

adi,unlock-trigger-sec — applies when this property is present #

Also requires: "adi,unlock-events"

adi,reset1-active-high — applies when this property is present #

Also requires: "adi,reset1-events"

adi,rst-passtrough-enable — applies when this property is present #

Also requires: "adi,reset1-events"

adi,reset2-active-high — applies when this property is present #

Also requires: "adi,reset2-events"

Required in this object (required): "compatible", "reg"

All of these rules must match (allOf) #

Rule 1 #

Shared schema rule ($ref): /schemas/input/matrix-keymap.yaml#

Rule 2 #

Shared schema rule ($ref): /schemas/input/input.yaml#

Rule 3 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Exact value (const): "adi,adp5585-01"

When the condition matches (then) #

Properties and child nodes (properties)

adi,unlock-events — not listed as required here

false — Not permitted by this property rule.

adi,unlock-trigger-sec — not listed as required here

false — Not permitted by this property rule.

gpio-reserved-ranges — not listed as required here

false — Not permitted by this property rule.

reset-gpios — not listed as required here

false — Not permitted by this property rule.

adi,keypad-pins — not listed as required here

Minimum number of items (minItems): 2

Maximum number of items (maxItems): 11

Array item rules (items)

Minimum value (minimum): 0

Maximum value (maximum): 10

adi,reset1-events — not listed as required here

Array item rules (items)

At least one of these rules must match (anyOf)

Rule 1

Minimum value (minimum): 1

Maximum value (maximum): 30

Rule 2

Minimum value (minimum): 37

Maximum value (maximum): 47

adi,reset2-events — not listed as required here

Array item rules (items)

At least one of these rules must match (anyOf)

Rule 1

Minimum value (minimum): 1

Maximum value (maximum): 30

Rule 2

Minimum value (minimum): 37

Maximum value (maximum): 47

Rule 4 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Allowed values (enum): "adi,adp5585-00", "adi,adp5585-02", "adi,adp5585-03", "adi,adp5585-04"

When the condition matches (then) #

Properties and child nodes (properties)

adi,unlock-events — not listed as required here

false — Not permitted by this property rule.

adi,unlock-trigger-sec — not listed as required here

false — Not permitted by this property rule.

adi,keypad-pins — not listed as required here

Minimum number of items (minItems): 2

Maximum number of items (maxItems): 10

Array item rules (items)

Allowed values (enum): 0, 1, 2, 3, 4, 6, 7, 8, 9, 10

adi,reset1-events — not listed as required here

Array item rules (items)

At least one of these rules must match (anyOf)

Rule 1

Minimum value (minimum): 1

Maximum value (maximum): 25

Rule 2

Allowed values (enum): 37, 38, 39, 40, 41, 43, 44, 45, 46, 47

adi,reset2-events — not listed as required here

Array item rules (items)

At least one of these rules must match (anyOf)

Rule 1

Minimum value (minimum): 1

Maximum value (maximum): 25

Rule 2

Allowed values (enum): 37, 38, 39, 40, 41, 43, 44, 45, 46, 47

gpio-reserved-ranges — not listed as required here

Maximum number of items (maxItems): 1

Array item rules (items)

Array item rules (items)

Item 1

Exact value (const): 5

Item 2

Exact value (const): 1

Rule 5 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Allowed values (enum): "adi,adp5589-00", "adi,adp5589-01", "adi,adp5589-02"

When the condition matches (then) #

Properties and child nodes (properties)

gpio-reserved-ranges — not listed as required here

false — Not permitted by this property rule.

adi,keypad-pins — not listed as required here

Minimum number of items (minItems): 2

Maximum number of items (maxItems): 19

Array item rules (items)

Minimum value (minimum): 0

Maximum value (maximum): 18

adi,reset1-events — not listed as required here

Array item rules (items)

At least one of these rules must match (anyOf)

Rule 1

Minimum value (minimum): 1

Maximum value (maximum): 88

Rule 2

Minimum value (minimum): 97

Maximum value (maximum): 115

adi,reset2-events — not listed as required here

Array item rules (items)

At least one of these rules must match (anyOf)

Rule 1

Minimum value (minimum): 1

Maximum value (maximum): 88

Rule 2

Minimum value (minimum): 97

Maximum value (maximum): 115

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

Examples (examples) #

#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
    #address-cells = <1>;
    #size-cells = <0>;

    io-expander@34 {
        compatible = "adi,adp5585-00", "adi,adp5585";
        reg = <0x34>;

        vdd-supply = <&reg_3v3>;

        gpio-controller;
        #gpio-cells = <2>;
        gpio-reserved-ranges = <5 1>;

        #pwm-cells = <3>;

        interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
        interrupt-parent = <&gpio>;

        adi,reset1-events = <1 43>;
        adi,reset2-events = <2 3>;
        adi,reset-trigger-ms = <2000>;

        /*
         * col0, col1, col2
         * row0, row1, row2
         */
        adi,keypad-pins = <0 1 2 6 7 8>;

        linux,keymap = <
            MATRIX_KEY(0x00, 0x00, KEY_1)
            MATRIX_KEY(0x00, 0x01, KEY_2)
            MATRIX_KEY(0x00, 0x02, KEY_3)

            MATRIX_KEY(0x01, 0x00, KEY_A)
            MATRIX_KEY(0x01, 0x01, KEY_B)
            MATRIX_KEY(0x01, 0x02, KEY_C)

            MATRIX_KEY(0x02, 0x00, BTN_1)
            MATRIX_KEY(0x02, 0x01, BTN_2)
            MATRIX_KEY(0x02, 0x02, BTN_3)
        >;
    };
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)

Line 21: Default

Line 22: 11 GPIOs

Line 23: No pull-up resistors by default on special pins

Line 24: Alternate I2C address

Line 25: Pull-down resistors on all pins by default

Line 29: Default

Line 30: R4 defaulted to RESET1 output

Line 31: Pull-down resistors by default on special pins

Edit this page