Re: [PATCH v3 1/7] dt-bindings: mfd: gpio: Add MAX7360
From: Krzysztof Kozlowski
Date: Tue Jan 14 2025 - 03:11:46 EST
On Mon, Jan 13, 2025 at 01:42:25PM +0100, Mathieu Dubois-Briand wrote:
> + interrupt-controller: true
> +
> + "#interrupt-cells":
> + const: 2
> +
> + maxim,constant-current-disable:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: >
Drop >
> + Bit field, each bit disables constant-current output of the associated
> + GPIO, starting from the least significant bit for the first GPIO.
maximum: 0xff?
> +
> +required:
> + - compatible
> + - gpio-controller
> + - ngpios
> +
allOf: here, so you won't re-indent it later.
> +if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - maxim,max7360-gpio
> +then:
> + required:
> + - interrupt-controller
> +else:
> + properties:
> + interrupt-controller: false
> + maxim,constant-current-disable: false
> +
> + ngpios:
> + maximum: 6
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + gpio {
> + compatible = "maxim,max7360-gpio";
> +
> + gpio-controller;
> + #gpio-cells = <2>;
> + ngpios = <8>;
> + maxim,constant-current-disable = <0x06>;
> +
> + interrupt-controller;
> + #interrupt-cells = <2>;
> + };
...
> + interrupt-names:
> + items:
> + - const: inti
> + - const: intk
> +
> + keypad-debounce-delay-ms:
> + description: Keypad debounce delay in ms
> + minimum: 9
> + maximum: 40
> + default: 9
> +
> + autorepeat: true
Drop, not needed.
> +
> + rotary-debounce-delay-ms:
> + description: Rotary encoder debounce delay in ms
> + minimum: 0
> + maximum: 15
> + default: 0
> +
> + linux,axis:
> + description: The input subsystem axis to map to this rotary encoder.
Missing type. I guess you wanted to reference rotary encoder schema,
next to input and matrix-keymap?
> +
> + "#pwm-cells":
> + const: 3
> +
> + gpio:
> + $ref: /schemas/gpio/maxim,max7360-gpio.yaml#
> + description: >
Drop >
> + PORT0 to PORT7 general purpose input/output pins configuration.
> +
> + gpo:
> + $ref: /schemas/gpio/maxim,max7360-gpio.yaml#
> + description: >
Drop >
> + COL2 to COL7 general purpose output pins configuration.
> + Allows to use unused keypad columns as outputs.
> + The MAX7360 has 8 column lines and 6 of them can be used as GPOs. Value
> + of ngpios must be coherent with the value of keypad,num-columns, as their
> + sum must not exceed the number of physical lines.
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - interrupt-names
> + - linux,keymap
> + - linux,axis
> + - "#pwm-cells"
gpio and gpo nodes are optional? How would the driver behave? I assume
you need to define the partition between GPIOs, especially that 'ngpios'
are a required property in their schema.
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/input/input.h>
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + io-expander@38 {
> + compatible = "maxim,max7360";
> + reg = <0x38>;
> +
> + interrupt-parent = <&gpio1>;
> + interrupts = <23 IRQ_TYPE_LEVEL_LOW>,
> + <24 IRQ_TYPE_LEVEL_LOW>;
> + interrupt-names = "inti", "intk";
> +
> + keypad,num-rows = <8>;
> + keypad,num-columns = <4>;
> + linux,keymap = <
> + MATRIX_KEY(0x00, 0x00, KEY_F5)
> + MATRIX_KEY(0x01, 0x00, KEY_F4)
> + MATRIX_KEY(0x02, 0x01, KEY_F6)
> + >;
> + keypad-debounce-delay-ms = <10>;
> + autorepeat;
> +
> + rotary-debounce-delay-ms = <2>;
> + linux,axis = <0>; /* REL_X */
> +
> + #pwm-cells = <3>;
> +
> + max7360_gpio: gpio {
> + compatible = "maxim,max7360-gpio";
> +
> + gpio-controller;
> + #gpio-cells = <2>;
> + ngpios = <8>;
> + maxim,constant-current-disable = <0x06>;
> +
> + interrupt-controller;
> + #interrupt-cells = <0x2>;
> + };
> +
> + max7360_gpo: gpo {
> + compatible = "maxim,max7360-gpo";
> +
> + gpio-controller;
> + #gpio-cells = <2>;
> + ngpios = <4>;
> + };
> + };
> + };
>
> --
> 2.39.5
>