Re: [PATCH v5 01/11] dt-bindings: mfd: gpio: Add MAX7360

From: Mathieu Dubois-Briand
Date: Mon Mar 31 2025 - 04:48:16 EST


On Tue Mar 18, 2025 at 5:26 PM CET, Mathieu Dubois-Briand wrote:
> Add device tree bindings for Maxim Integrated MAX7360 device with
> support for keypad, rotary, gpios and pwm functionalities.
>
> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@xxxxxxxxxxx>
> ---

Hi,

Following discussion we had under the PWM patch of this series, we might
need to refactor a bit the device tree binding architecture, adding two
new subnodes, one for pinctrl and one for PWM.

This will need create two new compatible values with associated bindings
and modify a bit the properties of the maxim,max7360.yaml binding.

Here is the example modified to reflect what I have in mind.

> ...
>
> diff --git a/Documentation/devicetree/bindings/mfd/maxim,max7360.yaml b/Documentation/devicetree/bindings/mfd/maxim,max7360.yaml
> new file mode 100644
> index 000000000000..d3c09531dc5c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/maxim,max7360.yaml
> @@ -0,0 +1,170 @@
>
> ...
>
> +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 */
> +

+ max7360_pwm: pwm {
+ compatible = "maxim,max7360-pwm";

> + #pwm-cells = <3>;

+ };

> +
> + max7360_gpio: gpio {
> + compatible = "maxim,max7360-gpio";
> +
> + gpio-controller;
> + #gpio-cells = <2>;
> + maxim,constant-current-disable = <0x06>;
> +
> + interrupt-controller;
> + #interrupt-cells = <0x2>;
> + };
> +
> + max7360_gpo: gpo {
> + compatible = "maxim,max7360-gpo";
> +
> + gpio-controller;
> + #gpio-cells = <2>;
> + };

+ pinctrl {
+ compatible = "maxim,max7360-pinctrl";

> +
> + backlight_pins: backlight-pins {
> + pins = "PORT2";
> + function = "pwm";
> + };

+ };

> + };
> + };

This would allow to assign a device tree node to both the pinctrl and
the PWM devices in the kernel?

Is there any comment regarding this proposal? Without any specific
comment, I will send a new version with these changes in a few days.

Best regards,
Mathieu

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com