xref: /freebsd/sys/contrib/device-tree/Bindings/gpio/gpio-max732x.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot* MAX732x-compatible I/O expanders
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotRequired properties:
4*c66ec88fSEmmanuel Vadot  - compatible: Should be one of the following:
5*c66ec88fSEmmanuel Vadot    - "maxim,max7319": For the Maxim MAX7319
6*c66ec88fSEmmanuel Vadot    - "maxim,max7320": For the Maxim MAX7320
7*c66ec88fSEmmanuel Vadot    - "maxim,max7321": For the Maxim MAX7321
8*c66ec88fSEmmanuel Vadot    - "maxim,max7322": For the Maxim MAX7322
9*c66ec88fSEmmanuel Vadot    - "maxim,max7323": For the Maxim MAX7323
10*c66ec88fSEmmanuel Vadot    - "maxim,max7324": For the Maxim MAX7324
11*c66ec88fSEmmanuel Vadot    - "maxim,max7325": For the Maxim MAX7325
12*c66ec88fSEmmanuel Vadot    - "maxim,max7326": For the Maxim MAX7326
13*c66ec88fSEmmanuel Vadot    - "maxim,max7327": For the Maxim MAX7327
14*c66ec88fSEmmanuel Vadot  - reg: I2C slave address for this device.
15*c66ec88fSEmmanuel Vadot  - gpio-controller: Marks the device node as a GPIO controller.
16*c66ec88fSEmmanuel Vadot  - #gpio-cells: Should be 2.
17*c66ec88fSEmmanuel Vadot    - first cell is the GPIO number
18*c66ec88fSEmmanuel Vadot    - second cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.
19*c66ec88fSEmmanuel Vadot      Only the GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
20*c66ec88fSEmmanuel Vadot
21*c66ec88fSEmmanuel VadotOptional properties:
22*c66ec88fSEmmanuel Vadot
23*c66ec88fSEmmanuel Vadot  The I/O expander can detect input state changes, and thus optionally act as
24*c66ec88fSEmmanuel Vadot  an interrupt controller. When the expander interrupt line is connected all the
25*c66ec88fSEmmanuel Vadot  following properties must be set. For more information please see the
26*c66ec88fSEmmanuel Vadot  interrupt controller device tree bindings documentation available at
27*c66ec88fSEmmanuel Vadot  Documentation/devicetree/bindings/interrupt-controller/interrupts.txt.
28*c66ec88fSEmmanuel Vadot
29*c66ec88fSEmmanuel Vadot  - interrupt-controller: Identifies the node as an interrupt controller.
30*c66ec88fSEmmanuel Vadot  - #interrupt-cells: Number of cells to encode an interrupt source, shall be 2.
31*c66ec88fSEmmanuel Vadot    - first cell is the pin number
32*c66ec88fSEmmanuel Vadot    - second cell is used to specify flags
33*c66ec88fSEmmanuel Vadot  - interrupts: Interrupt specifier for the controllers interrupt.
34*c66ec88fSEmmanuel Vadot
35*c66ec88fSEmmanuel VadotPlease refer to gpio.txt in this directory for details of the common GPIO
36*c66ec88fSEmmanuel Vadotbindings used by client devices.
37*c66ec88fSEmmanuel Vadot
38*c66ec88fSEmmanuel VadotExample 1. MAX7325 with interrupt support enabled (CONFIG_GPIO_MAX732X_IRQ=y):
39*c66ec88fSEmmanuel Vadot
40*c66ec88fSEmmanuel Vadot	expander: max7325@6d {
41*c66ec88fSEmmanuel Vadot		compatible = "maxim,max7325";
42*c66ec88fSEmmanuel Vadot		reg = <0x6d>;
43*c66ec88fSEmmanuel Vadot		gpio-controller;
44*c66ec88fSEmmanuel Vadot		#gpio-cells = <2>;
45*c66ec88fSEmmanuel Vadot		interrupt-controller;
46*c66ec88fSEmmanuel Vadot		#interrupt-cells = <2>;
47*c66ec88fSEmmanuel Vadot		interrupt-parent = <&gpio4>;
48*c66ec88fSEmmanuel Vadot		interrupts = <29 IRQ_TYPE_EDGE_FALLING>;
49*c66ec88fSEmmanuel Vadot	};
50*c66ec88fSEmmanuel Vadot
51*c66ec88fSEmmanuel VadotExample 2. MAX7325 with interrupt support disabled (CONFIG_GPIO_MAX732X_IRQ=n):
52*c66ec88fSEmmanuel Vadot
53*c66ec88fSEmmanuel Vadot	expander: max7325@6d {
54*c66ec88fSEmmanuel Vadot		compatible = "maxim,max7325";
55*c66ec88fSEmmanuel Vadot		reg = <0x6d>;
56*c66ec88fSEmmanuel Vadot		gpio-controller;
57*c66ec88fSEmmanuel Vadot		#gpio-cells = <2>;
58*c66ec88fSEmmanuel Vadot	};
59